Skip to content

Commit

Permalink
feat: BaseEntity 세팅
Browse files Browse the repository at this point in the history
  • Loading branch information
kseysh committed Nov 25, 2023
1 parent c53665f commit 34f5a90
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
package org.sopt.sopkerton.common.config;

import org.springframework.context.annotation.Configuration;
import org.springframework.data.jpa.repository.config.EnableJpaAuditing;

@EnableJpaAuditing
@Configuration
public class JpaAuditingConfig {
}
23 changes: 23 additions & 0 deletions src/main/java/org/sopt/sopkerton/common/domain/BaseEntity.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
package org.sopt.sopkerton.common.domain;

import jakarta.persistence.Column;
import jakarta.persistence.EntityListeners;
import jakarta.persistence.MappedSuperclass;
import java.time.LocalDateTime;
import lombok.Getter;
import org.springframework.data.annotation.CreatedDate;
import org.springframework.data.annotation.LastModifiedDate;
import org.springframework.data.jpa.domain.support.AuditingEntityListener;

@Getter
@MappedSuperclass
@EntityListeners(AuditingEntityListener.class)
public class BaseEntity {
@CreatedDate
@Column(name = "register_at")
private LocalDateTime registerAt;

@LastModifiedDate
@Column(name = "done_at")
private LocalDateTime doneAt;
}

0 comments on commit 34f5a90

Please sign in to comment.