1 21 package oracle.toplink.essentials.platform.database; 23 24 import java.util.*; 25 import oracle.toplink.essentials.internal.databaseaccess.*; 26 27 32 public class HSQLPlatform extends DatabasePlatform { 33 public HSQLPlatform() { 34 } 35 36 protected Hashtable buildFieldTypes() { 37 Hashtable fieldTypeMapping; 38 39 fieldTypeMapping = super.buildFieldTypes(); 40 fieldTypeMapping.put(Boolean .class, new FieldTypeDefinition("TINYINT", false)); 41 42 fieldTypeMapping.put(Integer .class, new FieldTypeDefinition("INTEGER", false)); 43 fieldTypeMapping.put(Long .class, new FieldTypeDefinition("NUMERIC", 19)); 44 fieldTypeMapping.put(Float .class, new FieldTypeDefinition("REAL", false)); 45 fieldTypeMapping.put(Double .class, new FieldTypeDefinition("REAL", false)); 46 fieldTypeMapping.put(Short .class, new FieldTypeDefinition("SMALLINT", false)); 47 fieldTypeMapping.put(Byte .class, new FieldTypeDefinition("SMALLINT", false)); 48 fieldTypeMapping.put(java.math.BigInteger .class, new FieldTypeDefinition("NUMERIC", 38)); 49 fieldTypeMapping.put(java.math.BigDecimal .class, new FieldTypeDefinition("NUMERIC", 38).setLimits(38, -19, 19)); 50 fieldTypeMapping.put(Number .class, new FieldTypeDefinition("NUMERIC", 38).setLimits(38, -19, 19)); 51 fieldTypeMapping.put(Byte [].class, new FieldTypeDefinition("BINARY", false)); 52 fieldTypeMapping.put(Character [].class, new FieldTypeDefinition("LONGVARCHAR", false)); 53 fieldTypeMapping.put(byte[].class, new FieldTypeDefinition("BINARY", false)); 54 fieldTypeMapping.put(char[].class, new FieldTypeDefinition("LONGVARCHAR", false)); 55 fieldTypeMapping.put(java.sql.Blob .class, new FieldTypeDefinition("BINARY", false)); 56 fieldTypeMapping.put(java.sql.Clob .class, new FieldTypeDefinition("LONGVARCHAR", false)); 57 58 return fieldTypeMapping; 59 } 60 61 public boolean isHSQL() { 62 return true; 63 } 64 65 69 public boolean supportsForeignKeyConstraints() { 70 return false; 71 } 72 } 73 | Popular Tags |