Package org.sample.booking.models

Examples of org.sample.booking.models.Booking


  @View
  @Route("/hotels/{id}/booking")
  public Response.Content book(String id, @Mapped Booking booking) {
    Hotel hotel = Hotel.findById(id);
    if (booking == null) {
      booking = new Booking();
    }
    return book.with().hotel(hotel).booking(booking).ok();
  }
View Full Code Here


  }

  @Action
  @Route("/bookings/{id}")
  public Response cancelBooking(String id) {
    Booking booking = Booking.find(id);
    booking.delete();
    flash.setSuccess("Booking cancelled for confirmation number " + id);
    return Application_.index();
  }
View Full Code Here

      if (response instanceof ValidationError) {
        ValidationError error = (ValidationError)response;
        String id = context.getParameters().get("id").getValue();
       
        Iterator<ConstraintViolation<Object>> v = error.getViolations().iterator();
        Booking booking = (Booking)error.getViolations().iterator().next().getLeafBean();
        while (v.hasNext()) {
          ConstraintViolation<Object> c = v.next();
          Iterator<javax.validation.Path.Node> nodeIter = c.getPropertyPath().iterator();
          javax.validation.Path.Node node = null;
          while (nodeIter.hasNext()) {
View Full Code Here

TOP

Related Classes of org.sample.booking.models.Booking

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.