Пример #1
0
 /**
  * INTERNAL Used by SQLCall.appendModify(..) If the field should be passed to
  * customModifyInDatabaseCall, retun true, otherwise false. Methods
  * shouldCustomModifyInDatabaseCall and customModifyInDatabaseCall should be kept in sync:
  * shouldCustomModifyInDatabaseCall should return true if and only if the field is handled by
  * customModifyInDatabaseCall.
  */
 public boolean shouldUseCustomModifyForCall(DatabaseField field) {
   Class type = field.getType();
   if ((type != null) && isOracle9Specific(type)) {
     return true;
   }
   return super.shouldUseCustomModifyForCall(field);
 }
Пример #2
0
 /**
  * INTERNAL: Used by SQLCall.translate(..) The binding *must* be performed (NCHAR, NSTRING,
  * NCLOB). In these special cases the method returns a wrapper object which knows whether it
  * should be bound or appended and knows how to do that.
  */
 public Object getCustomModifyValueForCall(
     Call call, Object value, DatabaseField field, boolean shouldBind) {
   Class type = field.getType();
   if ((type != null) && isOracle9Specific(type)) {
     if (value == null) {
       return null;
     }
     if (NCHAR.equals(type) || NSTRING.equals(type)) {
       return new NTypeBindCallCustomParameter(value);
     } else if (NCLOB.equals(type)) {
       value = convertToDatabaseType(value);
       if (shouldUseLocatorForLOBWrite()) {
         if (lobValueExceedsLimit(value)) {
           ((DatabaseCall) call).addContext(field, value);
           value = new String(" ");
         }
       }
       return new NTypeBindCallCustomParameter(value);
     } else if (XMLTYPE.equals(type)) {
       return getXMLTypeFactory().createXMLTypeBindCallCustomParameter(value);
     }
   }
   return super.getCustomModifyValueForCall(call, value, field, shouldBind);
 }