better handling of precision
authorAndreas Müller <a.mueller@bgbm.org>
Wed, 11 Apr 2012 09:42:26 +0000 (09:42 +0000)
committerAndreas Müller <a.mueller@bgbm.org>
Wed, 11 Apr 2012 09:42:26 +0000 (09:42 +0000)
cdmlib-io/src/main/java/eu/etaxonomy/cdm/io/common/mapping/out/DbSingleAttributeExportMapperBase.java

index 6355fad225a7d4d66a0ede42ad08b1cd8b0aff85..fb2b05163e47791e055c2ca638d0a29494a80af6 100644 (file)
@@ -101,7 +101,7 @@ public abstract class DbSingleAttributeExportMapperBase<STATE extends DbExportSt
 //                                     if (strValue.length() > 255){\r
 //                                             logger.debug("String to long (" + strValue.length() + ") for object " + cdmBase.toString() + ": " + value);\r
 //                                     }\r
-                                       if (strValue.length() > getPrecision() && getPrecision() != -1 ){\r
+                                       if (strValue.length() > getPrecision() && getPrecision() > 0 ){\r
                                                logger.warn("The length of the string to save is longer than the database columns precision. String will be truncated: " + strValue);\r
                                                if (getPrecision() >= 4) {\r
                                                        strValue = strValue.substring(0, getPrecision() - 4 )+" ...";\r