62,616
社区成员
发帖
与我相关
我的任务
分享
@Entity
@Table(name = "log")
public class Log implements java.io.Serializable {
private String id;
private Date time;
@Id
@GeneratedValue(generator="hibernate-uuid")
@GenericGenerator(name="hibernate-uuid",strategy="uuid.hex")
@Column(name = "id", unique = true, nullable = false, length = 32)
public String getId() {
return this.id;
}
public void setId(String id) {
this.id = id;
}
@Temporal(TemporalType.TIMESTAMP)
@Column(name = "time", nullable = false, length = 19)
public Date getTime() {
return this.time;
}
public void setTime(Date time) {
this.time = time;
}
}
Log log = new Log();
log.setTime(new Date());
dao.save(log);