aa7bfed331
Release package / release (push) Successful in 22m28s
Co-authored-by: TakahashiNg <83152264+TakahashiNguyen@users.noreply.github.com> Reviewed-on: #61
35 lines
737 B
Java
35 lines
737 B
Java
package com.drinkool.entities;
|
|
|
|
import com.drinkool.Role;
|
|
import com.drinkool.models.UserModel;
|
|
import jakarta.persistence.Entity;
|
|
import jakarta.persistence.FetchType;
|
|
import jakarta.persistence.JoinColumn;
|
|
import jakarta.persistence.ManyToOne;
|
|
import jakarta.persistence.Table;
|
|
import jakarta.transaction.Transactional;
|
|
|
|
@Entity
|
|
@Table(name = Role.Staff)
|
|
public class StaffEntity extends UserModel {
|
|
|
|
public StaffEntity() {
|
|
super(Role.Staff);
|
|
}
|
|
|
|
@Transactional
|
|
public void signup(
|
|
String name,
|
|
String phone,
|
|
String rawPassword,
|
|
ManagerEntity serve
|
|
) {
|
|
this.serve = serve;
|
|
super.signup(name, phone, rawPassword);
|
|
}
|
|
|
|
@ManyToOne(fetch = FetchType.LAZY)
|
|
@JoinColumn(name = "managerId")
|
|
public ManagerEntity serve;
|
|
}
|