예제 #1
0
 /**
  * OBSOLETE: Set the name of the field holding the sequence name.
  *
  * @deprecated use ((SDKSequence)getDefaultSequence()).setNameFieldName() instead
  */
 public void setSequenceNameFieldName(String sequenceNameFieldName) {
   if (getDefaultSequence() instanceof SDKSequence) {
     ((SDKSequence) getDefaultSequence()).setNameFieldName(sequenceNameFieldName);
   } else if (!sequenceNameFieldName.equals((new SDKSequence()).getNameFieldName())) {
     throw ValidationException.wrongSequenceType(
         Helper.getShortClassName(getDefaultSequence()), "setNameFieldName");
   }
 }
예제 #2
0
 public String toString() {
   StringWriter writer = new StringWriter();
   writer.write(Helper.getShortClassName(getClass()));
   writer.write("(");
   writer.write(getValue().toString());
   writer.write(")");
   return writer.toString();
 }
예제 #3
0
 /**
  * If using native SQL then print a byte[] literally as a hex string otherwise use ODBC format as
  * provided in DatabasePlatform.
  */
 protected void appendByteArray(byte[] bytes, Writer writer) throws IOException {
   if (usesNativeSQL()) {
     writer.write("Ox");
     Helper.writeHexString(bytes, writer);
   } else {
     super.appendByteArray(bytes, writer);
   }
 }
예제 #4
0
 /**
  * OBSOLETE: Return the name of the field holding the sequence name.
  *
  * @deprecated use ((SDKSequence)getDefaultSequence()).getNameFieldName() instead
  */
 public String getSequenceNameFieldName() {
   if (getDefaultSequence() instanceof SDKSequence) {
     return ((SDKSequence) getDefaultSequence()).getNameFieldName();
   } else {
     throw ValidationException.wrongSequenceType(
         Helper.getShortClassName(getDefaultSequence()), "getNameFieldName");
   }
 }
예제 #5
0
 /**
  * INTERNAL: Appends an Oracle specific Timestamp, if usesNativeSQL is true otherwise use the ODBC
  * format. Native Format: to_timestamp ('1997-11-06 10:35:45.656' , 'yyyy-mm-dd hh:mm:ss.ff')
  */
 protected void appendTimestamp(java.sql.Timestamp timestamp, Writer writer) throws IOException {
   if (usesNativeSQL()) {
     writer.write("to_timestamp('");
     writer.write(Helper.printTimestamp(timestamp));
     writer.write("','yyyy-mm-dd HH24:MI:SS.FF')");
   } else {
     super.appendTimestamp(timestamp, writer);
   }
 }
예제 #6
0
 /**
  * Appends an MySQL specific Timestamp, if usesNativeSQL is true otherwise use the ODBC format.
  * Native Format: 'YYYY-MM-DD HH:MM:SS'
  */
 protected void appendCalendar(Calendar calendar, Writer writer) throws IOException {
   if (usesNativeSQL()) {
     writer.write("TIMESTAMP '");
     writer.write(Helper.printCalendarWithoutNanos(calendar));
     writer.write("'");
   } else {
     super.appendCalendar(calendar, writer);
   }
 }
예제 #7
0
 /**
  * Appends an MySQL specific Timestamp, if usesNativeSQL is true otherwise use the ODBC format.
  * Native Format: 'YYYY-MM-DD HH:MM:SS'
  */
 protected void appendTimestamp(java.sql.Timestamp timestamp, Writer writer) throws IOException {
   if (usesNativeSQL()) {
     writer.write("TIMESTAMP '");
     writer.write(Helper.printTimestampWithoutNanos(timestamp));
     writer.write("'");
   } else {
     super.appendTimestamp(timestamp, writer);
   }
 }
예제 #8
0
 /**
  * Appends an MySQL specific time if usesNativeSQL is true otherwise use the ODBC format. Native
  * FORMAT: 'HH:MM:SS'.
  */
 protected void appendTime(java.sql.Time time, Writer writer) throws IOException {
   if (usesNativeSQL()) {
     writer.write("TIME '");
     writer.write(Helper.printTime(time));
     writer.write("'");
   } else {
     super.appendTime(time, writer);
   }
 }
예제 #9
0
 /**
  * Appends an MySQL specific date if usesNativeSQL is true otherwise use the ODBC format. Native
  * FORMAT: 'YYYY-MM-DD'
  */
 protected void appendDate(java.sql.Date date, Writer writer) throws IOException {
   if (usesNativeSQL()) {
     writer.write("DATE '");
     writer.write(Helper.printDate(date));
     writer.write("'");
   } else {
     super.appendDate(date, writer);
   }
 }
 public String toString() {
   return Helper.getShortClassName(getClass()) + "(" + getFullName() + ")";
 }