-
Notifications
You must be signed in to change notification settings - Fork 46
Expand file tree
/
Copy pathBaseIdAndTime.java
More file actions
27 lines (23 loc) · 808 Bytes
/
Copy pathBaseIdAndTime.java
File metadata and controls
27 lines (23 loc) · 808 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
package com.back.jpa.entity;
import jakarta.persistence.EntityListeners;
import jakarta.persistence.GeneratedValue;
import jakarta.persistence.Id;
import jakarta.persistence.MappedSuperclass;
import lombok.Getter;
import org.springframework.data.annotation.CreatedDate;
import org.springframework.data.annotation.LastModifiedDate;
import org.springframework.data.jpa.domain.support.AuditingEntityListener;
import java.time.LocalDateTime;
import static jakarta.persistence.GenerationType.IDENTITY;
@MappedSuperclass
@EntityListeners(AuditingEntityListener.class)
@Getter
public class BaseIdAndTime extends BaseEntity {
@Id
@GeneratedValue(strategy = IDENTITY)
private int id;
@CreatedDate
private LocalDateTime createDate;
@LastModifiedDate
private LocalDateTime modifyDate;
}