
com.github.yaoguoh.common.jpa.domain.BaseDomain Maven / Gradle / Ivy
package com.github.yaoguoh.common.jpa.domain;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.data.annotation.CreatedDate;
import org.springframework.data.annotation.LastModifiedDate;
import org.springframework.data.jpa.domain.support.AuditingEntityListener;
import javax.persistence.*;
import java.io.Serializable;
import java.util.Date;
/**
* The type Base domain.
*
* @author WYG
*/
@Data
@MappedSuperclass
@EntityListeners(AuditingEntityListener.class)
public abstract class BaseDomain implements Serializable {
private static final long serialVersionUID = 1191451105487961993L;
/**
* The Id.
*/
@Id
@ApiModelProperty(value = "实体ID", example = "0")
@GeneratedValue(strategy = GenerationType.IDENTITY)
protected Long id;
/**
* 创建时间
*/
@Column(name = "created_date", updatable = false)
@Temporal(TemporalType.TIMESTAMP)
@CreatedDate
protected Date createdDate;
/**
* 最后修改时间
*/
@Column(name = "last_modified_date")
@Temporal(TemporalType.TIMESTAMP)
@LastModifiedDate
protected Date lastModifiedDate;
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy