36 lines
695 B
Java
36 lines
695 B
Java
package com.magamochi.model.entity;
|
|
|
|
import com.magamochi.model.enumeration.UserRole;
|
|
import jakarta.persistence.*;
|
|
import java.util.Set;
|
|
import lombok.*;
|
|
|
|
@Entity
|
|
@Table(name = "users")
|
|
@Builder
|
|
@NoArgsConstructor
|
|
@AllArgsConstructor
|
|
@Getter
|
|
@Setter
|
|
public class User {
|
|
@Id
|
|
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
|
private Long id;
|
|
|
|
@Column(unique = true, nullable = false)
|
|
private String email;
|
|
|
|
@Column(nullable = false)
|
|
private String name;
|
|
|
|
@Column(nullable = false)
|
|
private String password;
|
|
|
|
@Column(nullable = false)
|
|
@Enumerated(EnumType.STRING)
|
|
private UserRole role;
|
|
|
|
@OneToMany(mappedBy = "user")
|
|
private Set<UserFavoriteManga> favoriteMangas;
|
|
}
|