com.github.gentity.demogallery.RoleUserAdmin Maven / Gradle / Ivy
package com.github.gentity.demogallery;
import java.io.Serializable;
import javax.persistence.DiscriminatorValue;
import javax.persistence.Entity;
import javax.persistence.ForeignKey;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.PrimaryKeyJoinColumn;
import javax.persistence.Table;
import com.github.gentity.ToOneSide;
@Entity
@Table(name = "ROLE_USER_ADMIN")
@DiscriminatorValue("ADMIN")
@PrimaryKeyJoinColumn(name = "ROLE_ID", referencedColumnName = "ID", foreignKey = @ForeignKey(name = "FK_ROLE_GROUP_ADMIN_ROLE"))
public class RoleUserAdmin
extends Role
implements Serializable
{
@ManyToOne
@JoinColumn(name = "GROUP_ID")
protected Group group;
final static ToOneSide relationTo$group = ToOneSide.of((o -> o.group), ((o,m) -> o.group = m));
public static RoleUserAdmin.Builder builder() {
return new RoleUserAdmin.Builder();
}
public Group getGroup() {
return (relationTo$group.get(this));
}
public void setGroup(Group group) {
relationTo$group.set(this, group);
}
public static class Builder
extends Role.Builder
{
private final RoleUserAdmin instance = new RoleUserAdmin();
public RoleUserAdmin build() {
return instance;
}
public RoleUserAdmin.Builder group(Group group) {
instance.group = group;
return this;
}
public RoleUserAdmin.Builder name(String name) {
instance.name = name;
return this;
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy