Skip to content

Commit

Permalink
fix: Fixed BaseTimeEntity class
Browse files Browse the repository at this point in the history
- added @MappedSuperClass
- added @column(updatable=false) to createdDate field

closes #11
  • Loading branch information
koreanMike513 committed Dec 23, 2024
1 parent 8958f33 commit 64efe13
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -1,16 +1,20 @@
package com.f_lab.la_planete.domain.base;

import jakarta.persistence.Column;
import jakarta.persistence.EntityListeners;
import jakarta.persistence.MappedSuperclass;
import org.springframework.data.annotation.CreatedDate;
import org.springframework.data.annotation.LastModifiedDate;
import org.springframework.data.jpa.domain.support.AuditingEntityListener;

import java.time.LocalDateTime;

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

@CreatedDate
@Column(updatable = false)
private LocalDateTime createdAt;
@LastModifiedDate
private LocalDateTime modifiedAt;
Expand Down

0 comments on commit 64efe13

Please sign in to comment.