diff --git a/src/java/com/samskivert/depot/impl/FieldMarshaller.java b/src/java/com/samskivert/depot/impl/FieldMarshaller.java index 80ecf28..ad7499f 100644 --- a/src/java/com/samskivert/depot/impl/FieldMarshaller.java +++ b/src/java/com/samskivert/depot/impl/FieldMarshaller.java @@ -252,6 +252,12 @@ public abstract class FieldMarshaller return new DoubleMarshaller(); // boxed primitive types + } else if (ftype.equals(Boolean.class)) { + return new ObjectMarshaller() { + @Override public String getColumnType (ColumnTyper typer, int length) { + return typer.getBooleanType(length); + } + }; } else if (ftype.equals(Byte.class)) { return new ObjectMarshaller() { @Override public String getColumnType (ColumnTyper typer, int length) { diff --git a/src/java/com/samskivert/depot/tests/AllTypesRecord.java b/src/java/com/samskivert/depot/tests/AllTypesRecord.java index b07b665..126c305 100644 --- a/src/java/com/samskivert/depot/tests/AllTypesRecord.java +++ b/src/java/com/samskivert/depot/tests/AllTypesRecord.java @@ -84,6 +84,7 @@ public class AllTypesRecord extends PersistentRecord public float floatValue; public double doubleValue; + public Boolean boxedBoolean; public Byte boxedByte; public Short boxedShort; public Integer boxedInt; @@ -101,6 +102,7 @@ public class AllTypesRecord extends PersistentRecord // public Blob blob; // tested by byte[] // public Clob clob; // not clear how to test this + @Column(nullable=true) public Boolean nullBoxedBoolean; @Column(nullable=true) public Byte nullBoxedByte; @Column(nullable=true) public Short nullBoxedShort; @Column(nullable=true) public Integer nullBoxedInt; @@ -126,6 +128,7 @@ public class AllTypesRecord extends PersistentRecord (longValue == orec.longValue) && (floatValue == orec.floatValue) && (doubleValue == orec.doubleValue) && + boxedBoolean.equals(orec.boxedBoolean) && boxedByte.equals(orec.boxedByte) && boxedShort.equals(orec.boxedShort) && boxedInt.equals(orec.boxedInt) && @@ -138,6 +141,7 @@ public class AllTypesRecord extends PersistentRecord date.equals(orec.date) && time.equals(orec.time) && timestamp.equals(orec.timestamp) && + (nullBoxedBoolean == orec.nullBoxedBoolean) && (nullBoxedByte == orec.nullBoxedByte) && (nullBoxedShort == orec.nullBoxedShort) && (nullBoxedInt == orec.nullBoxedInt) && @@ -163,6 +167,7 @@ public class AllTypesRecord extends PersistentRecord rec.longValue = 4; rec.floatValue = 5.5f; rec.doubleValue = 6.6; + rec.boxedBoolean = true; rec.boxedByte = 7; rec.boxedShort = 8; rec.boxedInt = 9;