View Javadoc

1   /**
2    * 
3    */
4   package de.tivsource.page.entity.pictureitem;
5   
6   import javax.persistence.Basic;
7   import javax.persistence.CascadeType;
8   import javax.persistence.Entity;
9   import javax.persistence.FetchType;
10  import javax.persistence.Inheritance;
11  import javax.persistence.InheritanceType;
12  import javax.persistence.JoinColumn;
13  import javax.persistence.ManyToOne;
14  import javax.persistence.OneToOne;
15  
16  import org.hibernate.envers.Audited;
17  
18  import de.tivsource.page.common.css.CSSGroup;
19  import de.tivsource.page.entity.namingitem.NamingItem;
20  import de.tivsource.page.entity.picture.Picture;
21  
22  /**
23   * @author Marc Michele
24   *
25   */
26  @Audited
27  @Entity
28  @Inheritance(strategy = InheritanceType.JOINED)
29  public class PictureItem extends NamingItem {
30  
31      // TODO: muss entfernt werden sobald das andere Bild benutzt wird
32      @ManyToOne(fetch = FetchType.EAGER)
33      @JoinColumn(name = "picture_uuid")
34      private Picture picture;
35  
36      @OneToOne(mappedBy = "pictureItem", fetch = FetchType.EAGER, cascade = { CascadeType.ALL })
37      @JoinColumn(name = "image_uuid")
38      private PictureItemImage image;
39  
40      @Basic
41      @org.hibernate.annotations.Type(type = "yes_no")
42      private Boolean pictureOnPage = true;
43  
44      @ManyToOne(targetEntity = CSSGroup.class, fetch = FetchType.EAGER)
45      @JoinColumn(name = "cssGroup_uuid")
46      private CSSGroup cssGroup;
47  
48      public Picture getPicture() {
49          return picture;
50      }
51  
52      public void setPicture(Picture picture) {
53          this.picture = picture;
54      }
55  
56      /**
57       * @return the image
58       */
59      public PictureItemImage getImage() {
60          return image;
61      }
62  
63      /**
64       * @param image the image to set
65       */
66      public void setImage(PictureItemImage image) {
67          this.image = image;
68      }
69  
70      public Boolean getPictureOnPage() {
71          return pictureOnPage;
72      }
73  
74      public void setPictureOnPage(Boolean pictureOnPage) {
75          this.pictureOnPage = pictureOnPage;
76      }
77  
78      /**
79       * @return the cssGroup
80       */
81      public CSSGroup getCssGroup() {
82          return cssGroup;
83      }
84  
85      /**
86       * @param cssGroup the cssGroup to set
87       */
88      public void setCssGroup(CSSGroup cssGroup) {
89          this.cssGroup = cssGroup;
90      }
91  
92  }// Ende class