Package ejava.examples.txagent.jpa
Class JPABookingDAO
- java.lang.Object
-
- ejava.examples.txagent.jpa.JPABookingDAO
-
- All Implemented Interfaces:
BookingDAO
public class JPABookingDAO extends Object implements BookingDAO
-
-
Field Summary
Fields Modifier and Type Field Description private EntityManagerem(package private) org.slf4j.Loggerlog
-
Constructor Summary
Constructors Constructor Description JPABookingDAO()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description BookingcreateBooking(Booking booking)BookinggetBooking(long id)BookinggetBookingByConfirmation(String confirmation)List<Booking>getBookings(int index, int count)List<Booking>getBookings(String queryName, Map<String,Object> params, int index, int count)BookingremoveBooking(Booking booking)voidsetEntityManager(EntityManager em)BookingupdateBooking(Booking booking)
-
-
-
Field Detail
-
log
org.slf4j.Logger log
-
em
private EntityManager em
-
-
Method Detail
-
setEntityManager
public void setEntityManager(EntityManager em)
-
createBooking
public Booking createBooking(Booking booking) throws DAOException
- Specified by:
createBookingin interfaceBookingDAO- Throws:
DAOException
-
getBooking
public Booking getBooking(long id) throws DAOException
- Specified by:
getBookingin interfaceBookingDAO- Throws:
DAOException
-
getBookings
public List<Booking> getBookings(int index, int count) throws DAOException
- Specified by:
getBookingsin interfaceBookingDAO- Throws:
DAOException
-
getBookings
public List<Booking> getBookings(String queryName, Map<String,Object> params, int index, int count) throws DAOException
- Specified by:
getBookingsin interfaceBookingDAO- Throws:
DAOException
-
removeBooking
public Booking removeBooking(Booking booking) throws DAOException
- Specified by:
removeBookingin interfaceBookingDAO- Throws:
DAOException
-
updateBooking
public Booking updateBooking(Booking booking) throws DAOException
- Specified by:
updateBookingin interfaceBookingDAO- Throws:
DAOException
-
getBookingByConfirmation
public Booking getBookingByConfirmation(String confirmation) throws DAOException
- Specified by:
getBookingByConfirmationin interfaceBookingDAO- Throws:
DAOException
-
-