我正在从 3 迁移到 Hibernate 5.0.3.Final。在 3.x 中,我使用 joda-time 将 LocalDateTime 持久保存在 oracle DB 中。现在我看到hibernate 5不支持joda-time。请让我知道什么是最好的选择?
这是代码示例。
import org.joda.time.DateTime;
import org.joda.time.DateTimeZone;
import org.joda.time.LocalDateTime;
public class ComponentHistory {
@Column(name = EntityConstants.CREATED_BY_COLUMN_NAME)
private String createdBy;
@Column(name = EntityConstants.CREATED_DATE_COLUMN_NAME)
@Type(type = "org.joda.time.contrib.hibernate.PersistentLocalDateTime")
private LocalDateTime createdDate;
@Column(name = EntityConstants.UPDATED_BY_COLUMN_NAME)
private String updatedBy;
@Column(name = EntityConstants.UPDATED_DATE_COLUMN_NAME)
@Type(type = "org.joda.time.contrib.hibernate.PersistentLocalDateTime")
private LocalDateTime updatedDate;