1 | public class DoubleType extends PrimitiveType {↵ | | 1 | public class FloatType extends PrimitiveType {↵
|
|
2 | public Serializable getDefaultValue() {↵ | | 2 | public Serializable getDefaultValue() {↵
|
3 | return new Double(0.0);↵ | | 3 | return new Float(0.0);↵
|
4 | }↵ | | 4 | }↵
|
5 | ↵ | | 5 | ↵
|
6 | public Object get(ResultSet rs, String name) throws SQLException {↵ | | 6 | public Object get(ResultSet rs, String name) throws SQLException {↵
|
7 | return new Double( rs.getDouble(name) );↵ | | 7 | return new Float( rs.getFloat(name) );↵
|
8 | }↵ | | 8 | }↵
|
|
9 | public Class getPrimitiveClass() {↵ | | 9 | public Class getPrimitiveClass() {↵
|
10 | return double.class;↵ | | 10 | return float.class;↵
|
11 | }↵ | | 11 | }↵
|
|
12 | public Class getReturnedClass() {↵ | | 12 | public Class getReturnedClass() {↵
|
13 | return Double.class;↵ | | 13 | return Float.class;↵
|
14 | }↵ | | 14 | }↵
|
|
15 | public void set(PreparedStatement st, Object value, int index)↵ | | 15 | public void set(PreparedStatement st, Object value, int index)↵
|
16 | throws SQLException {↵ | | 16 | throws SQLException {↵
|
|
17 | st.setDouble( index, ( (Double) value ).doubleValue() );↵ | | 17 | st.setFloat( index, ( (Float) value ).floatValue() );↵
|
18 | }↵ | | 18 | }↵
|
|
19 | public int sqlType() {↵ | | 19 | public int sqlType() {↵
|
20 | return Types.DOUBLE;↵ | | 20 | return Types.FLOAT;↵
|
21 | }↵ | | 21 | }↵
|
|
22 | public String getName() { return "double"; }↵ | | 22 | public String getName() { return "float"; }↵
|
|
23 | public String objectToSQLString(Object value, Dialect dialect) throws Exception {↵ | | 23 | public String objectToSQLString(Object value, Dialect dialect) throws Exception {↵
|
24 | return value.toString();↵ | | 24 | return value.toString();↵
|
25 | }↵ | | 25 | }↵
|
|
26 | public Object fromStringValue(String xml) {↵ | | 26 | public Object fromStringValue(String xml) {↵
|
27 | return new Double(xml);↵ | | 27 | return new Float(xml);↵
|
28 | | | 28 |
|