@Override
protected Hashtable<Class<?>, FieldTypeDefinition> buildFieldTypes() {
Hashtable<Class<?>, FieldTypeDefinition> fieldTypeMapping = new Hashtable<Class<?>, FieldTypeDefinition>();
// boolean type
fieldTypeMapping.put(java.lang.Boolean.class, new FieldTypeDefinition(
"SMALLINT default 0", false));
// numeric types
fieldTypeMapping.put(java.lang.Byte.class, new FieldTypeDefinition(
"SMALLINT", false));
fieldTypeMapping.put(java.lang.Short.class, new FieldTypeDefinition(
"SMALLINT", false));
fieldTypeMapping.put(java.lang.Integer.class, new FieldTypeDefinition(
"INTEGER", false));
fieldTypeMapping.put(java.lang.Long.class, new FieldTypeDefinition(
"NUMERIC", 18));
fieldTypeMapping.put(java.lang.Float.class, new FieldTypeDefinition(
"NUMERIC", 18, 4));
fieldTypeMapping.put(java.lang.Double.class, new FieldTypeDefinition(
"NUMERIC", 18, 4));
fieldTypeMapping.put(java.math.BigDecimal.class,
new FieldTypeDefinition("DECIMAL", 18).setLimits(18, -18, 18));
fieldTypeMapping.put(java.math.BigInteger.class,
new FieldTypeDefinition("NUMERIC", 18).setLimits(18, -18, 18));
fieldTypeMapping.put(java.lang.Number.class, new FieldTypeDefinition(
"DECIMAL", 18));
// character types
fieldTypeMapping.put(java.lang.String.class, new FieldTypeDefinition(
"VARCHAR", DEFAULT_VARCHAR_SIZE));
fieldTypeMapping.put(java.lang.Character.class,
new FieldTypeDefinition("CHARACTER", 1));
// array, binary and Lob types
fieldTypeMapping.put(byte[].class,
new FieldTypeDefinition("BLOB", 1024));
fieldTypeMapping.put(java.lang.Byte[].class, new FieldTypeDefinition(
"BLOB", 1024));
// Symfoware's range for a VARCHAR is 1-32000, but the default value of
// @javax.persistence.Column#length is 255
fieldTypeMapping.put(char[].class, new FieldTypeDefinition("VARCHAR",
255));
fieldTypeMapping.put(java.lang.Character[].class,
new FieldTypeDefinition("VARCHAR", 255));
fieldTypeMapping.put(java.sql.Blob.class, new FieldTypeDefinition(
"BLOB", 1024));
fieldTypeMapping.put(java.sql.Clob.class, new FieldTypeDefinition(
"VARCHAR", 255));
// temporal types
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));
fieldTypeMapping.put(java.util.Calendar.class, new FieldTypeDefinition(
"TIMESTAMP", false));
fieldTypeMapping.put(java.util.Date.class, new FieldTypeDefinition(
"TIMESTAMP", false));
return fieldTypeMapping;
}