Skip to content

Commit

Permalink
Properly deal with empty tags
Browse files Browse the repository at this point in the history
  • Loading branch information
ar committed Sep 19, 2017
1 parent fa4b2ad commit 66ff3d2
Showing 1 changed file with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,12 @@
@Converter(autoApply = true)
public class TagsConverter implements AttributeConverter<Tags,String> {
@Override
public String convertToDatabaseColumn(Tags attribute) {
return attribute.toString();
public String convertToDatabaseColumn(Tags tags) {
return tags != null && tags.size() > 0 ? tags.toString() : "";
}

@Override
public Tags convertToEntityAttribute(String dbData) {
return new Tags(dbData);
}
}

0 comments on commit 66ff3d2

Please sign in to comment.