|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.springframework.webflow.samples.booking.JpaTravelService
@Service(value="travelService") @Repository public class JpaTravelService
A JPA-based implementation of the Booking Service. Delegates to a JPA entity manager to issue data access calls against the backing repository. The EntityManager reference is provided by the managing container (Spring) automatically.
| Constructor Summary | |
|---|---|
JpaTravelService()
|
|
| Method Summary | |
|---|---|
Hotel |
addHotel(Hotel hotel)
|
Preference |
addPreference(String userName,
Preference preference)
Create a new user preference |
void |
cancelBooking(Long id)
Cancel an existing booking. |
Booking |
createBooking(Long hotelId,
String username)
Create a new, transient hotel booking instance for the given user. |
void |
deletePreference(Long id)
|
List<Booking> |
findBookings(String username)
Find bookings made by the given user |
Hotel |
findHotelById(Long id)
Find hotels by their identifier. |
List<Hotel> |
findHotels(SearchCriteria criteria)
Find hotels available for booking by some criteria. |
Preference |
findPreferenceById(Long id)
|
List<Preference> |
findPreferences(String username)
|
void |
savePreference(Preference preference)
|
void |
setEntityManager(javax.persistence.EntityManager em)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public JpaTravelService()
| Method Detail |
|---|
public void setEntityManager(javax.persistence.EntityManager em)
@Transactional(readOnly=true) public List<Booking> findBookings(String username)
TravelService
findBookings in interface TravelServiceusername - the user's name
@Transactional(readOnly=true) public List<Hotel> findHotels(SearchCriteria criteria)
TravelService
findHotels in interface TravelServicecriteria - the search criteria
@Transactional(readOnly=true) public Hotel findHotelById(Long id)
TravelService
findHotelById in interface TravelServiceid - the hotel id
@Transactional(readOnly=true)
public Booking createBooking(Long hotelId,
String username)
TravelService
createBooking in interface TravelServicehotelId - the hotelIdusername - the user name
@Transactional public void cancelBooking(Long id)
TravelService
cancelBooking in interface TravelServiceid - the booking id
@Transactional
public Preference addPreference(String userName,
Preference preference)
TravelService
addPreference in interface TravelServicepreference - TODO
@Transactional public void deletePreference(Long id)
deletePreference in interface TravelService@Transactional(readOnly=true) public List<Preference> findPreferences(String username)
findPreferences in interface TravelService@Transactional public Preference findPreferenceById(Long id)
findPreferenceById in interface TravelService@Transactional public void savePreference(Preference preference)
savePreference in interface TravelService@Transactional public Hotel addHotel(Hotel hotel)
addHotel in interface TravelService
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||