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 CloudscapePlatform extends oracle.toplink.essentials.platform.database.DatabasePlatform { 33 34 38 protected Hashtable buildFieldTypes() { 39 Hashtable fieldTypeMapping; 40 41 fieldTypeMapping = new Hashtable(); 42 fieldTypeMapping.put(Boolean .class, new FieldTypeDefinition("SMALLINT default 0", false)); 43 44 fieldTypeMapping.put(Integer .class, new FieldTypeDefinition("INTEGER", false)); 45 fieldTypeMapping.put(Long .class, new FieldTypeDefinition("NUMERIC", 19)); 46 fieldTypeMapping.put(Float .class, new FieldTypeDefinition("FLOAT(16)", false)); 47 fieldTypeMapping.put(Double .class, new FieldTypeDefinition("FLOAT(32)", false)); 48 fieldTypeMapping.put(Short .class, new FieldTypeDefinition("SMALLINT", false)); 49 fieldTypeMapping.put(Byte .class, new FieldTypeDefinition("SMALLINT", false)); 50 fieldTypeMapping.put(java.math.BigInteger .class, new FieldTypeDefinition("DECIMAL", 32)); 51 fieldTypeMapping.put(java.math.BigDecimal .class, new FieldTypeDefinition("DECIMAL", 32).setLimits(32, -19, 19)); 52 fieldTypeMapping.put(Number .class, new FieldTypeDefinition("DECIMAL", 32).setLimits(32, -19, 19)); 53 54 fieldTypeMapping.put(String .class, new FieldTypeDefinition("VARCHAR", 255)); 55 fieldTypeMapping.put(Character .class, new FieldTypeDefinition("CHAR", 1)); 56 fieldTypeMapping.put(Byte [].class, new FieldTypeDefinition("BYTE", false)); 57 fieldTypeMapping.put(Character [].class, new FieldTypeDefinition("TEXT", false)); 58 fieldTypeMapping.put(byte[].class, new FieldTypeDefinition("BYTE", false)); 59 fieldTypeMapping.put(char[].class, new FieldTypeDefinition("TEXT", false)); 60 fieldTypeMapping.put(java.sql.Blob .class, new FieldTypeDefinition("BYTE", false)); 61 fieldTypeMapping.put(java.sql.Clob .class, new FieldTypeDefinition("TEXT", false)); 62 63 fieldTypeMapping.put(java.sql.Date .class, new FieldTypeDefinition("DATE", false)); 64 fieldTypeMapping.put(java.sql.Time .class, new FieldTypeDefinition("DATETIME HOUR TO SECOND", false)); 65 fieldTypeMapping.put(java.sql.Timestamp .class, new FieldTypeDefinition("DATETIME YEAR TO FRACTION(5)", false)); 66 67 return fieldTypeMapping; 68 } 69 70 74 public boolean isCloudscape() { 75 return true; 76 } 77 78 82 public boolean shouldUseJDBCOuterJoinSyntax() { 83 return false; } 85 } 86 | Popular Tags |