BaseEntity
Posted lxxyd
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了BaseEntity相关的知识,希望对你有一定的参考价值。
@MappedSuperclass
public class BaseEntity {
@Id
@GenericGenerator(name="idGenerator", strategy="uuid")
@GeneratedValue(generator="idGenerator")
// @Column(name = "id")
private String objid;
@JsonFormat(pattern = "yyyy-MM-dd HH:mm",timezone = "GMT+8")
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm")
@Temporal(TemporalType.TIMESTAMP)
@Column(name = "creation_time",updatable = false)
@CreationTimestamp
// @Generated(GenerationTime.INSERT)
private Date creationTime;
@JsonFormat(pattern = "yyyy-MM-dd HH:mm",timezone = "GMT+8")
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm")
@Temporal(TemporalType.TIMESTAMP)
@Column(name = "modify_time")
@UpdateTimestamp
// @Generated(GenerationTime.ALWAYS)
private Date modifyTime;
public String getObjid() {
return objid;
}
public void setObjid(String objid) {
this.objid = objid;
}
public Date getCreationTime() {
return creationTime;
}
public void setCreationTime(Date creationTime) {
this.creationTime = creationTime;
}
public Date getModifyTime() {
return modifyTime;
}
public void setModifyTime(Date modifyTime) {
this.modifyTime = modifyTime;
}
}
以上是关于BaseEntity的主要内容,如果未能解决你的问题,请参考以下文章