1   /*
2    * Post.java
3    *
4    * Created on 1 Июнь 2006 г., 23:25
5    */
6   package org.weda.domain;
7   
8   import javax.persistence.Entity;
9   import javax.persistence.GeneratedValue;
10  import javax.persistence.GenerationType;
11  import javax.persistence.Id;
12  import org.apache.commons.lang.ObjectUtils;
13  import org.weda.property.annotations.Description;
14  
15  /**Должность сотрудника
16   *
17   * @author Mikhail Titov
18   */
19  @Entity
20  public class Post {
21      private Integer id;
22      private String name;
23  
24      @Id @GeneratedValue(strategy=GenerationType.AUTO)
25      @Description(displayName="s/n")
26      public Integer getId() {
27          return id;
28      }
29  
30      public void setId(Integer id) {
31          this.id = id;
32      }
33  
34      @Description(displayName="Название должности")
35      public String getName() {
36          return name;
37      }
38  
39      public void setName(String name) {
40          this.name = name;
41      }
42      
43      public String toString(){
44          return name;
45      }
46      
47      public boolean equals(Object obj){
48          if (obj instanceof Post)
49              return ObjectUtils.equals(id, ((Post)obj).getId());
50          else
51              return false;
52      }
53  }