issue # ExampleEntity 파일 수정
This commit is contained in:
@@ -1,28 +1,41 @@
|
||||
import jakarta.persistence.*;
|
||||
import lombok.*;
|
||||
import org.hibernate.annotations.CreationTimestamp;
|
||||
import org.hibernate.annotations.UpdateTimestamp;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.UUID;
|
||||
|
||||
@Getter
|
||||
@NoArgsConstructor(access = AccessLevel.PROTECTED)
|
||||
@AllArgsConstructor(access = AccessLevel.PRIVATE)
|
||||
@Builder
|
||||
@Entity
|
||||
@TABLE(name = "example")
|
||||
public class Example {
|
||||
@Table(
|
||||
name = "users",
|
||||
indexes = @Index(name = "idx_users_email", columnList = "email")
|
||||
)
|
||||
public class User {
|
||||
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
private String id;
|
||||
@GeneratedValue
|
||||
@org.hibernate.annotations.UuidGenerator
|
||||
private UUID id;
|
||||
|
||||
@Column(nullable = true, length = 50)
|
||||
private String username;
|
||||
@Column(nullable = false, length = 50)
|
||||
private String userName;
|
||||
|
||||
@Column(nullable = false, unique = true, length = 100)
|
||||
private String email;
|
||||
|
||||
@Builder.Default
|
||||
@Column(nullable = false)
|
||||
private Boolean isDeleted = false;
|
||||
private Boolean active;
|
||||
|
||||
@Enumerated(EnumType.STRING)
|
||||
private Role role;
|
||||
|
||||
@CreationTimestamp
|
||||
private LocalDateTime createdAt;
|
||||
|
||||
public void delete() {
|
||||
this.isDeleted = true;
|
||||
}
|
||||
@UpdateTimestamp
|
||||
private LocalDateTime updatedAt;
|
||||
}
|
||||
Reference in New Issue
Block a user