package de.oaa.xxx.user;

import jakarta.persistence.Column;
import jakarta.persistence.Entity;
import jakarta.persistence.Id;
import jakarta.persistence.Table;

import java.util.UUID;

@Entity
@Table(name = "user")
public class UserEntity {

    @Id
    @Column
    private UUID userId;
    @Column
    private String name;
    @Column(unique = true)
    private String email;
    @Column
    private String password;

    public UUID getUserId() { return userId; }
    public void setUserId(UUID userId) { this.userId = userId; }

    public String getName() { return name; }
    public void setName(String name) { this.name = name; }

    public String getEmail() { return email; }
    public void setEmail(String email) { this.email = email; }

    public String getPassword() { return password; }
    public void setPassword(String password) { this.password = password; }

    public User toUser() {
        User user = new User();
        user.setEmail(email);
        user.setName(name);
        user.setUserId(userId);
        return user;
    }
}
