All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.github.gentity.demogallery.RoleGalleryAccess Maven / Gradle / Ivy

There is a newer version: 1.0.0
Show newest version

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;

@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;

    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 gallery;
    }

    public void setGallery(Gallery gallery) {
        this.gallery = 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