I am trying to upgrade my spring boot from 2.7.X to 3.2.X. But the following code is not compiling.
@jakarta.persistence.Entity
public class Order {
...
@Type(type = "org.jadira.usertype.dateandtime.joda.PersistentDateTime")//can't resolve method type
private DateTime createdOn;
}
Is Joda DateTime supported by Hibernate 6.4.X? If yes, how to migrate the above code?
java.time
Given below is a notice on the home page of Joda-Time:
The modern date/time API,
java.timewas released as part of Java 8 in March 2024 (ten years ago). Since then, it is highly recommended to switch to thejava.timeAPI from both, the legacyjava.utilAPI as well as the Joda-Time API.I recommend you change your code to
java.timeAPI as follow:Given below is the Maven dependency for it:
Remove all Maven dependencies of Joda-Time and Jadira.
Here is an article written by the creator of Joda-Time and architect of
java.timeAPI.Learn about the modern date-time API from Trail: Date Time