1 package org.gnomekr.potron.data; 2 3 import java.io.Serializable; 4 import java.util.Date; 5 import java.util.Set; 6 7 import org.apache.commons.lang.builder.EqualsBuilder; 8 import org.apache.commons.lang.builder.HashCodeBuilder; 9 import org.apache.commons.lang.builder.ToStringBuilder; 10 11 /*** 12 * LanguageTeam.java 13 * @author Xavier Cho 14 * @version $Revision 1.1 $ $Date: 2005/07/21 10:04:43 $ 15 * @hibernate.class table = "POTRON_TEAM" 16 * @hibernate.cache usage = "nonstrict-read-write" 17 */ 18 public class LanguageTeam implements Serializable { 19 20 private static final long serialVersionUID = 3276800820199015080L; 21 22 private long id = -1; 23 private String name; 24 private String contact; 25 private String encoding; 26 private String prefix; 27 private Date registeredDate; 28 private Set<Translation> translations; 29 30 public LanguageTeam() { 31 } 32 33 /*** 34 * @param id 35 */ 36 public LanguageTeam(long id) { 37 this.id = id; 38 } 39 40 /*** 41 * @return 42 * @hibernate.id 43 * column = "team_id" 44 * length = "20" 45 * unsaved-value = "-1" 46 * generator-class = "native" 47 * @hibernate.generator-param 48 * name = "sequence" 49 * value = "POTRON_SEQ_TEAM" 50 */ 51 public long getId() { 52 return id; 53 } 54 55 /*** 56 * @return 57 * @hibernate.property 58 * column = "name" 59 * length = "80" 60 * update = "true" 61 * not-null = "true" 62 */ 63 public String getName() { 64 return name; 65 } 66 67 /*** 68 * @return 69 * @hibernate.property 70 * column = "encoding" 71 * length = "10" 72 * update = "true" 73 * not-null = "true" 74 */ 75 public String getEncoding() { 76 return encoding; 77 } 78 79 /*** 80 * @return 81 * @hibernate.property 82 * column = "contact" 83 * length = "80" 84 * update = "true" 85 * not-null = "false" 86 */ 87 public String getContact() { 88 return contact; 89 } 90 91 /*** 92 * @return 93 * @hibernate.property 94 * column = "prefix" 95 * length = "10" 96 * update = "true" 97 * not-null = "false" 98 */ 99 public String getPrefix() { 100 return prefix; 101 } 102 103 /*** 104 * @return 105 * @hibernate.property 106 * column = "reg_date" 107 * update = "false" 108 * not-null = "true" 109 */ 110 public Date getRegisteredDate() { 111 return registeredDate; 112 } 113 114 /*** 115 * @return 116 * @hibernate.collection-one-to-many 117 * class = "org.gnomekr.potron.data.Translation" 118 * @hibernate.collection-key 119 * column = "team_id" 120 * @hibernate.set 121 * lazy = "true" 122 * order-by = "trans_id" 123 * cascade = "all-delete-orphan" 124 */ 125 public Set<Translation> getTranslations() { 126 return translations; 127 } 128 129 /*** 130 * @param name 131 */ 132 public void setName(String name) { 133 this.name = name; 134 } 135 136 /*** 137 * @param contact 138 */ 139 public void setContact(String contact) { 140 this.contact = contact; 141 } 142 143 /*** 144 * @param id 145 */ 146 public void setId(long id) { 147 this.id = id; 148 } 149 150 /*** 151 * @param encoding 152 */ 153 public void setEncoding(String encoding) { 154 this.encoding = encoding; 155 } 156 157 /*** 158 * @param registeredDate 159 */ 160 public void setRegisteredDate(Date registeredDate) { 161 this.registeredDate = registeredDate; 162 } 163 164 /*** 165 * @param prefix 166 */ 167 public void setPrefix(String prefix) { 168 this.prefix = prefix; 169 } 170 171 /*** 172 * @param translations 173 */ 174 public void setTranslations(Set<Translation> translations) { 175 this.translations = translations; 176 } 177 178 /*** 179 * @see java.lang.Object#equals(java.lang.Object) 180 */ 181 public boolean equals(final Object object) { 182 if (object instanceof LanguageTeam) { 183 LanguageTeam team = (LanguageTeam) object; 184 185 EqualsBuilder builder = new EqualsBuilder(); 186 builder.append(id, team.getId()); 187 builder.append(name, team.getName()); 188 builder.append(encoding, team.getEncoding()); 189 builder.append(contact, team.getContact()); 190 builder.append(prefix, team.getPrefix()); 191 192 return builder.isEquals(); 193 } 194 195 return false; 196 } 197 198 /*** 199 * @see java.lang.Object#toString() 200 */ 201 public String toString() { 202 ToStringBuilder builder = new ToStringBuilder(this); 203 builder.append("id", id); 204 builder.append("name", name); 205 builder.append("encoding", encoding); 206 207 return builder.toString(); 208 } 209 210 /*** 211 * @see java.lang.Object#hashCode() 212 */ 213 public int hashCode() { 214 HashCodeBuilder builder = new HashCodeBuilder(); 215 builder.append(id); 216 builder.append(name); 217 builder.append(contact); 218 builder.append(prefix); 219 220 return builder.toHashCode(); 221 } 222 }