📄 person.java
字号:
package cn.edu.seu.album.pojo;
import java.io.Serializable;
import java.util.Set;
import org.apache.commons.lang.builder.EqualsBuilder;
import org.apache.commons.lang.builder.HashCodeBuilder;
import org.apache.commons.lang.builder.ToStringBuilder;
/** * @hibernate.class * table="PERSON" * */
public class Person implements Serializable {
/** identifier field */
private String id;
/** persistent field */
private String name;
/** nullable persistent field */
private String sex;
/** nullable persistent field */
private String password;
/** nullable persistent field */
private String description;
/** persistent field */
private Set photos;
/** full constructor */
public Person(String name, String sex, String password, String description, Set photos) {
this.name = name;
this.sex = sex;
this.password = password;
this.description = description;
this.photos = photos;
}
/** default constructor */
public Person() {
}
/** minimal constructor */
public Person(String name, Set photos) {
this.name = name;
this.photos = photos;
}
/** * @hibernate.id * generator-class="uuid.hex" * type="java.lang.String" * column="ID" * */
public String getId() {
return this.id;
}
public void setId(String id) {
this.id = id;
}
/** * @hibernate.property * column="NAME" * length="32" * not-null="true" * */
public String getName() {
return this.name;
}
public void setName(String name) {
this.name = name;
}
/** * @hibernate.property * column="SEX" * length="1" * */
public String getSex() {
return this.sex;
}
public void setSex(String sex) {
this.sex = sex;
}
/** * @hibernate.property * column="PASSWORD" * length="32" * */
public String getPassword() {
return this.password;
}
public void setPassword(String password) {
this.password = password;
}
/** * @hibernate.property * column="DESCRIPTION" * length="1024" * */
public String getDescription() {
return this.description;
}
public void setDescription(String description) {
this.description = description;
}
/** * @hibernate.set * lazy="true" * inverse="true" * cascade="none" * @hibernate.collection-key * column="OWNER" * @hibernate.collection-one-to-many * class="cn.edu.seu.album.pojo.Photo" * */
public Set getPhotos() {
return this.photos;
}
public void setPhotos(Set photos) {
this.photos = photos;
}
public String toString() {
return new ToStringBuilder(this)
.append("id", getId())
.append("name", getName())
.toString();
}
public boolean equals(Object other) {
if ( !(other instanceof Person) ) return false;
Person castOther = (Person) other;
return new EqualsBuilder()
.append(this.getId(), castOther.getId())
.isEquals();
}
public int hashCode() {
return new HashCodeBuilder()
.append(getId())
.toHashCode();
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -