You are viewing a plain text version of this content. The canonical link for it is here.
Posted to ojb-user@db.apache.org by Andy Malakov <an...@transdecisions.com> on 2005/10/25 23:59:31 UTC

Minor 1.0.1 => 1.0.3 migration issue

Hello All,

I recently migrated from OJB 1.0.1 to 1.0.3 and found one minor regression.

It looks like custom FieldConversions no longer supported for ojbConcreteClass fields. I have several classes mapped to the same table, and I use tag stored as CHAR(1) DB column to identify concrete class (my custom FieldConversion maps between class names and tag values). Using conversions for ojbConcreteClass wasn't actually documented, but worked fine in 1.0.1 :-)

It seems that adding conversion to RowReaderDefaultImpl (1.0.3) solves the problem:

    protected String extractOjbConcreteClass(ClassDescriptor cld, ResultSet rs)
        ...
        String result = (String) fld.getJdbcType().getObjectFromColumn(rs, fld.getColumnName());
+      result = (String) fld.getFieldConversion().sqlToJava(result); // <= ADDED LINE
        if (result == null || result.trim().length() == 0)
            ...


All the Best,
Andy

Re: Minor 1.0.1 => 1.0.3 migration issue

Posted by Armin Waibel <ar...@apache.org>.
Hi Andy,

checked in your patch. Will be included in 1.0.4.
Thanks!

regards,
Armin

Andy Malakov wrote:
> Hello All,
> 
> I recently migrated from OJB 1.0.1 to 1.0.3 and found one minor regression.
> 
> It looks like custom FieldConversions no longer supported for ojbConcreteClass fields. I have several classes mapped to the same table, and I use tag stored as CHAR(1) DB column to identify concrete class (my custom FieldConversion maps between class names and tag values). Using conversions for ojbConcreteClass wasn't actually documented, but worked fine in 1.0.1 :-)
> 
> It seems that adding conversion to RowReaderDefaultImpl (1.0.3) solves the problem:
> 
>     protected String extractOjbConcreteClass(ClassDescriptor cld, ResultSet rs)
>         ...
>         String result = (String) fld.getJdbcType().getObjectFromColumn(rs, fld.getColumnName());
> +      result = (String) fld.getFieldConversion().sqlToJava(result); // <= ADDED LINE
>         if (result == null || result.trim().length() == 0)
>             ...
> 
> 
> All the Best,
> Andy

---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-user-help@db.apache.org