root / branches / v2_0_0_prep / libraries / libFMap_daldb / src / org / gvsig / fmap / data / feature / db / jdbc / JDBCTypes.java @ 24491
History | View | Annotate | Download (1.58 KB)
1 |
package org.gvsig.fmap.data.feature.db.jdbc; |
---|---|
2 |
|
3 |
import org.gvsig.fmap.dal.feature.FeatureAttributeDescriptor; |
4 |
|
5 |
public class JDBCTypes { |
6 |
public static final String POINT2D = "POINT2D"; |
7 |
public static final String LINE2D = "LINE2D"; |
8 |
public static final String POLYGON2D = "POLYGON2D"; |
9 |
public static final String MULTI2D = "MULYI2D"; |
10 |
|
11 |
public static String fieldTypeToString(String fieldType) { |
12 |
String aux = "text"; // Por defecto. |
13 |
if (FeatureAttributeDescriptor.INT.equals(fieldType)){
|
14 |
return "integer"; |
15 |
}else if (FeatureAttributeDescriptor.BOOLEAN.equals(fieldType)){ |
16 |
return "boolean"; |
17 |
}else if (FeatureAttributeDescriptor.DOUBLE.equals(fieldType)){ |
18 |
return "float8"; |
19 |
}else if (FeatureAttributeDescriptor.FLOAT.equals(fieldType)){ |
20 |
return "float"; |
21 |
}else if (FeatureAttributeDescriptor.STRING.equals(fieldType)){ |
22 |
return "text"; |
23 |
}else if (FeatureAttributeDescriptor.GEOMETRY.equals(fieldType)){ |
24 |
return "GEOMETRY"; |
25 |
}else if (POINT2D.equals(fieldType)){ |
26 |
return "POINT"; |
27 |
}else if (LINE2D.equals(fieldType)){ |
28 |
return "MULTILINESTRING"; |
29 |
}else if (POLYGON2D.equals(fieldType)){ |
30 |
return "MULTIPOLYGON"; |
31 |
}else if (MULTI2D.equals(fieldType)){ |
32 |
return "GEOMETRY"; |
33 |
} |
34 |
// case Types.DECIMAL:
|
35 |
// aux = "numeric";
|
36 |
// break;
|
37 |
// case Types.CHAR:
|
38 |
// aux = "char";
|
39 |
// break;
|
40 |
// case POINT2D:
|
41 |
// aux = "POINT";
|
42 |
// break;
|
43 |
// case LINE2D:
|
44 |
// aux = "MULTILINESTRING";
|
45 |
// break;
|
46 |
// case POLYGON2D:
|
47 |
// aux = "MULTIPOLYGON";
|
48 |
// break;
|
49 |
// case MULTI2D:
|
50 |
// aux = "GEOMETRY";
|
51 |
// break;
|
52 |
//
|
53 |
// }
|
54 |
|
55 |
return aux;
|
56 |
} |
57 |
} |