Package com.rosivanyshyn.service.impl

# Class BookingServiceImpl

java.lang.Object
com.rosivanyshyn.service.impl.BookingServiceImpl

All Implemented Interfaces:
  `BookingService`

public class BookingServiceImpl extends Object implements BookingService

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `BookingServiceImpl(BookingDAO bookingDAO, DBManager dbManager)`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `Boolean`
  `createBooking(Booking booking)`
  Create new booking
  `Boolean`
  `deleteBooking(Booking booking)`
  Delete booking
  `ArrayList<Booking>`
  `findFewBookingAndSort(String secondQueryPart, Object... fields)`
  Find few bookings using second query part conditions and by fields for them
  `HashMap<Date,Date>`
  `getBookingsDatesFromDB(Long apartmentIdOfBookingDates)`
  Get all booking dates of related apartment
  `int`
  `getRowsNumber()`
  Get last statement rows count
  `Boolean`
  `updateBooking(Booking booking)`
  Update booking

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Constructor Details

  - ### BookingServiceImpl

    public BookingServiceImpl(BookingDAO bookingDAO, DBManager dbManager)

- ## Method Details

  - ### createBooking

    public Boolean createBooking(Booking booking)
    Description copied from interface: `BookingService`
    Create new booking
    Specified by:
      `createBooking` in interface `BookingService`
    Parameters:
      `booking` - the booking to be added
    Returns:
      operation result

  - ### findFewBookingAndSort

    public ArrayList<Booking> findFewBookingAndSort(String secondQueryPart, Object... fields)
    Description copied from interface: `BookingService`
    Find few bookings using second query part conditions and by fields for them
    Specified by:
      `findFewBookingAndSort` in interface `BookingService`
    Parameters:
      `secondQueryPart` - QueryBuilder result string
      `fields` - fields to insert in second query part statement
    Returns:
      found bookings

  - ### updateBooking

    public Boolean updateBooking(Booking booking)
    Description copied from interface: `BookingService`
    Update booking
    Specified by:
      `updateBooking` in interface `BookingService`
    Parameters:
      `booking` - booking to update
    Returns:
      operation result

  - ### deleteBooking

    public Boolean deleteBooking(Booking booking)
    Description copied from interface: `BookingService`
    Delete booking
    Specified by:
      `deleteBooking` in interface `BookingService`
    Parameters:
      `booking` - booking to delete
    Returns:
      operation result

  - ### getRowsNumber

    public int getRowsNumber()
    Description copied from interface: `BookingService`
    Get last statement rows count
    Specified by:
      `getRowsNumber` in interface `BookingService`
    Returns:
      last statement rows count

  - ### getBookingsDatesFromDB

    public HashMap<Date,Date> getBookingsDatesFromDB(Long apartmentIdOfBookingDates)
    Description copied from interface: `BookingService`
    Get all booking dates of related apartment
    Specified by:
      `getBookingsDatesFromDB` in interface `BookingService`
    Parameters:
      `apartmentIdOfBookingDates` - related apartment id
    Returns:
      HashMap with check-in-date as key and check-out-date as value