📄 companyvo.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.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.OrderBy;
import javax.persistence.Table;
import org.apache.commons.lang.builder.ToStringBuilder;
import org.hibernate.annotations.Where;
import org.opencustomer.db.vo.UndeletableVO;
@Entity
@Table(name = "company")
@AttributeOverride(name = "id", column = @Column(name = "company_id"))
public class CompanyVO extends UndeletableVO
{
private static final long serialVersionUID = 3906363835614180917L;
private String companyName;
private String url;
private String email;
private String phone;
private String fax;
private String comment;
private String info;
private Integer staffCount;
private Set<PersonVO> persons = new HashSet<PersonVO>();
private LegalFormVO legalForm;
private SectorVO sector;
private CompanyStateVO companyState;
private CompanyTypeVO companyType;
private Set<AddressVO> addresses = new HashSet<AddressVO>();
private Set<ContactVO> contacts = new HashSet<ContactVO>();
@Column(name = "notice")
public String getComment()
{
return comment;
}
public void setComment(String comment)
{
this.comment = comment;
}
@Column(name = "company_name")
public String getCompanyName()
{
return companyName;
}
public void setCompanyName(String companyName)
{
this.companyName = companyName;
}
@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 = "info")
public String getInfo()
{
return info;
}
public void setInfo(String info)
{
this.info = info;
}
@OneToMany(mappedBy = "company")
@Where(clause = "deleted=0")
@OrderBy("lastName, firstName")
public Set<PersonVO> getPersons()
{
return persons;
}
public void setPersons(Set<PersonVO> persons)
{
this.persons = persons;
}
@Column(name = "phone")
public String getPhone()
{
return phone;
}
public void setPhone(String phone)
{
this.phone = phone;
}
@Column(name = "staff_count")
public Integer getStaffCount()
{
return staffCount;
}
public void setStaffCount(Integer staffCount)
{
this.staffCount = staffCount;
}
@Column(name = "url")
public String getUrl()
{
return url;
}
public void setUrl(String url)
{
this.url = url;
}
@ManyToOne
@JoinColumn(name = "legal_form_id")
public LegalFormVO getLegalForm()
{
return legalForm;
}
public void setLegalForm(LegalFormVO legalForm)
{
this.legalForm = legalForm;
}
@ManyToOne
@JoinColumn(name = "company_state_id")
public CompanyStateVO getCompanyState()
{
return companyState;
}
public void setCompanyState(CompanyStateVO companyState)
{
this.companyState = companyState;
}
@ManyToOne
@JoinColumn(name = "company_type_id")
public CompanyTypeVO getCompanyType()
{
return companyType;
}
public void setCompanyType(CompanyTypeVO companyType)
{
this.companyType = companyType;
}
@ManyToOne
@JoinColumn(name = "sector_id")
public SectorVO getSector()
{
return sector;
}
public void setSector(SectorVO sector)
{
this.sector = sector;
}
@OneToMany(mappedBy = "company")
@Where(clause = "deleted=0")
public Set<AddressVO> getAddresses()
{
return addresses;
}
public void setAddresses(Set<AddressVO> addresses)
{
this.addresses = addresses;
}
@OneToMany(mappedBy = "company")
@Where(clause = "deleted=0")
public Set<ContactVO> getContacts()
{
return contacts;
}
public void setContacts(Set<ContactVO> contacts)
{
this.contacts = contacts;
}
protected void toString(ToStringBuilder builder)
{
builder.append("companyName=" + companyName);
builder.append("email=" + email);
builder.append("phone=" + phone);
builder.append("fax=" + fax);
builder.append("comment=" + comment);
builder.append("info=" + info);
builder.append("staffCount=" + staffCount);
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -