Skip to content

Commit

Permalink
Merge pull request #7 from MergeDoc/feat/Base
Browse files Browse the repository at this point in the history
[#4] FEAT : Base Entity 추가
  • Loading branch information
PPakSang authored Jul 26, 2022
2 parents 614a106 + 6408ddd commit 6143469
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 0 deletions.
23 changes: 23 additions & 0 deletions src/main/java/com/mergedoc/backend/Base/BaseEntity.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
package com.mergedoc.backend.Base;

import lombok.Getter;
import org.springframework.data.annotation.CreatedBy;
import org.springframework.data.annotation.LastModifiedBy;
import org.springframework.data.jpa.domain.support.AuditingEntityListener;

import javax.persistence.Column;
import javax.persistence.EntityListeners;
import javax.persistence.MappedSuperclass;

@Getter
@MappedSuperclass
@EntityListeners(AuditingEntityListener.class)
public class BaseEntity extends BaseTimeEntity{

@CreatedBy
@Column(updatable = false)
private String createdBy;

@LastModifiedBy
private String lastModifiedBy;
}
24 changes: 24 additions & 0 deletions src/main/java/com/mergedoc/backend/Base/BaseTimeEntity.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
package com.mergedoc.backend.Base;

import lombok.Getter;
import org.springframework.data.annotation.CreatedDate;
import org.springframework.data.annotation.LastModifiedDate;
import org.springframework.data.jpa.domain.support.AuditingEntityListener;

import javax.persistence.Column;
import javax.persistence.EntityListeners;
import javax.persistence.MappedSuperclass;
import java.time.LocalDateTime;

@Getter
@MappedSuperclass
@EntityListeners(AuditingEntityListener.class)
public class BaseTimeEntity {

@CreatedDate
@Column(updatable = false)
private LocalDateTime createdDate;

@LastModifiedDate
private LocalDateTime lastModifiedDate;
}

0 comments on commit 6143469

Please sign in to comment.