| // Copyright 2007, 2008 The Apache Software Foundation |
| // |
| // Licensed under the Apache License, Version 2.0 (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.apache.org/licenses/LICENSE-2.0 |
| // |
| // Unless required by applicable law or agreed to in writing, software |
| // distributed under the License is distributed on an "AS IS" BASIS, |
| // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| // See the License for the specific language governing permissions and |
| // limitations under the License. |
| |
| package org.apache.tapestry.tutorial.entities; |
| |
| import org.apache.tapestry.beaneditor.NonVisual; |
| import org.apache.tapestry.beaneditor.Validate; |
| import org.apache.tapestry.tutorial.data.Honorific; |
| |
| import javax.persistence.Entity; |
| import javax.persistence.GeneratedValue; |
| import javax.persistence.GenerationType; |
| import javax.persistence.Id; |
| |
| @Entity |
| public class Address |
| { |
| @Id |
| @GeneratedValue(strategy = GenerationType.IDENTITY) |
| private Long id; |
| |
| private Honorific honorific; |
| |
| private String firstName; |
| |
| private String lastName; |
| |
| private String street1; |
| |
| private String street2; |
| |
| private String city; |
| |
| private String state; |
| |
| private String zip; |
| |
| private String email; |
| |
| private String phone; |
| |
| @NonVisual |
| public Long getId() |
| { |
| return id; |
| } |
| |
| public void setId(Long id) |
| { |
| this.id = id; |
| } |
| |
| public Honorific getHonorific() |
| { |
| return honorific; |
| } |
| |
| @Validate("required") |
| public String getFirstName() |
| { |
| return firstName; |
| } |
| |
| public String getLastName() |
| { |
| return lastName; |
| } |
| |
| @Validate("required") |
| public String getStreet1() |
| { |
| return street1; |
| } |
| |
| public String getStreet2() |
| { |
| return street2; |
| } |
| |
| @Validate("required") |
| public String getCity() |
| { |
| return city; |
| } |
| |
| @Validate("required") |
| public String getState() |
| { |
| return state; |
| } |
| |
| @Validate("required,regexp") |
| public String getZip() |
| { |
| return zip; |
| } |
| |
| public String getEmail() |
| { |
| return email; |
| } |
| |
| public String getPhone() |
| { |
| return phone; |
| } |
| |
| public void setCity(String city) |
| { |
| this.city = city; |
| } |
| |
| public void setEmail(String email) |
| { |
| this.email = email; |
| } |
| |
| public void setFirstName(String firstName) |
| { |
| this.firstName = firstName; |
| } |
| |
| public void setHonorific(Honorific honorific) |
| { |
| this.honorific = honorific; |
| } |
| |
| public void setLastName(String lastName) |
| { |
| this.lastName = lastName; |
| } |
| |
| public void setPhone(String phone) |
| { |
| this.phone = phone; |
| } |
| |
| public void setState(String state) |
| { |
| this.state = state; |
| } |
| |
| public void setStreet1(String street1) |
| { |
| this.street1 = street1; |
| } |
| |
| public void setStreet2(String street2) |
| { |
| this.street2 = street2; |
| } |
| |
| public void setZip(String zip) |
| { |
| this.zip = zip; |
| } |
| } |