ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Anthony Hong" <anthony.bin.h...@gmail.com>
Subject Re: How to convert data type in java code with ibatis framework
Date Wed, 22 Nov 2006 13:35:44 GMT
Looks like your suggestion can help me.
If this problem can be solved, then I think it works.
The problem is:
ResultGetter in TypeHandlerCallback only works with one filed, how to
conjuction with another field.
Say my dynamic object has one property save value and one property
save its class type.
How to do convertion in typehandler that I can access another property in class?

I save examples are all about enumation class. If I define its to
handle with java.lang.Object, all other specific data type handler
with not be used anymore?

On 11/22/06, Caio Zanchetti <caio.zanchetti@gmail.com> wrote:
> Hi, I don't know if I could understand very well your question, but you can
> define an "extension" through the TypeHandlerCallback class implementation.
> Than you will can automatic convert between two types.
> Regards,
> On 11/21/06, Anthony Hong <anthony.bin.hong@gmail.com> wrote:
> > I have a common table that stores data with id and value.
> > The value field defined in DB is varchar2.
> > Currently each time I store or retrieve data from db, I convert value
> > from object to string in inserting, updating. Or convert value from
> > string to objec in selectinig.
> > I'd like to know how to achieve with ibatis help, something like
> > before paremeter set I can do something. Or in result map. I can do
> > convertion.
> >
> > --
> >
> > Anthony Hong
> >
> --
> Claudiomir G. Zanchetti (Caio)
> Sun Certified Programmer for the Java 2 Plataform, Standard Edition 5.0


Anthony Hong

View raw message