Good catch. See updated pull request


On Thu, Dec 5, 2013 at 1:40 PM, Joseph Wu <notifications@github.com> wrote:

> In
> lib/jdomodels/src/main/java/org/sagebionetworks/repo/model/dbo/DBOBuilder.java:
>
> > @@ -71,34 +117,58 @@ public FieldColumn apply(Entry<Field> fieldEntry) {
> >  		return result.toArray(new FieldColumn[result.size()]);
> >  	}
> >
> > -	private static final Object[][] TYPE_MAP = {
> > -		{ Long.class, "getLong" },
> > -		{ String.class, "getString" },
> > -		{ java.util.Date.class, "getDate" }
> > -	};
> > +	private static final Object[][] TYPE_MAP = { { Long.class, "getLong" }, { String.class, "getString" } };
>
> If the field being mapped is nullable, you should use
>
> String res = getString(<fieldname>);if (res != null) {
>     return Long.parseLong(res);}
>
> i.e. If the type is a Long, your mapper returns a 0 when we expect a null.
>
> —
> Reply to this email directly or view it on GitHub<https://github.com/Sage-Bionetworks/Synapse-Repository-Services/pull/884/files#r8145900>
> .
>