KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > daffodilwoods > daffodildb > server > datadictionarysystem > information > DatatypeInfoMap


1 package com.daffodilwoods.daffodildb.server.datadictionarysystem.information;
2
3 import java.util.HashMap JavaDoc;
4 import com.daffodilwoods.daffodildb.server.datasystem.interfaces.Datatype;
5
6 public class DatatypeInfoMap implements java.io.Serializable JavaDoc{
7
8    private static HashMap JavaDoc hashMap;
9
10    public static HashMap JavaDoc getDataTypeInfoMap() {
11       if(hashMap == null){
12          hashMap = new HashMap JavaDoc();
13          setDataTypeInfo();
14       }
15       return hashMap;
16    }
17
18    private static void setDataTypeInfo() {
19      hashMap.put("character" , new DataTypeProperties(true,10 , false ,null , 4192 ,1 , true , Integer.MIN_VALUE , Integer.MIN_VALUE,false));
20       hashMap.put("char" , new DataTypeProperties(true,10 , false , null ,4192 ,1 , true , Integer.MIN_VALUE , Integer.MIN_VALUE,false));
21       hashMap.put("character varying" , new DataTypeProperties(true,10, false , null ,4192 ,1 , true ,Integer.MIN_VALUE , Integer.MIN_VALUE,false));
22       hashMap.put("char varying" , new DataTypeProperties(true,10 , false , null ,4192 ,1 , true , Integer.MIN_VALUE , Integer.MIN_VALUE,false)) ;
23       hashMap.put("varchar" , new DataTypeProperties(true,10 , false , null ,4192 ,1 , true , Integer.MIN_VALUE , Integer.MIN_VALUE,false)) ;
24       hashMap.put("varchar2" , new DataTypeProperties(true,10 , false , null ,4192 ,1 , true , Integer.MIN_VALUE , Integer.MIN_VALUE,false)) ;
25       hashMap.put("character large object" , new DataTypeProperties(false,10 , false , null ,1073741823 ,1 , true , Integer.MIN_VALUE , Integer.MIN_VALUE,false));
26       hashMap.put("char large object" , new DataTypeProperties(false,10 , false , null ,1073741823 ,1 , true , Integer.MIN_VALUE , Integer.MIN_VALUE,false));
27       hashMap.put("long varchar" , new DataTypeProperties(false,10 , false , null ,1073741823 ,1 , true , Integer.MIN_VALUE , Integer.MIN_VALUE,false));
28       hashMap.put("clob" , new DataTypeProperties(false,10 , false , null ,1073741823 ,1 , true , Integer.MIN_VALUE , Integer.MIN_VALUE,false));
29       hashMap.put("blob" , new DataTypeProperties(false,10 , false , null ,1073741823 ,1 , true , Integer.MIN_VALUE , Integer.MIN_VALUE,false));
30       hashMap.put("binary" , new DataTypeProperties(false,10 , false , null ,1073741823 ,1 , true , Integer.MIN_VALUE , Integer.MIN_VALUE,false));
31       hashMap.put("varbinary" , new DataTypeProperties(false,10 , false , null ,1073741823 ,1 , true , Integer.MIN_VALUE , Integer.MIN_VALUE,false));
32       hashMap.put("long varbinary" , new DataTypeProperties(false,10 , false , null ,1073741823 ,1 , true , Integer.MIN_VALUE , Integer.MIN_VALUE,false));
33       /** @todo Check Fixed Length For Bit */
34       hashMap.put("bit" , new DataTypeProperties(true,10 , false, null , 4192 ,1 , true , Integer.MIN_VALUE , Integer.MIN_VALUE,false));
35       hashMap.put("bit varying" , new DataTypeProperties(true,10 , false, null , 4192 , 1 , true , Integer.MIN_VALUE , Integer.MIN_VALUE,false));
36       hashMap.put("numeric" , new DataTypeProperties(true,28 , false , null ,Datatype.BIGDECIMAL_PRECISION ,1, true , Integer.MIN_VALUE, Integer.MIN_VALUE,true));
37       hashMap.put("decimal" , new DataTypeProperties(true,28 , false , null ,Datatype.BIGDECIMAL_PRECISION ,1 , true , Integer.MIN_VALUE , Integer.MIN_VALUE,true));
38       hashMap.put("dec" , new DataTypeProperties(true,28 , false , null ,Datatype.BIGDECIMAL_PRECISION ,1 , true , Integer.MIN_VALUE , Integer.MIN_VALUE,true));
39       hashMap.put("int" , new DataTypeProperties(true,Datatype.INTSIZE , true , null ,Integer.MAX_VALUE, Integer.MIN_VALUE , true , Datatype.INT_PRECISION , 0,true ));
40       hashMap.put("integer" , new DataTypeProperties(true,Datatype.INTSIZE , true , null ,Integer.MAX_VALUE, Integer.MIN_VALUE , true , Datatype.INT_PRECISION , 0,true) );
41       hashMap.put("smallint" , new DataTypeProperties(true,Datatype.SHORTSIZE , true , null ,Integer.MAX_VALUE, Integer.MIN_VALUE , true , Datatype.INT_PRECISION , 0,true) );
42       hashMap.put("float" , new DataTypeProperties(true,Datatype.FLOATSIZE , true , null , Datatype.FLOAT_PRECISION, 1, true , Datatype.FLOAT_PRECISION , 0 ,true));
43       hashMap.put("real" , new DataTypeProperties(true,Datatype.REALSIZE , true , null ,Integer.MAX_VALUE , Integer.MIN_VALUE , true , Datatype.REAL_PRECISION , 0,true));
44       hashMap.put("double precision" , new DataTypeProperties(true,Datatype.DOUBLESIZE , true ,(Object JavaDoc) null ,Integer.MAX_VALUE , Integer.MIN_VALUE , true , Datatype.DOUBLEPRECISION , 0,true));
45       hashMap.put("boolean" , new DataTypeProperties(true,Datatype.BOOLEANSIZE , true , null , Integer.MAX_VALUE , Integer.MIN_VALUE , true , Datatype.BOOLEAN_PRECISION , 0 ,false) );
46       hashMap.put("date" , new DataTypeProperties(true,Datatype.DATESIZE , true , null , Integer.MAX_VALUE , Integer.MIN_VALUE , true , 19 , 0,false) );
47       hashMap.put("time" , new DataTypeProperties(true,Datatype.TIMESIZE , true , null , Integer.MAX_VALUE ,Integer.MIN_VALUE , true, 19 , 0 ,false ));
48       hashMap.put("timestamp" , new DataTypeProperties(true,Datatype.TIMESTAMPSIZE , true, null , Integer.MAX_VALUE ,Integer.MIN_VALUE , true ,23, 0,false ));
49       hashMap.put("BigInt" , new DataTypeProperties(true,Datatype.LONGSIZE , true , null , Integer.MAX_VALUE ,Integer.MIN_VALUE , true , Integer.MIN_VALUE , Integer.MIN_VALUE,true));
50       hashMap.put("TinyInt" , new DataTypeProperties(true,Datatype.BYTESIZE , true , null , Integer.MAX_VALUE ,Integer.MIN_VALUE , true , Integer.MIN_VALUE , Integer.MIN_VALUE,true));
51       hashMap.put("Byte" , new DataTypeProperties(true,Datatype.BYTESIZE , true , null , Integer.MAX_VALUE ,Integer.MIN_VALUE , true , Integer.MIN_VALUE , Integer.MIN_VALUE,true));
52       hashMap.put("Long" , new DataTypeProperties(true,Datatype.LONGSIZE , true , null , Integer.MAX_VALUE ,Integer.MIN_VALUE , true , Integer.MIN_VALUE , Integer.MIN_VALUE,true));
53     }
54 }
55
56
Popular Tags