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

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

There is a newer version: 1.0.0
Show newest version

package com.github.gentity.demogallery;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;

@Entity
@Table(name = "GALLERY")
public class Gallery implements Serializable
{

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column(name = "ID")
    protected Integer id;
    @Column(name = "NAME", length = 100, nullable = false)
    protected String name;
    @OneToMany(mappedBy = "gallery")
    protected List picture = new ArrayList();
    @ManyToOne
    @JoinColumn(name = "OWNER_USER_ID", nullable = false)
    protected User ownerUser;
    @OneToMany(mappedBy = "gallery")
    protected List roleGalleryAccess = new ArrayList();

    public static Gallery.Builder builder() {
        return new Gallery.Builder();
    }

    public Integer getId() {
        return id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public List getPicture() {
        return picture;
    }

    public void setPicture(List picture) {
        this.picture = picture;
    }

    public User getOwnerUser() {
        return ownerUser;
    }

    public void setOwnerUser(User ownerUser) {
        this.ownerUser = ownerUser;
    }

    public List getRoleGalleryAccess() {
        return roleGalleryAccess;
    }

    public void setRoleGalleryAccess(List roleGalleryAccess) {
        this.roleGalleryAccess = roleGalleryAccess;
    }

    public static class Builder {

        private final Gallery instance = new Gallery();

        public Gallery build() {
            return instance;
        }

        public Gallery.Builder name(String name) {
            instance.name = name;
            return this;
        }

        public Gallery.Builder picture(List picture) {
            instance.picture = picture;
            return this;
        }

        public Gallery.Builder ownerUser(User ownerUser) {
            instance.ownerUser = ownerUser;
            return this;
        }

        public Gallery.Builder roleGalleryAccess(List roleGalleryAccess) {
            instance.roleGalleryAccess = roleGalleryAccess;
            return this;
        }

    }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy