issue # ExampleEntity 파일 수정

This commit is contained in:
2025-10-31 07:26:17 +00:00
parent 03187ba9ca
commit 6423c504e6

View File

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