Save This Page
Home » tapestry-src-5.0.19 » org.apache.tapestry5.tutorial.entities » [javadoc | source]
    1   // Copyright 2007, 2008 The Apache Software Foundation
    2   //
    3   // Licensed under the Apache License, Version 2.0 (the "License");
    4   // you may not use this file except in compliance with the License.
    5   // You may obtain a copy of the License at
    6   //
    7   //     http://www.apache.org/licenses/LICENSE-2.0
    8   //
    9   // Unless required by applicable law or agreed to in writing, software
   10   // distributed under the License is distributed on an "AS IS" BASIS,
   11   // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   12   // See the License for the specific language governing permissions and
   13   // limitations under the License.
   14   
   15   package org.apache.tapestry5.tutorial.entities;
   16   
   17   import org.apache.tapestry5.beaneditor.NonVisual;
   18   import org.apache.tapestry5.beaneditor.Validate;
   19   import org.apache.tapestry5.tutorial.data.Honorific;
   20   
   21   import javax.persistence.Entity;
   22   import javax.persistence.GeneratedValue;
   23   import javax.persistence.GenerationType;
   24   import javax.persistence.Id;
   25   
   26   @Entity
   27   public class Address
   28   {
   29       @Id
   30       @GeneratedValue(strategy = GenerationType.IDENTITY)
   31       @NonVisual
   32       private Long id;
   33   
   34       private Honorific honorific;
   35   
   36       @Validate("required")
   37       private String firstName;
   38   
   39       @Validate("required")
   40       private String lastName;
   41   
   42       private String street1;
   43   
   44       private String street2;
   45   
   46       @Validate("required")
   47       private String city;
   48   
   49       @Validate("required")
   50       private String state;
   51   
   52       @Validate("required,regexp")
   53       private String zip;
   54   
   55       private String email;
   56   
   57       private String phone;
   58   
   59       public Long getId()
   60       {
   61           return id;
   62       }
   63   
   64       public void setId(Long id)
   65       {
   66           this.id = id;
   67       }
   68   
   69       public Honorific getHonorific()
   70       {
   71           return honorific;
   72       }
   73   
   74       public String getFirstName()
   75       {
   76           return firstName;
   77       }
   78   
   79       public String getLastName()
   80       {
   81           return lastName;
   82       }
   83   
   84       public String getStreet1()
   85       {
   86           return street1;
   87       }
   88   
   89       public String getStreet2()
   90       {
   91           return street2;
   92       }
   93   
   94       public String getCity()
   95       {
   96           return city;
   97       }
   98   
   99       public String getState()
  100       {
  101           return state;
  102       }
  103   
  104       public String getZip()
  105       {
  106           return zip;
  107       }
  108   
  109       public String getEmail()
  110       {
  111           return email;
  112       }
  113   
  114       public String getPhone()
  115       {
  116           return phone;
  117       }
  118   
  119       public void setCity(String city)
  120       {
  121           this.city = city;
  122       }
  123   
  124       public void setEmail(String email)
  125       {
  126           this.email = email;
  127       }
  128   
  129       public void setFirstName(String firstName)
  130       {
  131           this.firstName = firstName;
  132       }
  133   
  134       public void setHonorific(Honorific honorific)
  135       {
  136           this.honorific = honorific;
  137       }
  138   
  139       public void setLastName(String lastName)
  140       {
  141           this.lastName = lastName;
  142       }
  143   
  144       public void setPhone(String phone)
  145       {
  146           this.phone = phone;
  147       }
  148   
  149       public void setState(String state)
  150       {
  151           this.state = state;
  152       }
  153   
  154       public void setStreet1(String street1)
  155       {
  156           this.street1 = street1;
  157       }
  158   
  159       public void setStreet2(String street2)
  160       {
  161           this.street2 = street2;
  162       }
  163   
  164       public void setZip(String zip)
  165       {
  166           this.zip = zip;
  167       }
  168   }

Save This Page
Home » tapestry-src-5.0.19 » org.apache.tapestry5.tutorial.entities » [javadoc | source]