I need to persist a time duration e.g. 5 d 4 h
I was thinking of using a convertion (Duration / Calendar / Date class) where I than can persist it as a long (millisec) to the db (MySql). Like that I can easily convert and work with it.
Is this a good way to do this?
For the Hibernate 4.0 JPA provider, you can use the Usertype project to get JPA persistence for Joda Time classes, and then use the @Type annotation.