View Javadoc

1   /**
2    * 
3    */
4   package de.tivsource.page.common.captcha;
5   
6   import java.util.Date;
7   
8   import javax.persistence.CascadeType;
9   import javax.persistence.Column;
10  import javax.persistence.Entity;
11  import javax.persistence.FetchType;
12  import javax.persistence.Id;
13  import javax.persistence.OneToOne;
14  import javax.persistence.Temporal;
15  
16  import org.hibernate.search.annotations.DocumentId;
17  
18  import de.tivsource.page.common.captcha.image.CaptchaImage;
19  
20  /**
21   * @author Marc Michele
22   *
23   */
24  @Entity
25  public class Captcha {
26  
27      /**
28       * UUID des Objektes der Klasse Captcha, diese ID ist einmalig über alle
29       * Objekte hinweg und sollte der bevorzugte weg sein auf bestimmte Objekte
30       * zuzugreifen.
31       */
32      @Id
33      @DocumentId
34      @Column(name="uuid", unique=true, length=42)
35      private String uuid;
36  
37      @OneToOne(mappedBy = "captcha", fetch = FetchType.EAGER, cascade = { CascadeType.ALL })
38      private CaptchaImage image;
39  
40      private String content;
41  
42      /**
43       * Erfassungsdatum, Datum/Zeit an dem das Objekt in die Datenbank
44       * gespeichert wurde.
45       */
46      @Temporal(javax.persistence.TemporalType.TIMESTAMP)
47      private Date created;
48  
49      /**
50       * Datum an dem das Objekt das letzte mal geändert wurde.
51       */
52      @Temporal(javax.persistence.TemporalType.TIMESTAMP)
53      private Date modified;
54  
55      /**
56       * Feld in dem gespeichert ist welche Benutzer (Username) das Objekt als
57       * letztes verändert hat.
58       */
59      private String modifiedBy;
60  
61      /**
62       * Ip-Adresse von der das Objekt das letzte mal geändert wurde.
63       */
64      private String modifiedAddress;
65  
66      public String getUuid() {
67          return uuid;
68      }
69  
70      public void setUuid(String uuid) {
71          this.uuid = uuid;
72      }
73  
74      /**
75       * @return the image
76       */
77      public CaptchaImage getImage() {
78          return image;
79      }
80  
81      /**
82       * @param image the image to set
83       */
84      public void setImage(CaptchaImage image) {
85          this.image = image;
86      }
87  
88      public String getContent() {
89          return content;
90      }
91  
92      public void setContent(String content) {
93          this.content = content;
94      }
95  
96      public Date getCreated() {
97          return created;
98      }
99  
100     public void setCreated(Date created) {
101         this.created = created;
102     }
103 
104     public Date getModified() {
105         return modified;
106     }
107 
108     public void setModified(Date modified) {
109         this.modified = modified;
110     }
111 
112     public String getModifiedBy() {
113         return modifiedBy;
114     }
115 
116     public void setModifiedBy(String modifiedBy) {
117         this.modifiedBy = modifiedBy;
118     }
119 
120     public String getModifiedAddress() {
121         return modifiedAddress;
122     }
123 
124     public void setModifiedAddress(String modifiedAddress) {
125         this.modifiedAddress = modifiedAddress;
126     }
127 
128 }// Ende class