DBasePlatformpublic class DBasePlatform extends DatabasePlatform Purpose: Provides DBase specific behaviour.
Responsibilities:
- Writing Time & Timestamp as strings since they are not supported.
|
Methods Summary |
---|
protected java.util.Hashtable | buildFieldTypes()
Hashtable fieldTypeMapping;
fieldTypeMapping = new Hashtable();
fieldTypeMapping.put(Boolean.class, new FieldTypeDefinition("NUMBER", 1));
fieldTypeMapping.put(Integer.class, new FieldTypeDefinition("NUMBER", 11));
fieldTypeMapping.put(Long.class, new FieldTypeDefinition("NUMBER", 19));
fieldTypeMapping.put(Float.class, new FieldTypeDefinition("NUMBER", 12, 5).setLimits(19, 0, 19));
fieldTypeMapping.put(Double.class, new FieldTypeDefinition("NUMBER", 10, 5).setLimits(19, 0, 19));
fieldTypeMapping.put(Short.class, new FieldTypeDefinition("NUMBER", 6));
fieldTypeMapping.put(Byte.class, new FieldTypeDefinition("NUMBER", 4));
fieldTypeMapping.put(java.math.BigInteger.class, new FieldTypeDefinition("NUMBER", 19));
fieldTypeMapping.put(java.math.BigDecimal.class, new FieldTypeDefinition("NUMBER", 19).setLimits(19, 0, 9));
fieldTypeMapping.put(Number.class, new FieldTypeDefinition("NUMBER", 19).setLimits(19, 0, 9));
fieldTypeMapping.put(String.class, new FieldTypeDefinition("CHAR", 255));
fieldTypeMapping.put(Character.class, new FieldTypeDefinition("CHAR", 1));
fieldTypeMapping.put(Byte[].class, new FieldTypeDefinition("BINARY"));
fieldTypeMapping.put(Character[].class, new FieldTypeDefinition("MEMO"));
fieldTypeMapping.put(byte[].class, new FieldTypeDefinition("BINARY"));
fieldTypeMapping.put(char[].class, new FieldTypeDefinition("MEMO"));
fieldTypeMapping.put(java.sql.Blob.class, new FieldTypeDefinition("BINARY"));
fieldTypeMapping.put(java.sql.Clob.class, new FieldTypeDefinition("MEMO"));
fieldTypeMapping.put(java.sql.Date.class, new FieldTypeDefinition("DATE", false));
fieldTypeMapping.put(java.sql.Time.class, new FieldTypeDefinition("CHAR", 15));
fieldTypeMapping.put(java.sql.Timestamp.class, new FieldTypeDefinition("CHAR", 25));
return fieldTypeMapping;
| public java.lang.Object | convertToDatabaseType(java.lang.Object value)INTERNAL:
DBase does not support Time/Timestamp so we must map to strings.
2.0p22: protected->public INTERNAL
Object dbValue = super.convertToDatabaseType(value);
if ((dbValue instanceof java.sql.Time) || (dbValue instanceof java.sql.Timestamp)) {
return dbValue.toString();
}
return dbValue;
| public int | getMaxFieldNameSize()INTERNAL:
returns the maximum number of characters that can be used in a field
name on this platform.
return 10;
| public java.lang.String | getSelectForUpdateString()INTERNAL:
return " FOR UPDATE OF *";
| public boolean | isDBase()
return true;
| public java.util.Hashtable | maximumNumericValues()INTERNAL:
Builds a table of minimum numeric values keyed on java class. This is used for type testing but
might also be useful to end users attempting to sanitize values.
NOTE: BigInteger & BigDecimal minimums are dependent upon their precision & Scale
Hashtable values = new Hashtable();
values.put(Integer.class, new Integer(Integer.MAX_VALUE));
values.put(Long.class, Long.valueOf("922337203685478000"));
values.put(Double.class, new Double("99999999.999999999"));
values.put(Short.class, new Short(Short.MIN_VALUE));
values.put(Byte.class, new Byte(Byte.MIN_VALUE));
values.put(Float.class, new Float("99999999.999999999"));
values.put(java.math.BigInteger.class, new java.math.BigInteger("922337203685478000"));
values.put(java.math.BigDecimal.class, new java.math.BigDecimal("999999.999999999"));
return values;
| public java.util.Hashtable | minimumNumericValues()INTERNAL:
Builds a table of minimum numeric values keyed on java class. This is used for type testing but
might also be useful to end users attempting to sanitize values.
NOTE: BigInteger & BigDecimal minimums are dependent upon their precision & Scale
Hashtable values = new Hashtable();
values.put(Integer.class, new Integer(Integer.MIN_VALUE));
values.put(Long.class, Long.valueOf("-922337203685478000"));
values.put(Double.class, new Double("-99999999.999999999"));
values.put(Short.class, new Short(Short.MIN_VALUE));
values.put(Byte.class, new Byte(Byte.MIN_VALUE));
values.put(Float.class, new Float("-99999999.999999999"));
values.put(java.math.BigInteger.class, new java.math.BigInteger("-922337203685478000"));
values.put(java.math.BigDecimal.class, new java.math.BigDecimal("-999999.999999999"));
return values;
| public void | printFieldNotNullClause(java.io.Writer writer)INTERNAL:
Append the receiver's field 'NOT NULL' constraint clause to a writer.
// Do nothing
| public boolean | shouldUseJDBCOuterJoinSyntax()INTERNAL:
JDBC defines and outer join syntax, many drivers do not support this. So we normally avoid it.
return false;
| public boolean | supportsForeignKeyConstraints()INTERNAL:
return false;
| public boolean | supportsPrimaryKeyConstraint()INTERNAL:
return false;
|
|