01: package simpleorm.data;
02:
03: /**
04: * Simple holder for types.
05: * Do not make enums as enums cannot be extended (!).
06: */
07: public class DType {
08: public static final DType STRING = new DType("String",
09: String.class, "VARCHAR");
10: public static final DType INTEGER = new DType("Integer",
11: Integer.class, "INTEGER");
12: public static final DType BOOLEAN = new DType("Boolean",
13: Boolean.class, "BOOLEAN");
14: //public static final DType BYTES = new DType("Bytes", (new Byte[0]).getClass()); // Bit too fancy for now
15:
16: String name;
17: Class clazz;
18: String sqlType;
19:
20: public DType(String name, Class clazz, String sqlType) {
21: this .name = name;
22: this .clazz = clazz;
23: this .sqlType = sqlType;
24: }
25:
26: /////////////////////////////////////
27:
28: public String getName() {
29: return name;
30: }
31:
32: public Class getClazz() {
33: return clazz;
34: }
35:
36: public String getSqlType() {
37: return sqlType;
38: }
39: }
|