Methods Summary |
---|
protected void | appendByteArray(byte[] bytes, java.io.Writer writer)If using native SQL then print a byte[] literally as a hex string otherwise use ODBC format
as provided in DatabasePlatform.
if (usesNativeSQL()) {
writer.write("Ox");
Helper.writeHexString(bytes, writer);
} else {
super.appendByteArray(bytes, writer);
}
|
protected void | appendCalendar(java.util.Calendar calendar, java.io.Writer writer)Appends an MySQL specific Timestamp, if usesNativeSQL is true otherwise use the ODBC format.
Native Format: 'YYYY-MM-DD HH:MM:SS'
if (usesNativeSQL()) {
writer.write("TIMESTAMP '");
writer.write(Helper.printCalendarWithoutNanos(calendar));
writer.write("'");
} else {
super.appendCalendar(calendar, writer);
}
|
protected void | appendDate(java.sql.Date date, java.io.Writer writer)Appends an MySQL specific date if usesNativeSQL is true otherwise use the ODBC format.
Native FORMAT: 'YYYY-MM-DD'
if (usesNativeSQL()) {
writer.write("DATE '");
writer.write(Helper.printDate(date));
writer.write("'");
} else {
super.appendDate(date, writer);
}
|
protected void | appendTime(java.sql.Time time, java.io.Writer writer)Appends an MySQL specific time if usesNativeSQL is true otherwise use the ODBC format.
Native FORMAT: 'HH:MM:SS'.
if (usesNativeSQL()) {
writer.write("TIME '");
writer.write(Helper.printTime(time));
writer.write("'");
} else {
super.appendTime(time, writer);
}
|
protected void | appendTimestamp(java.sql.Timestamp timestamp, java.io.Writer writer)Appends an MySQL specific Timestamp, if usesNativeSQL is true otherwise use the ODBC format.
Native Format: 'YYYY-MM-DD HH:MM:SS'
if (usesNativeSQL()) {
writer.write("TIMESTAMP '");
writer.write(Helper.printTimestampWithoutNanos(timestamp));
writer.write("'");
} else {
super.appendTimestamp(timestamp, writer);
}
|
protected java.util.Hashtable | buildFieldTypes()Return the mapping of class types to database types for the schema framework.
Hashtable fieldTypeMapping;
fieldTypeMapping = new Hashtable();
fieldTypeMapping.put(Boolean.class, new FieldTypeDefinition("TINYINT", false));
fieldTypeMapping.put(Integer.class, new FieldTypeDefinition("INTEGER", false));
fieldTypeMapping.put(Long.class, new FieldTypeDefinition("BIGINT", false));
fieldTypeMapping.put(Float.class, new FieldTypeDefinition("FLOAT", false));
fieldTypeMapping.put(Double.class, new FieldTypeDefinition("DOUBLE", false));
fieldTypeMapping.put(Short.class, new FieldTypeDefinition("SMALLINT", false));
fieldTypeMapping.put(Byte.class, new FieldTypeDefinition("TINYINT", false));
fieldTypeMapping.put(java.math.BigInteger.class, new FieldTypeDefinition("BIGINT", false));
fieldTypeMapping.put(java.math.BigDecimal.class, new FieldTypeDefinition("DECIMAL(38)", false));
fieldTypeMapping.put(Number.class, new FieldTypeDefinition("DECIMAL(38)", false));
fieldTypeMapping.put(String.class, new FieldTypeDefinition("VARCHAR", 255));
fieldTypeMapping.put(Character.class, new FieldTypeDefinition("CHAR", 1));
fieldTypeMapping.put(Byte[].class, new FieldTypeDefinition("VARBINARY", 64000));
fieldTypeMapping.put(Character[].class, new FieldTypeDefinition("VARCHAR", 64000));
fieldTypeMapping.put(byte[].class, new FieldTypeDefinition("VARBINARY", 64000));
fieldTypeMapping.put(char[].class, new FieldTypeDefinition("VARCHAR", 64000));
fieldTypeMapping.put(java.sql.Blob.class, new FieldTypeDefinition("VARBINARY", 64000));
fieldTypeMapping.put(java.sql.Clob.class, new FieldTypeDefinition("VARCHAR", 64000));
fieldTypeMapping.put(java.sql.Date.class, new FieldTypeDefinition("DATE", false));
fieldTypeMapping.put(java.sql.Time.class, new FieldTypeDefinition("TIME", false));
fieldTypeMapping.put(java.sql.Timestamp.class, new FieldTypeDefinition("TIMESTAMP", false));
return fieldTypeMapping;
|
public oracle.toplink.essentials.queryframework.ValueReadQuery | buildSelectQueryForNativeSequence(java.lang.String seqName, java.lang.Integer size)INTERNAL:
Produce a DataReadQuery which updates(!) the sequence number in the db
and returns it.
return new ValueReadQuery("SELECT " + getQualifiedSequenceName(seqName) + ".NEXTVAL FROM DUAL");
|
public java.lang.String | getCreateViewString()INTERNAL:
Used for view creation.
return "CREATE MATERIALIZED VIEW ";
|
protected java.lang.String | getQualifiedSequenceName(java.lang.String seqName)Prepend sequence name with table qualifier (if any)
if (getTableQualifier().equals("")) {
return seqName;
} else {
return getTableQualifier() + "." + seqName;
}
|
public java.lang.String | getSelectForUpdateString()INTERNAL:
Used for pessimistic locking.
return " FOR UPDATE";
|
public oracle.toplink.essentials.queryframework.ValueReadQuery | getTimestampQuery()PUBLIC:
This method returns the query to select the timestamp
from the server for TimesTen.
if (timestampQuery == null) {
timestampQuery = new ValueReadQuery();
timestampQuery.setSQLString("SELECT SYSDATE FROM DUAL");
}
return timestampQuery;
|
protected void | initializePlatformOperators()Initialize any platform-specific operators
super.initializePlatformOperators();
addOperator(ExpressionOperator.simpleTwoArgumentFunction(ExpressionOperator.Concat, "CONCAT"));
addOperator(operatorOuterJoin());
addOperator(ExpressionOperator.ifNull());
|
public boolean | isTimesTen()Answers whether platform is TimesTen
return true;
|
protected oracle.toplink.essentials.expressions.ExpressionOperator | operatorOuterJoin()Create the outer join operator for this platform
ExpressionOperator result = new ExpressionOperator();
result.setSelector(ExpressionOperator.EqualOuterJoin);
Vector v = new Vector(2);
v.addElement(" (+) = ");
result.printsAs(v);
result.bePostfix();
result.setNodeClass(RelationExpression.class);
return result;
|
public void | setSupportsForeignKeyConstraints(boolean supportsForeignKeyConstraints)
this.supportsForeignKeyConstraints = supportsForeignKeyConstraints;
|
public boolean | shouldPrintOuterJoinInWhereClause()Some database require outer joins to be given in the where clause, others require it in the from clause.
return true;
|
public boolean | supportsForeignKeyConstraints()
return supportsForeignKeyConstraints;
|
public boolean | supportsNativeSequenceNumbers()Return true if the receiver uses host sequence numbers, generated on the database.
TimesTen does through global sequence objects.
return true;
|