View Javadoc
1   package org.apache.juddi.model;
2   /*
3    * Copyright 2001-2008 The Apache Software Foundation.
4    * 
5    * Licensed under the Apache License, Version 2.0 (the "License");
6    * you may not use this file except in compliance with the License.
7    * You may obtain a copy of the License at
8    * 
9    *      http://www.apache.org/licenses/LICENSE-2.0
10   * 
11   * Unless required by applicable law or agreed to in writing, software
12   * distributed under the License is distributed on an "AS IS" BASIS,
13   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14   * See the License for the specific language governing permissions and
15   * limitations under the License.
16   */
17  
18  import javax.persistence.Column;
19  import javax.persistence.Entity;
20  import javax.persistence.FetchType;
21  import javax.persistence.GeneratedValue;
22  import javax.persistence.GenerationType;
23  import javax.persistence.Id;
24  import javax.persistence.JoinColumn;
25  import javax.persistence.Lob;
26  import javax.persistence.ManyToOne;
27  import javax.persistence.Table;
28  
29  /**
30   * @author <a href="mailto:kurt@apache.org">Kurt T Stam</a>
31   * @author <a href="mailto:jfaath@apache.org">Jeff Faath</a>
32   */
33  @Entity
34  @Table(name = "j3_email")
35  public class Email implements java.io.Serializable {
36  
37  	private static final long serialVersionUID = 6699730616675634879L;
38  	private Long id;
39  	private Contact contact;
40  	private String useType;
41  	private String emailAddress;
42  
43  	public Email() {
44  	}
45  
46  	public Email(Contact contact, String emailAddress) {
47  		this.contact = contact;
48  		this.emailAddress = emailAddress;
49  	}
50  	public Email(Contact contact, String useType,
51  			String emailAddress) {
52  		this.contact = contact;
53  		this.useType = useType;
54  		this.emailAddress = emailAddress;
55  	}
56  
57  	@Id
58  	@GeneratedValue(strategy=GenerationType.AUTO)
59  	public Long getId() {
60  		return this.id;
61  	}
62  	public void setId(Long id) {
63  		this.id = id;
64  	}
65  
66  	@ManyToOne(fetch = FetchType.LAZY)
67  	@JoinColumn(name = "contact_id", nullable = false)
68  	public Contact getContact() {
69  		return this.contact;
70  	}
71  	public void setContact(Contact contact) {
72  		this.contact = contact;
73  	}
74  
75  	@Column(name = "use_type", length=255)
76  	public String getUseType() {
77  		return this.useType;
78  	}
79  	public void setUseType(String useType) {
80  		this.useType = useType;
81  	}
82  
83          @Lob
84  	@Column(name = "email_address", nullable = false, length=4096)
85  	public String getEmailAddress() {
86  		return this.emailAddress;
87  	}
88  	public void setEmailAddress(String emailAddress) {
89  		this.emailAddress = emailAddress;
90  	}
91  
92  }