Advertisement
vinay_v

Attachment.java

Sep 9th, 2013
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.92 KB | None | 0 0
  1. @Entity(name = "Attachment")
  2. @Table(name = "attachment")
  3. @PrimaryKeyJoinColumns({ @PrimaryKeyJoinColumn(name = "attachment_parent_id") })
  4. @Audited
  5. public class Attachment extends IdClass {
  6.  
  7.     @Basic()
  8.     @Column(name = "name")
  9.     private String name = null;
  10.  
  11.     @Basic()
  12.     @Column(name = "fileblob")
  13.     @Lob()
  14.     private byte[] fileBlob = null;
  15.  
  16.     @ManyToOne(cascade = { CascadeType.MERGE, CascadeType.PERSIST,
  17.             CascadeType.REFRESH }, optional = false)
  18.     @JoinColumns({ @JoinColumn(name = "attachment_entity") })
  19.     private IdClass entity = null;
  20.  
  21.     public String getName() {
  22.         return name;
  23.     }
  24.  
  25.     public void setName(String newName) {
  26.         name = newName;
  27.     }
  28.  
  29.     public byte[] getFileBlob() {
  30.         return fileBlob;
  31.     }
  32.  
  33.     public void setFileBlob(byte[] newFileBlob) {
  34.         fileBlob = newFileBlob;
  35.     }
  36.  
  37.     public IdClass getEntity() {
  38.         return entity;
  39.     }
  40.  
  41.     public void setEntity(IdClass newEntity) {
  42.         entity = newEntity;
  43.     }
  44.  
  45. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement