Methods Summary |
---|
protected void | appendByteArray(byte[] bytes, java.io.Writer writer)INTERNAL:
TODO: Need to find out how can byte arrays be inlined in Derby
super.appendByteArray(bytes, writer);
|
protected java.util.Hashtable | buildFieldTypes()
Hashtable fieldTypeMapping = new Hashtable();
fieldTypeMapping.put(Boolean.class, new FieldTypeDefinition("SMALLINT DEFAULT 0", false));
fieldTypeMapping.put(Integer.class, new FieldTypeDefinition("INTEGER", false));
fieldTypeMapping.put(Long.class, new FieldTypeDefinition("BIGINT", false));
fieldTypeMapping.put(Float.class, new FieldTypeDefinition("FLOAT"));
fieldTypeMapping.put(Double.class, new FieldTypeDefinition("FLOAT", false));
fieldTypeMapping.put(Short.class, new FieldTypeDefinition("SMALLINT", false));
fieldTypeMapping.put(Byte.class, new FieldTypeDefinition("SMALLINT", false));
fieldTypeMapping.put(java.math.BigInteger.class, new FieldTypeDefinition("BIGINT", false));
fieldTypeMapping.put(java.math.BigDecimal.class, new FieldTypeDefinition("DECIMAL"));
fieldTypeMapping.put(Number.class, new FieldTypeDefinition("DECIMAL"));
fieldTypeMapping.put(String.class, new FieldTypeDefinition("VARCHAR", 255));
fieldTypeMapping.put(Character.class, new FieldTypeDefinition("CHAR", 1));
fieldTypeMapping.put(Byte[].class, new FieldTypeDefinition("BLOB", 64000));
fieldTypeMapping.put(Character[].class, new FieldTypeDefinition("CLOB", 64000));
fieldTypeMapping.put(byte[].class, new FieldTypeDefinition("BLOB", 64000));
fieldTypeMapping.put(char[].class, new FieldTypeDefinition("CLOB", 64000));
fieldTypeMapping.put(java.sql.Blob.class, new FieldTypeDefinition("BLOB", 64000));
fieldTypeMapping.put(java.sql.Clob.class, new FieldTypeDefinition("CLOB", 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()INTERNAL:
Build the identity query for native sequencing.
ValueReadQuery selectQuery = new ValueReadQuery();
selectQuery.setSQLString("values IDENTITY_VAL_LOCAL()");
return selectQuery;
|
protected java.lang.String | getCreateTempTableSqlBodyForTable(oracle.toplink.essentials.internal.helper.DatabaseTable table)INTERNAL:
// returning null includes fields of the table in body
// see javadoc of DatabasePlatform#getCreateTempTableSqlBodyForTable(DataBaseTable)
// for details
return null;
|
protected java.lang.String | getCreateTempTableSqlSuffix()INTERNAL:
return " ON COMMIT DELETE ROWS NOT LOGGED";
|
public java.lang.String | getInOutputProcedureToken()This method is used to print the output parameter token when stored
procedures are called
return "INOUT";
|
public java.util.Vector | getNativeTableInfo(java.lang.String table, java.lang.String creator, oracle.toplink.essentials.internal.sessions.AbstractSession session)
throw new RuntimeException("Should never reach here");
|
public java.lang.String | getProcedureBeginString()Used for stored procedure defs.
return getBatchBeginString();
|
public java.lang.String | getProcedureEndString()Used for stored procedure defs.
return getBatchEndString();
|
public oracle.toplink.essentials.queryframework.ValueReadQuery | getTimestampQuery()INTERNAL:
This method returns the query to select the timestamp from the server
for Derby.
if (timestampQuery == null) {
timestampQuery = new ValueReadQuery();
timestampQuery.setSQLString("VALUES CURRENT_TIMESTAMP");
}
return timestampQuery;
|
public boolean | isDB2()
//This class inhertits from DB2. But it is not DB2
return false;
|
public boolean | isDerby()INTERNAL:
Answers whether platform is Derby
return true;
|
public void | printFieldIdentityClause(java.io.Writer writer)INTERNAL:
Append the receiver's field 'identity' constraint clause to a writer.
try {
writer.write(" GENERATED ALWAYS AS IDENTITY");
} catch (IOException ioException) {
throw ValidationException.fileError(ioException);
}
|
public boolean | shouldIgnoreException(java.sql.SQLException exception)Allow for the platform to ignore exceptions.
// Nothing is ignored.
return false;
|
public boolean | shouldNativeSequenceAcquireValueAfterInsert()INTERNAL:
Indicates whether NativeSequence should retrieve
sequence value after the object has been inserted into the db
This method is to be used *ONLY* by sequencing classes
return true;
|
public boolean | shouldPrintOutputTokenAtStart()This is required in the construction of the stored procedures with
output parameters
//TODO: Check with the reviewer where this is used
return false;
|
protected boolean | shouldTempTableSpecifyPrimaryKeys()INTERNAL:
Indicates whether temporary table can specify primary keys (some platforms don't allow that).
Used by writeCreateTempTableSql method.
return false;
|
public boolean | supportsNativeSequenceNumbers()
return true;
|
public void | writeUpdateOriginalFromTempTableSql(java.io.Writer writer, oracle.toplink.essentials.internal.helper.DatabaseTable table, java.util.Collection pkFields, java.util.Collection assignedFields)INTERNAL:
May need to override this method if the platform supports temporary tables
and the generated sql doesn't work.
Write an sql string for updating the original table from the temporary table.
Precondition: supportsTempTables() == true.
Precondition: pkFields and assignFields don't intersect.
writer.write("UPDATE ");
String tableName = table.getQualifiedName();
writer.write(tableName);
writer.write(" SET ");
String tempTableName = getTempTableForTable(table).getQualifiedName();
boolean isFirst = true;
Iterator itFields = assignedFields.iterator();
while(itFields.hasNext()) {
if(isFirst) {
isFirst = false;
} else {
writer.write(", ");
}
DatabaseField field = (DatabaseField)itFields.next();
String fieldName = field.getName();
writer.write(fieldName);
writer.write(" = (SELECT ");
writer.write(fieldName);
writer.write(" FROM ");
writer.write(tempTableName);
writeAutoJoinWhereClause(writer, null, tableName, pkFields);
writer.write(")");
}
writer.write(" WHERE EXISTS(SELECT ");
writer.write(((DatabaseField)pkFields.iterator().next()).getName());
writer.write(" FROM ");
writer.write(tempTableName);
writeAutoJoinWhereClause(writer, null, tableName, pkFields);
writer.write(")");
|