From d0dd8289259705e890d87827866dfa67ed1de38a Mon Sep 17 00:00:00 2001 From: Michael Bayne Date: Sat, 19 Jun 2010 17:44:55 +0000 Subject: [PATCH] Comment our workarounds. --- src/java/com/samskivert/depot/impl/FieldMarshaller.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/java/com/samskivert/depot/impl/FieldMarshaller.java b/src/java/com/samskivert/depot/impl/FieldMarshaller.java index 755e30f..80ecf28 100644 --- a/src/java/com/samskivert/depot/impl/FieldMarshaller.java +++ b/src/java/com/samskivert/depot/impl/FieldMarshaller.java @@ -251,7 +251,7 @@ public abstract class FieldMarshaller } else if (ftype.equals(Double.TYPE)) { return new DoubleMarshaller(); - // "natural" types + // boxed primitive types } else if (ftype.equals(Byte.class)) { return new ObjectMarshaller() { @Override public String getColumnType (ColumnTyper typer, int length) { @@ -259,6 +259,8 @@ public abstract class FieldMarshaller } @Override public Object getFromSet (ResultSet rs) throws SQLException { + // work around the fact that HSQLDB (at least) returns Integer rather than + // Byte for TINYINT columns Object value = super.getFromSet(rs); return (value == null) ? null : ((Number)value).byteValue(); } @@ -270,6 +272,8 @@ public abstract class FieldMarshaller } @Override public Object getFromSet (ResultSet rs) throws SQLException { + // work around the fact that HSQLDB (at least) returns Integer rather than + // Short for SMALLINT columns Object value = super.getFromSet(rs); return (value == null) ? null : ((Number)value).shortValue(); } @@ -293,6 +297,8 @@ public abstract class FieldMarshaller } @Override public Object getFromSet (ResultSet rs) throws SQLException { + // work around the fact that HSQLDB (at least) returns Double rather than + // Float for REAL columns Object value = super.getFromSet(rs); return (value == null) ? null : ((Number)value).floatValue(); }