User.java
package at.htl.beeyond.entity;
import io.quarkus.hibernate.orm.panache.PanacheEntityBase;
import javax.persistence.*;
import java.util.List;
@Entity(name = "_user")
public class User extends PanacheEntityBase {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id;
@Column(unique = true)
private String name;
@ManyToMany(mappedBy = "users")
private List<Namespace> namespaces;
@OneToMany(mappedBy = "owner")
List<Application> applications;
@OneToMany(mappedBy = "owner")
private List<Template> templates;
public User(String name) {
this.name = name;
}
public User() {
}
public Long getId() {
return id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public List<Namespace> getNamespaces() {
return namespaces;
}
public void setNamespaces(List<Namespace> namespaces) {
this.namespaces = namespaces;
}
public List<Application> getApplications() {
return applications;
}
public void setApplications(List<Application> applications) {
this.applications = applications;
}
public List<Template> getTemplates() {
return templates;
}
public void setTemplates(List<Template> templates) {
this.templates = templates;
}
}