📄 personvo.java
字号:
/*******************************************************************************
* ***** BEGIN LICENSE BLOCK Version: MPL 1.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with the
* License. You may obtain a copy of the License at http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for
* the specific language governing rights and limitations under the License.
*
* The Original Code is the OpenCustomer CRM.
*
* The Initial Developer of the Original Code is Thomas Bader (Bader & Jene
* Software-Ingenieurb黵o). Portions created by the Initial Developer are
* Copyright (C) 2005 the Initial Developer. All Rights Reserved.
*
* Contributor(s): Thomas Bader <thomas.bader@bader-jene.de>
*
* ***** END LICENSE BLOCK *****
*/
package org.opencustomer.application.db.vo.crm;
import java.util.HashSet;
import java.util.Set;
import javax.persistence.AttributeOverride;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.EnumType;
import javax.persistence.Enumerated;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.OneToOne;
import javax.persistence.Table;
import org.apache.commons.lang.builder.ToStringBuilder;
import org.opencustomer.application.db.vo.system.UserVO;
import org.opencustomer.db.vo.UndeletableVO;
@Entity
@Table(name = "person")
@AttributeOverride(name = "id", column = @Column(name = "person_id"))
public class PersonVO extends UndeletableVO
{
private static final long serialVersionUID = 3257570615761449780L;
public static enum Gender {
UNKNOWN,
MALE,
FEMALE;
}
private String firstName;
private String lastName;
private Gender gender;
private String email;
private String phone;
private String mobile;
private String fax;
private String comment;
private String function;
private String degree;
private String nameAffix;
private String title;
private UserVO user;
private CompanyVO company;
private Set<AddressVO> addresses = new HashSet<AddressVO>();
private Set<PersonContactVO> personContacts = new HashSet<PersonContactVO>();
@Column(name = "notice")
public String getComment()
{
return comment;
}
public void setComment(String comment)
{
this.comment = comment;
}
@Column(name = "degree")
public String getDegree()
{
return degree;
}
public void setDegree(String degree)
{
this.degree = degree;
}
@Column(name = "email")
public String getEmail()
{
return email;
}
public void setEmail(String email)
{
this.email = email;
}
@Column(name = "fax")
public String getFax()
{
return fax;
}
public void setFax(String fax)
{
this.fax = fax;
}
@Column(name = "first_name")
public String getFirstName()
{
return firstName;
}
public void setFirstName(String firstName)
{
this.firstName = firstName;
}
@Column(name = "role")
public String getFunction()
{
return function;
}
public void setFunction(String function)
{
this.function = function;
}
@Column(name = "gender")
@Enumerated(EnumType.STRING)
public Gender getGender()
{
return gender;
}
public void setGender(Gender gender)
{
this.gender = gender;
}
@Column(name = "last_name")
public String getLastName()
{
return lastName;
}
public void setLastName(String lastName)
{
this.lastName = lastName;
}
@Column(name = "mobile")
public String getMobile()
{
return mobile;
}
public void setMobile(String mobile)
{
this.mobile = mobile;
}
@Column(name = "name_affix")
public String getNameAffix()
{
return nameAffix;
}
public void setNameAffix(String nameAffix)
{
this.nameAffix = nameAffix;
}
@Column(name = "phone")
public String getPhone()
{
return phone;
}
public void setPhone(String phone)
{
this.phone = phone;
}
@Column(name = "title")
public String getTitle()
{
return title;
}
public void setTitle(String title)
{
this.title = title;
}
@OneToOne(mappedBy = "person")
public UserVO getUser()
{
return user;
}
public void setUser(UserVO user)
{
this.user = user;
}
@ManyToOne
@JoinColumn(name = "company_id")
public CompanyVO getCompany()
{
return company;
}
public void setCompany(CompanyVO company)
{
this.company = company;
}
@OneToMany(mappedBy = "person")
public Set<AddressVO> getAddresses()
{
return addresses;
}
public void setAddresses(Set<AddressVO> addresses)
{
this.addresses = addresses;
}
@OneToMany(mappedBy = "person")
public Set<PersonContactVO> getPersonContacts()
{
return personContacts;
}
public void setPersonContacts(Set<PersonContactVO> personContacts)
{
this.personContacts = personContacts;
}
protected void toString(ToStringBuilder builder)
{
builder.append("lastName=" + lastName);
builder.append("firstName=" + firstName);
builder.append("gender=" + gender);
builder.append("email=" + email);
builder.append("phone=" + phone);
builder.append("mobile=" + mobile);
builder.append("fax=" + fax);
builder.append("comment=" + comment);
builder.append("function=" + function);
builder.append("degree=" + degree);
builder.append("nameAffix=" + nameAffix);
builder.append("title=" + title);
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -