com.github.gentity.demogallery.Picture Maven / Gradle / Ivy
package com.github.gentity.demogallery;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
import javax.persistence.CollectionTable;
import javax.persistence.Column;
import javax.persistence.DiscriminatorColumn;
import javax.persistence.DiscriminatorValue;
import javax.persistence.ElementCollection;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Inheritance;
import javax.persistence.InheritanceType;
import javax.persistence.JoinColumn;
import javax.persistence.Lob;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import com.github.gentity.ToOneSide;
@Entity
@Table(name = "PICTURE")
@Inheritance(strategy = InheritanceType.SINGLE_TABLE)
@DiscriminatorColumn(name = "DTYPE", length = 8)
@DiscriminatorValue("PICT")
public class Picture implements Serializable
{
@ElementCollection
@CollectionTable(name = "PICTURE_DATA", joinColumns = {
@JoinColumn(name = "PICTURE_ID", referencedColumnName = "ID")
})
@Lob
@Column(name = "DATA", nullable = false)
protected List data = new ArrayList();
@ElementCollection
@CollectionTable(name = "PICTURE_KEYWORD", joinColumns = {
@JoinColumn(name = "PICTURE_ID", referencedColumnName = "ID")
})
@Column(name = "KEYWORD", length = 100, nullable = false)
protected List keyword = new ArrayList();
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(name = "ID")
protected Integer id;
@Column(name = "TITLE", length = 100)
protected String title;
@ManyToOne
@JoinColumn(name = "GALLERY_ID", nullable = false)
protected Gallery gallery;
final static ToOneSide
© 2015 - 2025 Weber Informatics LLC | Privacy Policy