Files
bill-java/src/main/java/net/alawn/bill/entity/po/EntityId.java
T
2019-05-30 21:17:08 +08:00

73 lines
1.7 KiB
Java

package net.alawn.bill.entity.po;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import lombok.Data;
import org.springframework.data.annotation.Version;
import org.springframework.data.annotation.*;
import org.springframework.data.jpa.domain.support.AuditingEntityListener;
import javax.persistence.Id;
import javax.persistence.*;
import java.io.Serializable;
import java.util.Date;
/**
* @author Alawn
*/
@Data
@MappedSuperclass
@EntityListeners(AuditingEntityListener.class)
@JsonIgnoreProperties(value = { "hibernateLazyInitializer", "handler" },ignoreUnknown = true)
public class EntityId implements Serializable {
protected static final long serialVersionUID = 1L;
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
protected Long id;
// @Temporal(TemporalType.TIMESTAMP)
// @CreationTimestamp
@JsonIgnore
@CreatedDate
@Column(name="create_time")
protected Date createTime;
@JsonIgnore
@Column(name="create_user")
@CreatedBy
protected String createUser;
// @Temporal(TemporalType.TIMESTAMP)
// @UpdateTimestamp
@JsonIgnore
@LastModifiedDate
@Column(name = "update_time")
protected Date updateTime;
@JsonIgnore
@Column(name = "update_user")
@LastModifiedBy
protected String updateUser;
@JsonIgnore
@Version
@Column(name = "version")
protected Long version;
// @Override
// public boolean equals(Object o) {
// if (this == o) return true;
// if (!(o instanceof Detail )) return false;
// return id != null && id.equals(((Detail) o).id);
// }
//
// @Override
// public int hashCode() {
// return 31;
// }
}