com.github.gentity.demogallery.RoleGalleryAccess Maven / Gradle / Ivy
package com.github.gentity.demogallery;
import java.io.Serializable;
import javax.persistence.Column;
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_GALLERY_ACCESS")
@DiscriminatorValue("GALLERY")
@PrimaryKeyJoinColumn(name = "ROLE_ID", referencedColumnName = "ID", foreignKey = @ForeignKey(name = "FK_ROLE_GALLERY_ACCESS_ROLE"))
public class RoleGalleryAccess
extends Role
implements Serializable
{
@Column(name = "WRITE_ACCESS", nullable = false)
protected boolean writeAccess;
@ManyToOne
@JoinColumn(name = "GALLERY_ID", nullable = false)
protected Gallery gallery;
final static ToOneSide relationTo$gallery = ToOneSide.of((o -> o.gallery), ((o,m) -> o.gallery = m), Gallery.relationTo$roleGalleryAccess);
public static RoleGalleryAccess.Builder builder() {
return new RoleGalleryAccess.Builder();
}
public boolean getWriteAccess() {
return writeAccess;
}
public void setWriteAccess(boolean writeAccess) {
this.writeAccess = writeAccess;
}
public Gallery getGallery() {
return (relationTo$gallery.get(this));
}
public void setGallery(Gallery gallery) {
relationTo$gallery.set(this, gallery);
}
public static class Builder
extends Role.Builder
{
private final RoleGalleryAccess instance = new RoleGalleryAccess();
public RoleGalleryAccess build() {
return instance;
}
public RoleGalleryAccess.Builder writeAccess(boolean writeAccess) {
instance.writeAccess = writeAccess;
return this;
}
public RoleGalleryAccess.Builder gallery(Gallery gallery) {
instance.gallery = gallery;
return this;
}
public RoleGalleryAccess.Builder name(String name) {
instance.name = name;
return this;
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy