Modifier and Type | Field and Description |
---|---|
private EntityManager |
em |
Constructor and Description |
---|
JPAHotelDAO() |
Modifier and Type | Method and Description |
---|---|
void |
addFloor(Floor floor) |
void |
addGuest(Guest guest) |
void |
clearAll() |
Floor |
fetchFloor(int level) |
Room |
findRoomByGuest(Guest guest) |
List<Room> |
getAvailableRooms(Integer level,
int offset,
int limit) |
List<Room> |
getAvailableRoomsForUpdate(Integer level,
int offset,
int limit) |
protected TypedQuery<Room> |
getAvailableRoomsQuery(Integer level,
int offset,
int limit) |
Floor |
getFloor(int level) |
List<Floor> |
getFloors(int offset,
int limit) |
Room |
getRoom(int number) |
void |
populate() |
void |
setEntityManager(EntityManager em) |
private <T> TypedQuery<T> |
withPaging(TypedQuery<T> query,
int offset,
int limit) |
private EntityManager em
public void setEntityManager(EntityManager em)
private <T> TypedQuery<T> withPaging(TypedQuery<T> query, int offset, int limit)
public Floor fetchFloor(int level)
fetchFloor
in interface HotelDAO
protected TypedQuery<Room> getAvailableRoomsQuery(Integer level, int offset, int limit)
public List<Room> getAvailableRooms(Integer level, int offset, int limit)
getAvailableRooms
in interface HotelDAO
public List<Room> getAvailableRoomsForUpdate(Integer level, int offset, int limit)
getAvailableRoomsForUpdate
in interface HotelDAO
public Room findRoomByGuest(Guest guest)
findRoomByGuest
in interface HotelDAO
Copyright © 2015 John's Hopkins University, Engineering Programs for Professionals. All rights reserved.