I'm trying to incorporate Joda DateTime into my project but am having an issue. There is a database table (Oracle database) that contains a date column that is of Oracle's Date format. I'm using Hibernate to map the data in this table into an object. The object has a variable of type java.util.Date which maps to the date column. Everything has been working fine.
But now I've changed the variable to a DateTime type and updated the Hibernate mapping file to change the property type to org.joda.time.DateTime. I've changed my data access code that queries this table to reflect the change
I'm getting an error at this line:
this.myObjects = this.criteria.list();
It looks to me like Hibernate doesn't recognise the Joda class. How can I amend this?
I removed the references to the Joda classes in my Hibernate mapping file and returned them to the java.util.Date references. In my class that queries the data, I used the following code that allows users to pass in a DateTime variable which is then converted to java.util.Date then to java.sql.Date, for anyone who's interested -
They worship nothing. They say it's because nothing is worth fighting for. Like this tiny ad: