package fsmodel.model.adhoc; import java.io.Serializable; import java.util.Date; import java.util.Set; import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.FetchType; import javax.persistence.GeneratedValue; import javax.persistence.GenerationType; import javax.persistence.Id; import javax.persistence.JoinColumn; import javax.persistence.JoinTable; import javax.persistence.ManyToMany; import javax.persistence.ManyToOne; import javax.persistence.Table; import javax.persistence.Temporal; import javax.persistence.TemporalType; import fsmodel.model.contact.Contact; import fsmodel.model.image.Image; @Entity @Table(name="adhoc_albums") public class AdhocAlbum implements Serializable{ /** * */ private static final long serialVersionUID = 1L; @Id @GeneratedValue(strategy = GenerationType.IDENTITY) private Long id; @Column(name="name", nullable= true) private String name; @Column(name="link_id") private String linkId; @Column(name="passphase",nullable = true) private String passphase; @ManyToOne @JoinColumn(name="contact_id") private Contact createdBy; @Temporal(TemporalType.TIMESTAMP) @Column(name="created_on") private Date createdOn; @Temporal(TemporalType.TIMESTAMP) @Column(name="expire_on") private Date expireOn; @Column(name="allowable_click") private Integer allowableClick; @Column(name="publish") private Boolean publish; @Column(name="direct_access") private Boolean directAccess; @Column(name="download") private Boolean download; @Column(name="watermark") private Boolean watermark; @ManyToMany(fetch = FetchType.LAZY) @JoinTable(name = "adhoc_email_relation", joinColumns = @JoinColumn(name = "adhoc_album_id"), inverseJoinColumns = @JoinColumn(name = "email_id")) private Set emailList; @ManyToMany(fetch = FetchType.LAZY) @JoinTable(name = "adhoc_image_relation", joinColumns = @JoinColumn(name = "adhoc_album_id"), inverseJoinColumns = @JoinColumn(name = "image_id")) private Set imageList; public AdhocAlbum(){ createdOn = new Date(); } public Long getId() { return id; } public void setId(Long id) { this.id = id; } public String getName() { return name; } public void setName(String name) { this.name = name; } public String getLinkId() { return linkId; } public void setLinkId(String linkId) { this.linkId = linkId; } public String getPassphase() { return passphase; } public void setPassphase(String passphase) { this.passphase = passphase; } public Contact getCreatedBy() { return createdBy; } public void setCreatedBy(Contact createdBy) { this.createdBy = createdBy; } public Date getCreatedOn() { return createdOn; } public void setCreatedOn(Date createdOn) { this.createdOn = createdOn; } public Date getExpireOn() { return expireOn; } public void setExpireOn(Date expireOn) { this.expireOn = expireOn; } public Integer getAllowableClick() { return allowableClick; } public void setAllowableClick(Integer allowableClick) { this.allowableClick = allowableClick; } public Boolean getPublish() { return publish; } public void setPublish(Boolean publish) { this.publish = publish; } public Boolean getDirectAccess() { return directAccess; } public void setDirectAccess(Boolean directAccess) { this.directAccess = directAccess; } public Boolean getDownload() { return download; } public void setDownload(Boolean download) { this.download = download; } public Boolean getWatermark() { return watermark; } public void setWatermark(Boolean watermark) { this.watermark = watermark; } public Set getEmailList() { return emailList; } public void setEmailList(Set emailList) { this.emailList = emailList; } public Set getImageList() { return imageList; } public void setImageList(Set imageList) { this.imageList = imageList; } }