From 66ff3d2f25a493d69f0cc79153879f45b9028906 Mon Sep 17 00:00:00 2001 From: Alejandro Revilla Date: Mon, 18 Sep 2017 21:04:02 -0300 Subject: [PATCH] Properly deal with empty tags --- .../src/main/java/org/jpos/ee/converter/TagsConverter.java | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/modules/dbsupport/src/main/java/org/jpos/ee/converter/TagsConverter.java b/modules/dbsupport/src/main/java/org/jpos/ee/converter/TagsConverter.java index 307b3f36ce..4959abce74 100644 --- a/modules/dbsupport/src/main/java/org/jpos/ee/converter/TagsConverter.java +++ b/modules/dbsupport/src/main/java/org/jpos/ee/converter/TagsConverter.java @@ -25,8 +25,8 @@ @Converter(autoApply = true) public class TagsConverter implements AttributeConverter { @Override - public String convertToDatabaseColumn(Tags attribute) { - return attribute.toString(); + public String convertToDatabaseColumn(Tags tags) { + return tags != null && tags.size() > 0 ? tags.toString() : ""; } @Override @@ -34,4 +34,3 @@ public Tags convertToEntityAttribute(String dbData) { return new Tags(dbData); } } -