Class ApartmentServiceImpl

java.lang.Object
com.rosivanyshyn.service.impl.ApartmentServiceImpl
All Implemented Interfaces:
ApartmentService

public class ApartmentServiceImpl extends Object implements ApartmentService
  • Constructor Details

  • Method Details

    • createApartment

      public Boolean createApartment(Apartment apartment)
      Description copied from interface: ApartmentService
      Create new apartment
      Specified by:
      createApartment in interface ApartmentService
      Parameters:
      apartment - the apartment to be added
      Returns:
      operation result
    • findApartmentByField

      public Apartment findApartmentByField(String field, Object value)
      Description copied from interface: ApartmentService
      Find apartment by field
      Specified by:
      findApartmentByField in interface ApartmentService
      Parameters:
      field - field name
      value - unique field value
      Returns:
      found apartment
    • findFewApartment

      public ArrayList<Apartment> findFewApartment(int start, int total)
      Description copied from interface: ApartmentService
      Find few apartments by total count and from set start id
      Specified by:
      findFewApartment in interface ApartmentService
      Parameters:
      start - countdown start id
      total - total rows count
      Returns:
      found apartments
    • searchApartment

      public ArrayList<Apartment> searchApartment(String value, int start, int total)
      Description copied from interface: ApartmentService
      Find few apartments using direct search algorithm by total count and from set start id
      Specified by:
      searchApartment in interface ApartmentService
      Parameters:
      value - user value
      start - countdown start id
      total - total rows count
      Returns:
      found apartments
    • findFewApartmentsAndSort

      public ArrayList<Apartment> findFewApartmentsAndSort(String secondQueryPart, String... fields)
      Description copied from interface: ApartmentService
      Find few apartments using second query part conditions and by fields for them
      Specified by:
      findFewApartmentsAndSort in interface ApartmentService
      Parameters:
      secondQueryPart - QueryBuilder result string
      fields - fields to insert in second query part statement
      Returns:
      found apartments
    • findFewApartmentsWhichAreBooked

      public ArrayList<Apartment> findFewApartmentsWhichAreBooked(String secondQueryPart, String... fields)
      Description copied from interface: ApartmentService
      Find few apartments which are already booked using second query part conditions and by fields for them
      Specified by:
      findFewApartmentsWhichAreBooked in interface ApartmentService
      Parameters:
      secondQueryPart - QueryBuilder result string
      fields - fields to insert in second query part statement
      Returns:
      found apartments
    • findFewApartmentsWhichAreFree

      public ArrayList<Apartment> findFewApartmentsWhichAreFree(String secondQueryPart, String... fields)
      Description copied from interface: ApartmentService
      Find few apartments which are free (not booked in the future) and available
      Specified by:
      findFewApartmentsWhichAreFree in interface ApartmentService
      Parameters:
      secondQueryPart - QueryBuilder result string
      fields - fields to insert in second query part statement
      Returns:
      found apartments
    • updateApartment

      public Boolean updateApartment(Apartment apartment)
      Description copied from interface: ApartmentService
      Update apartment
      Specified by:
      updateApartment in interface ApartmentService
      Parameters:
      apartment - apartment to update
      Returns:
      operation result
    • deleteApartment

      public Boolean deleteApartment(Apartment apartment)
      Description copied from interface: ApartmentService
      Delete apartment
      Specified by:
      deleteApartment in interface ApartmentService
      Parameters:
      apartment - apartment to delete
      Returns:
      operation result
    • getRowsNumber

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