1 21 package oracle.toplink.essentials.platform.database; 23 24 import java.io.*; 25 import java.util.*; 26 import oracle.toplink.essentials.expressions.ExpressionOperator; 27 import oracle.toplink.essentials.internal.databaseaccess.*; 28 29 32 public class PointBasePlatform extends oracle.toplink.essentials.platform.database.DatabasePlatform { 33 34 38 protected void appendBoolean(Boolean bool, Writer writer) throws IOException { 39 writer.write(bool.toString()); 40 } 41 42 46 protected void appendTime(java.sql.Time time, Writer writer) throws IOException { 47 writer.write("TIME '" + time + "'"); 48 } 49 50 54 protected void appendDate(java.sql.Date date, Writer writer) throws IOException { 55 writer.write("DATE '" + date + "'"); 56 } 57 58 62 protected void appendTimestamp(java.sql.Timestamp timestamp, Writer writer) throws IOException { 63 writer.write("TIMESTAMP '" + timestamp + "'"); 64 } 65 66 protected Hashtable buildClassTypes() { 67 Hashtable classTypeMapping = super.buildClassTypes(); 68 69 classTypeMapping.put("FLOAT", Double .class); 70 classTypeMapping.put("DOUBLE PRECISION", Double .class); 71 classTypeMapping.put("CHARACTER", String .class); 72 classTypeMapping.put("CLOB", Character [].class); 73 classTypeMapping.put("BLOB", Byte [].class); 74 classTypeMapping.put("BOOLEAN", Boolean .class); 75 76 return classTypeMapping; 77 } 78 79 protected Hashtable buildFieldTypes() { 80 Hashtable fieldTypeMapping; 81 82 fieldTypeMapping = super.buildFieldTypes(); 83 fieldTypeMapping.put(Boolean .class, new FieldTypeDefinition("BOOLEAN")); 84 85 fieldTypeMapping.put(Long .class, new FieldTypeDefinition("NUMERIC", 19)); 86 fieldTypeMapping.put(Short .class, new FieldTypeDefinition("NUMERIC", 5)); 87 fieldTypeMapping.put(Byte .class, new FieldTypeDefinition("NUMERIC", 3)); 88 fieldTypeMapping.put(java.math.BigInteger .class, new FieldTypeDefinition("NUMERIC", 19)); 89 90 fieldTypeMapping.put(Integer .class, new FieldTypeDefinition("INTEGER", false)); 91 fieldTypeMapping.put(Float .class, new FieldTypeDefinition("REAL", false)); 92 fieldTypeMapping.put(Double .class, new FieldTypeDefinition("DOUBLE", false)); 93 fieldTypeMapping.put(Short .class, new FieldTypeDefinition("SMALLINT", false)); 94 fieldTypeMapping.put(java.math.BigDecimal .class, new FieldTypeDefinition("DECIMAL")); 95 fieldTypeMapping.put(Number .class, new FieldTypeDefinition("DECIMAL")); 96 97 fieldTypeMapping.put(Character .class, new FieldTypeDefinition("CHARACTER")); 98 99 return fieldTypeMapping; 100 } 101 102 protected void initializePlatformOperators() { 103 super.initializePlatformOperators(); 104 addOperator(ExpressionOperator.simpleMath(ExpressionOperator.Concat, "||")); 105 } 106 107 public boolean isPointBase() { 108 return true; 109 } 110 } 111 | Popular Tags |