如何将 jodaTime 与休眠一起使用
How to use jodaTime with hibernate
我想将 JodaTime LocalDate 与休眠一起使用。我写了这个:
@Temporal(TemporalType.TIMESTAMP)
@Column(name = "DATE_DEBUT", nullable = false)
@Type(type = "org.joda.time.contrib.hibernate.PersistentLocalDate")
private LocalDate dateDebut;
但是没用。我收到此错误:
Caused by: Exception [EclipseLink-7165] (Eclipse Persistence Services - 2.5.2.v20140319-9ad6abd): org.eclipse.persistence.exceptions.ValidationException
Exception Description: The type [class org.joda.time.LocalDate] for the attribute [dateDebut] on the entity class [class ch.test.application.beans.mandat.Mandat] is not a valid type for a temporal mapping. The attribute must be defined as java.util.Date or java.util.Calendar.
你知道为什么吗?
谢谢
我想将 JodaTime LocalDate 与休眠一起使用。我写了这个:
@Temporal(TemporalType.TIMESTAMP)
@Column(name = "DATE_DEBUT", nullable = false)
@Type(type = "org.joda.time.contrib.hibernate.PersistentLocalDate")
private LocalDate dateDebut;
但是没用。我收到此错误:
Caused by: Exception [EclipseLink-7165] (Eclipse Persistence Services - 2.5.2.v20140319-9ad6abd): org.eclipse.persistence.exceptions.ValidationException
Exception Description: The type [class org.joda.time.LocalDate] for the attribute [dateDebut] on the entity class [class ch.test.application.beans.mandat.Mandat] is not a valid type for a temporal mapping. The attribute must be defined as java.util.Date or java.util.Calendar.
你知道为什么吗?
谢谢