📄 contactvo.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.Date;
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.Table;
import org.apache.commons.lang.builder.ToStringBuilder;
import org.opencustomer.db.vo.UndeletableVO;
@Entity
@Table(name = "contact")
@AttributeOverride(name = "id", column = @Column(name = "contact_id"))
public class ContactVO extends UndeletableVO
{
private static final long serialVersionUID = 3834315033474906417L;
public static enum ContactType {
TELEPHONE,
EMAIL,
LETTER,
FAX,
PERSONAL;
}
public static enum BoundType {
IN,
OUT;
}
public static enum ImportType {
NONE,
NEW,
ACCEPTED;
}
public static enum ContentType {
PLAINTEXT,
HTML;
}
private Date contactTimestamp;
private String subject;
private String content;
private String contactName;
private ContactType contactType;
private BoundType boundType;
private CompanyVO company;
private ContentType contentType = ContentType.PLAINTEXT;
private ImportType importType = ImportType.NONE;
private Set<PersonContactVO> personContacts = new HashSet<PersonContactVO>();
@Column(name = "bound_type")
@Enumerated(EnumType.STRING)
public BoundType getBoundType()
{
return boundType;
}
public void setBoundType(BoundType boundType)
{
this.boundType = boundType;
}
@Column(name = "contact_name")
public String getContactName()
{
return contactName;
}
public void setContactName(String contactName)
{
this.contactName = contactName;
}
@Column(name = "contact_timestamp")
public Date getContactTimestamp()
{
return contactTimestamp;
}
public void setContactTimestamp(Date contactTimestamp)
{
this.contactTimestamp = contactTimestamp;
}
@Column(name = "contact_type")
@Enumerated(EnumType.STRING)
public ContactType getContactType()
{
return contactType;
}
public void setContactType(ContactType contactType)
{
this.contactType = contactType;
}
@Column(name = "content")
public String getContent()
{
return content;
}
public void setContent(String content)
{
this.content = content;
}
@Column(name = "subject")
public String getSubject()
{
return subject;
}
public void setSubject(String subject)
{
this.subject = subject;
}
@Column(name = "content_type")
@Enumerated(EnumType.STRING)
public ContentType getContentType()
{
return contentType;
}
public void setContentType(ContentType contentType)
{
this.contentType = contentType;
}
@Column(name = "import_type")
@Enumerated(EnumType.STRING)
public ImportType getImportType()
{
return importType;
}
public void setImportType(ImportType importType)
{
this.importType = importType;
}
@ManyToOne
@JoinColumn(name = "company_id")
public CompanyVO getCompany()
{
return company;
}
public void setCompany(CompanyVO company)
{
this.company = company;
}
@OneToMany(mappedBy = "contact")
public Set<PersonContactVO> getPersonContacts()
{
return personContacts;
}
public void setPersonContacts(Set<PersonContactVO> personContacts)
{
this.personContacts = personContacts;
}
protected void toString(ToStringBuilder builder)
{
builder.append("id", getId());
builder.append("contactTimestamp", contactTimestamp);
builder.append("subject", subject);
builder.append("content", content);
builder.append("contentType", contentType);
builder.append("contactName", contactName);
builder.append("contactType", contactType);
builder.append("boundType", boundType);
builder.append("importType", importType);
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -