예제 #1
0
 /** Return the proper synthetic null indicator value for the given instance. */
 public Object getNullIndicatorValue(OpenJPAStateManager sm) {
   Column[] cols = cls.getEmbeddingMapping().getColumns();
   if (cols.length != 1) return null;
   if (sm == null && !cols[0].isNotNull()) return null;
   if (sm == null) return JavaSQLTypes.getEmptyValue(cols[0].getJavaType());
   return JavaSQLTypes.getNonEmptyValue(cols[0].getJavaType());
 }
예제 #2
0
 /** Return whether the given null indicator value means the object is null. */
 public boolean indicatesNull(Object val) {
   Column[] cols = cls.getEmbeddingMapping().getColumns();
   if (cols.length != 1) return false;
   if (val == null) return true;
   if (cols[0].isNotNull() && val.equals(JavaSQLTypes.getEmptyValue(cols[0].getJavaType())))
     return true;
   if (cols[0].getDefaultString() != null && val.toString().equals(cols[0].getDefaultString()))
     return true;
   return false;
 }