001: package com.technoetic.xplanner.domain;
002:
003: import java.io.Serializable;
004:
005: /**
006: * @hibernate.class
007: * table="Person"
008: */
009: public class Person extends DomainObject implements Serializable {
010: private String name;
011: private String email;
012: private String phone;
013: private String initials;
014: private String userId;
015: private boolean hidden;
016: private String password;
017:
018: /**
019: * Default constructor
020: */
021: public Person() {
022: }
023:
024: /**
025: * Public constructor
026: * @param userId user identity
027: */
028: public Person(String userId) {
029: this .userId = userId;
030: }
031:
032: /**
033: * @hibernate.property
034: * column="name"
035: * @param name Person first name
036: */
037: public void setName(String name) {
038: this .name = name;
039: }
040:
041: public String getName() {
042: return name;
043: }
044:
045: /**
046: * @hibernate.property
047: * column="email"
048: * @param email Person primary mail
049: */
050: public void setEmail(String email) {
051: this .email = email;
052: }
053:
054: public String getEmail() {
055: return email;
056: }
057:
058: /**
059: * @hibernate.property
060: * column="phone"
061: * @param phone number
062: */
063: public void setPhone(String phone) {
064: this .phone = phone;
065: }
066:
067: public String getPhone() {
068: return phone;
069: }
070:
071: /**
072: * @hibernate.property
073: * column="initials"
074: * @param initials for example: AZW, SYS, etc.
075: */
076: public void setInitials(String initials) {
077: this .initials = initials;
078: }
079:
080: public String getInitials() {
081: return initials;
082: }
083:
084: /**
085: * @hibernate.property
086: * column="userId"
087: * @param userId (login) for example: sysadmin, sbate
088: */
089: public void setUserId(String userId) {
090: this .userId = userId;
091: }
092:
093: public String getUserId() {
094: return userId;
095: }
096:
097: /**
098: * @hibernate.property
099: * column="is_hidden"
100: * @param hidden
101: */
102: public void setHidden(boolean hidden) {
103: this .hidden = hidden;
104: }
105:
106: public boolean isHidden() {
107: return hidden;
108: }
109:
110: /**
111: * @hibernate.property
112: * column="password"
113: * @param password
114: */
115: public void setPassword(String password) {
116: this .password = password;
117: }
118:
119: public String getPassword() {
120: return password;
121: }
122:
123: public String getDescription() {
124: return "";
125: }
126:
127: public String toString() {
128: return "Person(id=" + this .getId() + ", name=" + this .getName()
129: + ", userId=" + this .getUserId() + ", initials="
130: + this .getInitials() + ", email=" + this .getEmail()
131: + ", phone=" + this .getPhone() + ")";
132: }
133:
134: public boolean equals(Object o) {
135: if (this == o)
136: return true;
137: if (o == null || getClass() != o.getClass())
138: return false;
139: if (!super .equals(o))
140: return false;
141:
142: final Person person = (Person) o;
143:
144: if (userId != null ? !userId.equals(person.userId)
145: : person.userId != null)
146: return false;
147:
148: return true;
149: }
150:
151: public int hashCode() {
152: int result = super .hashCode();
153: result = 29 * result + (userId != null ? userId.hashCode() : 0);
154: return result;
155: }
156: }
|