我正在使用hibernate 4和joda时间和spring数据jpa.Spring数据提供注释
@CreadedOn
@LastModifiedOn
Run Code Online (Sandbox Code Playgroud)
我试图使用这两个注释.Below是我的pojo的快照
@Entity
@Table(name="restaurant")
@Audited
public class Restaurant {
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
private long id;
private String restaurantName;
@CreatedDate
@Type(type = "org.jadira.usertype.dateandtime.joda.PersistentDateTime")
// @Type(type = "org.jadira.usertype.dateandtime.threetenbp.PersistentDateTime")
private DateTime createdOn;
@LastModifiedDate
@Type(type = "org.jadira.usertype.dateandtime.joda.PersistentDateTime")
// @Type(type = "org.jadira.usertype.dateandtime.threetenbp.PersistentDateTime")
private DateTime modifiedOn;
}
Run Code Online (Sandbox Code Playgroud)
根据提供的用户类型jodatime的说明,我已经注释了我的属性.@Type但仍然没有运气.每次我使用@Type注释并部署它我的服务器上出现错误
严重:错误listenerStart
完整堆栈跟踪如下
Jan 15, 2014 11:40:00 AM org.apache.catalina.startup.HostConfig deployWAR
INFO: Deploying web application archive G:\apache-tomcat-7.0.47\webapps\base-spr
ing-data-jpa.war
Jan 15, 2014 11:40:00 AM org.apache.catalina.loader.WebappClassLoader validateJa
rFile
INFO: validateJarFile(G:\apache-tomcat-7.0.47\webapps\base-spring-data-jpa\WEB-I
NF\lib\javax.servlet-api-3.1.0.jar) - …Run Code Online (Sandbox Code Playgroud)