Ayyagari, Madhav wrote:

> Hi all,
>
> Im trying to persist an object of MyClass with the following mapping
> file. When the attribute 'duration' of type
> 'org.joda.time.Duration' is stored in the database, its getting stored
> as raw data. Is there a way to store the duration as a number in the
> database and allow conversions from/to org.joda.time.Duration to/from
> the number?
>

you want a hibernate custom user type
http://www.hibernate.org/hib_docs/v3/api/org/hibernate/usertype/UserType.html

look at the source of joda-time-hibernate for reference
http://joda-time.sourceforge.net/contrib/hibernate/index.html





-------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Joda-interest mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/joda-interest

Reply via email to