git-svn-id: https://samskivert.googlecode.com/svn/trunk@2111 6335cc39-0255-0410-8fd6-9bcaacd3b74c

This commit is contained in:
mjohnson
2007-06-12 22:30:48 +00:00
parent 4628bbc787
commit 2e31d2d2f8
@@ -88,6 +88,9 @@ public abstract class FieldMarshaller
} else if (ftype.equals(byte[].class)) { } else if (ftype.equals(byte[].class)) {
marshaller = new ByteArrayMarshaller(); marshaller = new ByteArrayMarshaller();
} else if (ftype.equals(int[].class)) {
marshaller = new IntArrayMarshaller();
// SQL types // SQL types
} else if (ftype.equals(Date.class) || } else if (ftype.equals(Date.class) ||
ftype.equals(Time.class) || ftype.equals(Time.class) ||
@@ -405,6 +408,20 @@ public abstract class FieldMarshaller
} }
} }
protected static class IntArrayMarshaller extends FieldMarshaller {
public void setValue (Object po, PreparedStatement ps, int column)
throws SQLException, IllegalAccessException {
ps.setObject(column, _field.get(po));
}
public void getValue (ResultSet rs, Object po)
throws SQLException, IllegalAccessException {
_field.set(po, rs.getObject(getColumnName()));
}
public String getColumnType () {
return "BLOB";
}
}
protected static class ByteEnumMarshaller extends FieldMarshaller { protected static class ByteEnumMarshaller extends FieldMarshaller {
public ByteEnumMarshaller (Class clazz) { public ByteEnumMarshaller (Class clazz) {
try { try {