Package ejava.examples.txhotel.jpa
Class JPAReservationDAO
- java.lang.Object
-
- ejava.examples.txhotel.jpa.JPAReservationDAO
-
- All Implemented Interfaces:
ReservationDAO
public class JPAReservationDAO extends Object implements ReservationDAO
-
-
Field Summary
Fields Modifier and Type Field Description private EntityManager
em
private static org.slf4j.Logger
log
-
Constructor Summary
Constructors Constructor Description JPAReservationDAO()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Reservation
createReservation(Reservation reservation)
Reservation
getReservation(long id)
Reservation
getReservationByConfirmation(String confirmation)
List<Reservation>
getReservations(int index, int count)
List<Reservation>
getReservations(String queryName, Map<String,Object> params, int index, int count)
Reservation
removeReservation(Reservation reservation)
void
setEntityManager(EntityManager em)
Reservation
updateReservation(Reservation reservation)
-
-
-
Field Detail
-
log
private static final org.slf4j.Logger log
-
em
private EntityManager em
-
-
Method Detail
-
setEntityManager
public void setEntityManager(EntityManager em)
-
createReservation
public Reservation createReservation(Reservation reservation) throws DAOException
- Specified by:
createReservation
in interfaceReservationDAO
- Throws:
DAOException
-
getReservation
public Reservation getReservation(long id) throws DAOException
- Specified by:
getReservation
in interfaceReservationDAO
- Throws:
DAOException
-
getReservations
public List<Reservation> getReservations(int index, int count) throws DAOException
- Specified by:
getReservations
in interfaceReservationDAO
- Throws:
DAOException
-
getReservations
public List<Reservation> getReservations(String queryName, Map<String,Object> params, int index, int count) throws DAOException
- Specified by:
getReservations
in interfaceReservationDAO
- Throws:
DAOException
-
removeReservation
public Reservation removeReservation(Reservation reservation) throws DAOException
- Specified by:
removeReservation
in interfaceReservationDAO
- Throws:
DAOException
-
updateReservation
public Reservation updateReservation(Reservation reservation) throws DAOException
- Specified by:
updateReservation
in interfaceReservationDAO
- Throws:
DAOException
-
getReservationByConfirmation
public Reservation getReservationByConfirmation(String confirmation) throws DAOException
- Specified by:
getReservationByConfirmation
in interfaceReservationDAO
- Throws:
DAOException
-
-