View Javadoc

1   /**
2    * 
3    */
4   package de.tivsource.page.entity.companion;
5   
6   import java.util.Date;
7   
8   import javax.persistence.Basic;
9   import javax.persistence.Column;
10  import javax.persistence.Embedded;
11  import javax.persistence.Entity;
12  import javax.persistence.FetchType;
13  import javax.persistence.Id;
14  import javax.persistence.JoinColumn;
15  import javax.persistence.ManyToOne;
16  import javax.persistence.Temporal;
17  
18  import org.hibernate.envers.Audited;
19  import org.hibernate.search.annotations.DocumentId;
20  
21  import de.tivsource.page.entity.embeddable.Address;
22  import de.tivsource.page.entity.embeddable.ContactDetails;
23  
24  /**
25   * @author Marc Michele
26   *
27   */
28  @Audited
29  @Entity
30  public class Companion {
31  
32      /**
33       * UUID des Objektes der Klasse NamingItem, diese ID ist einmalig über alle
34       * Objekte hinweg und sollte der bevorzugte weg sein auf bestimmte Objekte
35       * zuzugreifen.
36       */
37      @Id
38      @DocumentId
39      @Column(name="uuid", unique=true, length=42)
40      private String uuid;
41  
42      private String name;
43  
44      private String appendix;
45      
46      @Embedded
47      private Address address;
48  
49      @Embedded
50      private ContactDetails contactDetails;
51  
52      @ManyToOne(targetEntity = CompanionGroup.class, fetch = FetchType.EAGER)
53      @JoinColumn(name = "group_uuid")
54      private CompanionGroup group;
55  
56      @Basic
57      @org.hibernate.annotations.Type(type = "yes_no")
58      private Boolean visible;
59  
60      @Temporal(javax.persistence.TemporalType.TIMESTAMP)
61      private Date created;
62  
63      @Temporal(javax.persistence.TemporalType.TIMESTAMP)
64      private Date modified;
65  
66      private String modifiedBy;
67  
68      private String modifiedAddress;
69  
70      public String getUuid() {
71          return uuid;
72      }
73  
74      public void setUuid(String uuid) {
75          this.uuid = uuid;
76      }
77  
78      public String getName() {
79          return name;
80      }
81  
82      public void setName(String name) {
83          this.name = name;
84      }
85  
86      public String getAppendix() {
87          return appendix;
88      }
89  
90      public void setAppendix(String appendix) {
91          this.appendix = appendix;
92      }
93  
94      public Address getAddress() {
95          return address;
96      }
97  
98      public void setAddress(Address address) {
99          this.address = address;
100     }
101 
102     public ContactDetails getContactDetails() {
103         return contactDetails;
104     }
105 
106     public void setContactDetails(ContactDetails contactDetails) {
107         this.contactDetails = contactDetails;
108     }
109 
110     public CompanionGroup getGroup() {
111         return group;
112     }
113 
114     public void setGroup(CompanionGroup group) {
115         this.group = group;
116     }
117 
118     public Boolean getVisible() {
119         return visible;
120     }
121 
122     public void setVisible(Boolean visible) {
123         this.visible = visible;
124     }
125 
126     public Date getCreated() {
127         return created;
128     }
129 
130     public void setCreated(Date created) {
131         this.created = created;
132     }
133 
134     public Date getModified() {
135         return modified;
136     }
137 
138     public void setModified(Date modified) {
139         this.modified = modified;
140     }
141 
142     public String getModifiedBy() {
143         return modifiedBy;
144     }
145 
146     public void setModifiedBy(String modifiedBy) {
147         this.modifiedBy = modifiedBy;
148     }
149 
150     public String getModifiedAddress() {
151         return modifiedAddress;
152     }
153 
154     public void setModifiedAddress(String modifiedAddress) {
155         this.modifiedAddress = modifiedAddress;
156     }
157 
158 }// Ende class