content: package org.agoncal.book.javaee7.chapter06.ex39;
  
  import javax.persistence.*;
  import java.util.Date;
  
  /**
   * @author Antonio Goncalves
   *         APress Book - Beginning Java EE 6 with Glassfish 3
   *         http://www.apress.com/
   *         http://www.antoniogoncalves.org
   *         --
   *         Simple entity
   */
  @EntityListeners({DataValidationListener.class, AgeCalculationListener.class})
  @Entity
  @Table(name = "ex02_customer")
  public class Customer39 {
  
      // ======================================
      // =             Attributes             =
      // ======================================
      @Id
      @GeneratedValue
      private Long id;
      private String firstName;
      private String lastName;
      private String email;
      private String phoneNumber;
      @Temporal(TemporalType.DATE)
      private Date dateOfBirth;
      @Transient
      private Integer age;
      @Temporal(TemporalType.TIMESTAMP)
      private Date creationDate;
  
  // ======================================
  // =            Constructors            =
  // ======================================
  
      public Customer39() {
      }
  
      public Customer39(String firstName, String lastName, String email, String phoneNumber, Date dateOfBirth, Date creationDate) {
          this.firstName = firstName;
          this.lastName = lastName;
          this.email = email;
          this.phoneNumber = phoneNumber;
          this.dateOfBirth = dateOfBirth;
          this.creationDate = creationDate;
      }
  
      // ======================================
      // =          Getters & Setters         =
      // ======================================
  
      public Long getId() {
          return id;
      }
  
      public String getFirstName() {
          return firstName;
      }
  
      public void setFirstName(String firstName) {
          this.firstName = firstName;
      }
  
      public String getLastName() {
          return lastName;
      }
  
      public void setLastName(String lastName) {
          this.lastName = lastName;
      }
  
      public String getEmail() {
          return email;
      }
  
      public void setEmail(String email) {
          this.email = email;
      }
  
      public String getPhoneNumber() {
          return phoneNumber;
      }
  
      public void setPhoneNumber(String phoneNumber) {
          this.phoneNumber = phoneNumber;
      }
  
      public Date getDateOfBirth() {
          return dateOfBirth;
      }
  
      public void setDateOfBirth(Date dateOfBirth) {
          this.dateOfBirth = dateOfBirth;
      }
  
      public Integer getAge() {
          return age;
      }
  
      public void setAge(Integer age) {
          this.age = age;
      }
  
      public Date getCreationDate() {
          return creationDate;
      }
  
      public void setCreationDate(Date creationDate) {
          this.creationDate = creationDate;
      }
  
  }