else\r
{\r
Partial p = ((Partial) value);\r
- String strYear = getNullFilledString(p, DateTimeFieldType.year(),4);\r
- String strMonth = getNullFilledString(p, DateTimeFieldType.monthOfYear(),2);\r
- String strDay = getNullFilledString(p, DateTimeFieldType.dayOfMonth(),2);\r
- String result = strYear + strMonth + strDay;\r
- Hibernate.STRING.nullSafeSet(preparedStatement, result, index);\r
+ Hibernate.STRING.nullSafeSet(preparedStatement, partialToString(p), index);\r
}\r
}\r
+\r
+ public static String partialToString(Partial p) {\r
+ String strYear = getNullFilledString(p, DateTimeFieldType.year(),4);\r
+ String strMonth = getNullFilledString(p, DateTimeFieldType.monthOfYear(),2);\r
+ String strDay = getNullFilledString(p, DateTimeFieldType.dayOfMonth(),2);\r
+ String result = strYear + strMonth + strDay;\r
+ return result;\r
+ }\r
\r
- private String getNullFilledString(Partial partial, DateTimeFieldType type, int count){\r
+ private static String getNullFilledString(Partial partial, DateTimeFieldType type, int count){\r
String nul = "0000000000";\r
if (! partial.isSupported(type)){\r
return nul.substring(0, count);\r