-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
20 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
33 changes: 18 additions & 15 deletions
33
src/main/java/com/hackathon/TimeLapse/common/BaseEntity.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,30 @@ | ||
package com.hackathon.TimeLapse.common; | ||
|
||
import jakarta.persistence.EntityListeners; | ||
import jakarta.persistence.MappedSuperclass; | ||
import java.time.LocalDateTime; | ||
|
||
import org.springframework.data.annotation.CreatedDate; | ||
import org.springframework.data.annotation.LastModifiedDate; | ||
import org.springframework.data.jpa.domain.support.AuditingEntityListener; | ||
|
||
import jakarta.persistence.EntityListeners; | ||
import jakarta.persistence.MappedSuperclass; | ||
|
||
@MappedSuperclass | ||
@EntityListeners({AbstractMethodError.class}) | ||
@EntityListeners(AuditingEntityListener.class) | ||
public abstract class BaseEntity { | ||
@CreatedDate | ||
private LocalDateTime createdAt; | ||
@LastModifiedDate | ||
private LocalDateTime updatedAt; | ||
@CreatedDate | ||
private LocalDateTime createdAt; | ||
@LastModifiedDate | ||
private LocalDateTime updatedAt; | ||
|
||
public BaseEntity() { | ||
} | ||
public BaseEntity() { | ||
} | ||
|
||
public LocalDateTime getCreatedAt() { | ||
return this.createdAt; | ||
} | ||
public LocalDateTime getCreatedAt() { | ||
return this.createdAt; | ||
} | ||
|
||
public LocalDateTime getUpdatedAt() { | ||
return this.updatedAt; | ||
} | ||
public LocalDateTime getUpdatedAt() { | ||
return this.updatedAt; | ||
} | ||
} |