You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user-java@ibatis.apache.org by Aliaksandr Radzivanovich <al...@gmail.com> on 2004/11/23 12:25:50 UTC

Custom property editor?

SQL Maps is great framework!

In my current project java.util.Calendar is used to store dates in
bean properties. Does SQLMaps work with this type?

Is this possible to add custom property editor to a bean which would
preprocess/convert property's value somehow before storing or after
reading it from database?

Re: Custom property editor?

Posted by Kris Jenkins <kr...@yahoo.co.uk>.
Aliaksandr Radzivanovich wrote:

>SQL Maps is great framework!
>
>In my current project java.util.Calendar is used to store dates in
>bean properties. Does SQLMaps work with this type?
>  
>
Not out of the box.

>Is this possible to add custom property editor to a bean which would
>preprocess/convert property's value somehow before storing or after
>reading it from database?
>
Yes indeed.  Take a look at the javadocs for 
com/ibatis/sqlmap/client/extensions/TypeHandlerCallback.  It includes an 
example of how to write a true/false<->YES/NO mapper which should get 
you started.

HTH,
Kris

PS - Where are the javadocs?  Okay, for now take a look at the source 
file - that's in the distribution under debug/ibatis-debug.jar.

-- 
Kris Jenkins
Email: kris@jenkster.com
Web:   http://cafe.jenkster.com/