Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
package jp.co.confrage.domain.entity;
import java.time.LocalDateTime;
import javax.persistence.Column;
import javax.persistence.Convert;
import javax.persistence.EntityListeners;
import javax.persistence.MappedSuperclass;
import javax.persistence.Version;
import org.springframework.data.annotation.CreatedBy;
import org.springframework.data.annotation.CreatedDate;
import org.springframework.data.annotation.LastModifiedBy;
import org.springframework.data.annotation.LastModifiedDate;
import org.springframework.data.jpa.domain.support.AuditingEntityListener;
@MappedSuperclass
@EntityListeners(AuditingEntityListener.class)
public abstract class AbstractEntity {
/** バージョン. */
@Version
@Column(name = "version")
private Integer version;
/** 作成者. */
@CreatedBy
@Column(name = "creator")
private String creatorCode;
/** 作成日時. */
@CreatedDate
@Column(name = "create_time")
private LocalDateTime createdTim;
/** 更新者. */
@LastModifiedBy
@Column(name = "updater")
private String updaterCode;
/** 更新日時. */
@LastModifiedDate
@Column(name = "update_time")
private LocalDateTime updatedTim;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment