Home » apache-openwebbeans-1.0.0-incubating-M3-binary » org.apache.webbeans.reservation » entity » [javadoc | source]

    1   /*
    2    *  Licensed to the Apache Software Foundation (ASF) under one or more
    3    *  contributor license agreements.  See the NOTICE file distributed with
    4    *  this work for additional information regarding copyright ownership.
    5    *  The ASF licenses this file to You under the Apache License, Version 2.0
    6    *  (the "License"); you may not use this file except in compliance with
    7    *  the License.  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   package org.apache.webbeans.reservation.entity;
   18   
   19   import java.util.Date;
   20   
   21   import javax.persistence.Entity;
   22   import javax.persistence.GeneratedValue;
   23   import javax.persistence.Id;
   24   import javax.persistence.ManyToOne;
   25   import javax.persistence.OneToOne;
   26   import javax.persistence.Temporal;
   27   import javax.persistence.TemporalType;
   28   import javax.persistence.Version;
   29   
   30   @Entity
   31   public class Reservation
   32   {
   33       @Id
   34       @GeneratedValue
   35       private int id;
   36       
   37       @ManyToOne
   38       private User user;
   39       
   40       @OneToOne
   41       private Hotel hotel;
   42       
   43       @Temporal(TemporalType.DATE)
   44       private Date reservationDate;
   45       
   46       @Version
   47       private int version;
   48       
   49       public Reservation()
   50       {
   51           
   52       }
   53   
   54       /**
   55        * @return the user
   56        */
   57       public User getUser()
   58       {
   59           return user;
   60       }
   61   
   62       /**
   63        * @param user the user to set
   64        */
   65       public void setUser(User user)
   66       {
   67           this.user = user;
   68       }
   69   
   70       /**
   71        * @return the reservationDate
   72        */
   73       public Date getReservationDate()
   74       {
   75           return reservationDate;
   76       }
   77   
   78       /**
   79        * @param reservationDate the reservationDate to set
   80        */
   81       public void setReservationDate(Date reservationDate)
   82       {
   83           this.reservationDate = reservationDate;
   84       }
   85   
   86       /**
   87        * @return the version
   88        */
   89       public int getVersion()
   90       {
   91           return version;
   92       }
   93   
   94       /**
   95        * @param version the version to set
   96        */
   97       public void setVersion(int version)
   98       {
   99           this.version = version;
  100       }
  101   
  102       /**
  103        * @return the id
  104        */
  105       public int getId()
  106       {
  107           return id;
  108       }
  109   
  110       /**
  111        * @return the hotel
  112        */
  113       public Hotel getHotel()
  114       {
  115           return hotel;
  116       }
  117   
  118       /**
  119        * @param hotel the hotel to set
  120        */
  121       public void setHotel(Hotel hotel)
  122       {
  123           this.hotel = hotel;
  124       }
  125   
  126       
  127   }

Home » apache-openwebbeans-1.0.0-incubating-M3-binary » org.apache.webbeans.reservation » entity » [javadoc | source]