I've learn to map usually the date fields in a DB to a java.util.Date
field in a Java Bean. However, is this approach still useful? I know that Date
are still in java mainly for backwards compatibility, and that Joda time tends to perform better than java.util.Calendar
, but I'm not sure how well it goes with Hibernate.
So, my questions are the following:
- In hibernate, which are the recomended data type for a Date field in a DB? Date, Calendar, Joda Time, or any other?
- It is still true when I don't care about the TimeZone or the Time portion? For example, when I only want to store the date
- What about pure Java beans? Can I still implement the recommendations that are true for Hibernate mappings?
Thanks in advance