2009/05/20 - Apache Shale has been retired.

For more information, please explore the Attic.

View Javadoc

1   /*
2    * Licensed to the Apache Software Foundation (ASF) under one or more
3    * contributor license agreements.  See the NOTICE file distributed with
4    * this work for additional information regarding copyright ownership.
5    * The ASF licenses this file to you under the Apache License, Version 2.0
6    * (the "License"); you may not use this file except in compliance with
7    * the License.  You may obtain a copy of the License at
8    *
9    *      http://www.apache.org/licenses/LICENSE-2.0
10   *
11   * Unless required by applicable law or agreed to in writing, software
12   * distributed under the License is distributed on an "AS IS" BASIS,
13   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14   * See the License for the specific language governing permissions and
15   * limitations under the License.
16   */
17  package org.apache.mailreaderjpa;
18  
19  import java.io.Serializable;
20  import java.sql.Timestamp;
21  import javax.persistence.Column;
22  import javax.persistence.Entity;
23  import javax.persistence.GeneratedValue;
24  import javax.persistence.GenerationType;
25  import javax.persistence.Id;
26  import javax.persistence.NamedQueries;
27  import javax.persistence.NamedQuery;
28  import javax.persistence.Version;
29  
30  /***
31   * <p>JPA entity class for the <code>MAILREADER_PROTOCOLS</code> table.</p>
32   */
33  @Entity(name="mailreader_protocols")
34  @NamedQueries({
35      @NamedQuery(name="Protocol.findAll", query="SELECT p FROM mailreader_protocols p")
36  })
37  public class Protocol implements Serializable {
38  
39      @Id
40      @Column(name="protocol_id")
41      @GeneratedValue(strategy = GenerationType.AUTO)
42      private Integer id;
43      
44      /*** Creates a new instance of Protocol */
45      public Protocol() {
46      }
47  
48      public Integer getId() {
49          return id;
50      }
51  
52      public void setId(Integer id) {
53          this.id = id;
54      }
55  
56      public int hashCode() {
57          if (getId() != null) {
58              return getId().intValue();
59          } else {
60              return super.hashCode();
61          }
62      }
63  
64      public boolean equals(Object obj) {
65          if ((obj instanceof Protocol)
66              && (getId() != null)) {
67              return getId().equals(((Protocol) obj).getId());
68          } else {
69              return false;
70          }
71      }
72  
73      public String toString() {
74          return "org.apache.mailreaderjpa.Protocol[id=" + id + "]";
75      }
76      
77      @Column(nullable=false)
78      private String description;
79      @Column(name="last_update")
80      @Version()
81      private Timestamp lastUpdate;
82  
83      public String getDescription() {
84          return description;
85      }
86  
87      public void setDescription(String description) {
88          this.description = description;
89      }
90  
91      public Timestamp getLastUpdate() {
92          return lastUpdate;
93      }
94  
95      public void setLastUpdate(Timestamp lastUpdate) {
96          this.lastUpdate = lastUpdate;
97      }
98  
99  }