View Javadoc
1   /*
2    * JBoss, Home of Professional Open Source
3    * Copyright 2014, Red Hat, Inc. and/or its affiliates, and individual
4    * contributors by the @authors tag. See the copyright.txt in the
5    * distribution for a full listing of individual contributors.
6    *
7    * Licensed under the Apache License, Version 2.0 (the "License");
8    * you may not use this file except in compliance with the License.
9    * You may obtain a copy of the License at
10   * http://www.apache.org/licenses/LICENSE-2.0
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  package org.jboss.as.quickstarts.kitchensink_ear.model;
18  
19  import java.io.Serializable;
20  
21  import javax.persistence.Column;
22  import javax.persistence.Entity;
23  import javax.persistence.GeneratedValue;
24  import javax.persistence.Id;
25  import javax.persistence.Table;
26  import javax.persistence.UniqueConstraint;
27  import javax.validation.constraints.Digits;
28  import javax.validation.constraints.NotNull;
29  import javax.validation.constraints.Pattern;
30  import javax.validation.constraints.Size;
31  import javax.xml.bind.annotation.XmlRootElement;
32  
33  import org.hibernate.validator.constraints.Email;
34  import org.hibernate.validator.constraints.NotEmpty;
35  
36  @Entity
37  @XmlRootElement
38  @Table(name = "RegistrantMl", uniqueConstraints = @UniqueConstraint(columnNames = "email"))
39  public class Member implements Serializable {
40      /** Default value included to remove warning. Remove or modify at will. **/
41      private static final long serialVersionUID = 1L;
42  
43      @Id
44      @GeneratedValue
45      private Long id;
46  
47      @NotNull
48      @Size(min = 1, max = 25)
49      @Pattern(regexp = "[A-Za-z ]*", message = "{name_validation_message}")
50      private String name;
51  
52      @NotNull
53      @NotEmpty
54      @Email
55      private String email;
56  
57      @NotNull
58      @Size(min = 10, max = 12)
59      @Digits(fraction = 0, integer = 12)
60      @Column(name = "phone_number")
61      private String phoneNumber;
62  
63      public Long getId() {
64          return id;
65      }
66  
67      public void setId(Long id) {
68          this.id = id;
69      }
70  
71      public String getName() {
72          return name;
73      }
74  
75      public void setName(String name) {
76          this.name = name;
77      }
78  
79      public String getEmail() {
80          return email;
81      }
82  
83      public void setEmail(String email) {
84          this.email = email;
85      }
86  
87      public String getPhoneNumber() {
88          return phoneNumber;
89      }
90  
91      public void setPhoneNumber(String phoneNumber) {
92          this.phoneNumber = phoneNumber;
93      }
94  }