Package ru.bgcrm.dao

# Class AddressDAO

java.lang.Object
ru.bgcrm.dao.CommonDAO
ru.bgcrm.dao.AddressDAO

public class AddressDAO extends CommonDAO

- ## Nested Class Summary

  ## Nested classes/interfaces inherited from class ru.bgcrm.dao.CommonDAO

  `CommonDAO.ObjectExtractor<T>, CommonDAO.RecordUpdater<T extends Id>`

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `static final int`
  `LOAD_LEVEL_CITY`
  `static final int`
  `LOAD_LEVEL_COUNTRY`
  `static final int`
  `LOAD_LEVEL_HOUSE`
  `static final int`
  `LOAD_LEVEL_STREET`

  ### Fields inherited from class ru.bgcrm.dao.CommonDAO

  `con, log, SQL_AND, SQL_DELETE, SQL_DELETE_FROM, SQL_DESC, SQL_DISTINCT, SQL_FROM, SQL_GROUP_BY, SQL_INNER_JOIN, SQL_INSERT_IGNORE_INTO, SQL_INSERT_INTO, SQL_LEFT_JOIN, SQL_LIMIT, SQL_ON_DUP_KEY_UPDATE, SQL_ORDER_BY, SQL_REPLACE, SQL_SELECT, SQL_SELECT_ALL_FROM, SQL_SELECT_COUNT_ROWS, SQL_SET, SQL_UNION_ALL, SQL_UPDATE, SQL_VALUES, SQL_VALUES_1, SQL_VALUES_2, SQL_VALUES_3, SQL_VALUES_4, SQL_VALUES_5, SQL_WHERE`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `AddressDAO(Connection con)`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `static void`
  `addHouseSelectQueryJoins(StringBuilder query, int loadLevel)`
  `void`
  `deleteAddressArea(int id)`
  `void`
  `deleteAddressCity(int id)`
  `void`
  `deleteAddressCountry(int id)`
  `void`
  `deleteAddressHouse(int id)`
  `void`
  `deleteAddressQuarter(int id)`
  `void`
  `deleteAddressStreet(int id)`
  `AddressItem`
  `getAddressArea(int id, boolean loadCountryData, boolean loadCityData)`
  `List<IdTitle>`
  `getAddressCities(List<Integer> ids)`
  Selects cities restricted and ordered by their IDs
  `AddressCity`
  `getAddressCity(int id, boolean loadCountryData)`
  `static AddressCity`
  `getAddressCityFromRs(ResultSet rs, String prefix)`
  `AddressCountry`
  `getAddressCountry(int id)`
  `static AddressCountry`
  `getAddressCountryFromRs(ResultSet rs, String prefix)`
  `AddressHouse`
  `getAddressHouse(int id, boolean loadCountryData, boolean loadCityData, boolean loadStreetData)`
  `static AddressHouse`
  `getAddressHouseFromRs(ResultSet rs, String prefix, int loadLevel)`
  `static AddressItem`
  `getAddressItemFromRs(ResultSet rs, String prefix)`
  `AddressItem`
  `getAddressQuarter(int id, boolean loadCountryData, boolean loadCityData)`
  `AddressItem`
  `getAddressStreet(int id, boolean loadCountryData, boolean loadCityData)`
  `List<AddressItem>`
  `getAddressStreetsBySubstring(String streetSubstring, List<Integer> cityIds)`
  Поиск улиц по подстроке в заданных городах
  `int`
  `getCityIdByAddress(String address)`
  `List<Integer>`
  `getCountryIdByCityId(int[] citiesId)`
  `List<Integer>`
  `getHouseIdsByStreetAndHouse(int streetId, String house, List<Integer> cityIds)`
  `List<AddressItem>`
  `getUpdatedAreas(long time, int[] citiesId)`
  `List<AddressCity>`
  `getUpdatedCities(long time, int[] citiesId)`
  `List<AddressCountry>`
  `getUpdatedCountries(long time, int[] countriesId)`
  `List<AddressHouse>`
  `getUpdatedHouses(long time, int[] citiesId)`
  `List<AddressItem>`
  `getUpdatedQuarters(long time, int[] citiesId)`
  `List<AddressItem>`
  `getUpdatedStreets(long time, int[] citiesId)`
  `void`
  `searchAddressAreaList(Pageable<AddressItem> searchResult, int cityId)`
  `void`
  `searchAddressAreaList(Pageable<AddressItem> searchResult, int cityId, List<String> title, boolean loadCountryData, boolean loadCityData)`
  `void`
  `searchAddressCityList(Pageable<AddressCity> searchResult, int countryId, String title, boolean loadCountryData, Set<Integer> cityIdFilter)`
  `void`
  `searchAddressCountryList(Pageable<AddressCountry> searchResult, String title)`
  `void`
  `searchAddressHouseList(Pageable<AddressHouse> searchResult, int streetId, String housePrefix)`
  `void`
  `searchAddressHouseList(Pageable<AddressHouse> searchResult, int streetId, String house, boolean absolute, boolean loadCountryData, boolean loadCityData, boolean loadStreetData)`
  `void`
  `searchAddressQuarterList(Pageable<AddressItem> searchResult, int cityId)`
  `void`
  `searchAddressQuarterList(Pageable<AddressItem> searchResult, int cityId, List<String> title, boolean loadCountryData, boolean loadCityData)`
  `void`
  `searchAddressStreetList(Pageable<AddressItem> searchResult, int cityId)`
  `void`
  `searchAddressStreetList(Pageable<AddressItem> searchResult, Set<Integer> cityIds, List<String> title, boolean loadCountryData, boolean loadCityData)`
  `AddressItem`
  `updateAddressArea(AddressItem item)`
  `AddressCity`
  `updateAddressCity(AddressCity city)`
  `AddressCountry`
  `updateAddressCountry(AddressCountry value)`
  `AddressHouse`
  `updateAddressHouse(AddressHouse addressHouse)`
  `AddressItem`
  `updateAddressQuarter(AddressItem addressItem)`
  `AddressItem`
  `updateAddressStreet(AddressItem addressItem)`

  ### Methods inherited from class ru.bgcrm.dao.CommonDAO

  `deleteById, foundRows, getById, getGroupedIds, getGroupedIds, getIds, getIds, getPageLimit, getPeriodSql, lastInsertId, setPeriodParamValue, setRecordCount, update, updateColumn, updateIds, updateIds, updateOrInsert`

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

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

- ## Field Details

  - ### LOAD_LEVEL_HOUSE

    public static final int LOAD_LEVEL_HOUSE
    See Also:
      - Constant Field Values

  - ### LOAD_LEVEL_STREET

    public static final int LOAD_LEVEL_STREET
    See Also:
      - Constant Field Values

  - ### LOAD_LEVEL_CITY

    public static final int LOAD_LEVEL_CITY
    See Also:
      - Constant Field Values

  - ### LOAD_LEVEL_COUNTRY

    public static final int LOAD_LEVEL_COUNTRY
    See Also:
      - Constant Field Values

- ## Constructor Details

  - ### AddressDAO

    public AddressDAO(Connection con)

- ## Method Details

  - ### searchAddressCountryList

    public void searchAddressCountryList(Pageable<AddressCountry> searchResult, String title) throws SQLException
    Throws:
      `SQLException`

  - ### getAddressCountry

    public AddressCountry getAddressCountry(int id) throws SQLException
    Throws:
      `SQLException`

  - ### searchAddressCityList

    public void searchAddressCityList(Pageable<AddressCity> searchResult, int countryId, String title, boolean loadCountryData, Set<Integer> cityIdFilter) throws SQLException
    Throws:
      `SQLException`

  - ### getAddressCity

    public AddressCity getAddressCity(int id, boolean loadCountryData) throws SQLException
    Throws:
      `SQLException`

  - ### getAddressCities

    public List<IdTitle> getAddressCities(List<Integer> ids) throws SQLException
    Selects cities restricted and ordered by their IDs
    Parameters:
      `ids` - the IDs
    Returns:
    Throws:
      `SQLException`

  - ### searchAddressAreaList

    public void searchAddressAreaList(Pageable<AddressItem> searchResult, int cityId) throws SQLException
    Throws:
      `SQLException`

  - ### searchAddressAreaList

    public void searchAddressAreaList(Pageable<AddressItem> searchResult, int cityId, List<String> title, boolean loadCountryData, boolean loadCityData) throws SQLException
    Throws:
      `SQLException`

  - ### getAddressArea

    public AddressItem getAddressArea(int id, boolean loadCountryData, boolean loadCityData) throws SQLException
    Throws:
      `SQLException`

  - ### searchAddressQuarterList

    public void searchAddressQuarterList(Pageable<AddressItem> searchResult, int cityId) throws SQLException
    Throws:
      `SQLException`

  - ### searchAddressQuarterList

    public void searchAddressQuarterList(Pageable<AddressItem> searchResult, int cityId, List<String> title, boolean loadCountryData, boolean loadCityData) throws SQLException
    Throws:
      `SQLException`

  - ### getAddressQuarter

    public AddressItem getAddressQuarter(int id, boolean loadCountryData, boolean loadCityData) throws SQLException
    Throws:
      `SQLException`

  - ### searchAddressStreetList

    public void searchAddressStreetList(Pageable<AddressItem> searchResult, int cityId) throws SQLException
    Throws:
      `SQLException`

  - ### searchAddressStreetList

    public void searchAddressStreetList(Pageable<AddressItem> searchResult, Set<Integer> cityIds, List<String> title, boolean loadCountryData, boolean loadCityData) throws SQLException
    Throws:
      `SQLException`

  - ### getAddressStreet

    public AddressItem getAddressStreet(int id, boolean loadCountryData, boolean loadCityData) throws SQLException
    Throws:
      `SQLException`

  - ### searchAddressHouseList

    public void searchAddressHouseList(Pageable<AddressHouse> searchResult, int streetId, String housePrefix) throws SQLException
    Throws:
      `SQLException`

  - ### searchAddressHouseList

    public void searchAddressHouseList(Pageable<AddressHouse> searchResult, int streetId, String house, boolean absolute, boolean loadCountryData, boolean loadCityData, boolean loadStreetData) throws SQLException
    Throws:
      `SQLException`

  - ### getAddressHouse

    public AddressHouse getAddressHouse(int id, boolean loadCountryData, boolean loadCityData, boolean loadStreetData) throws SQLException
    Throws:
      `SQLException`

  - ### addHouseSelectQueryJoins

    public static void addHouseSelectQueryJoins(StringBuilder query, int loadLevel)

  - ### updateAddressCountry

    public AddressCountry updateAddressCountry(AddressCountry value) throws SQLException
    Throws:
      `SQLException`

  - ### deleteAddressCountry

    public void deleteAddressCountry(int id) throws SQLException, BGMessageException
    Throws:
      `SQLException`
      `BGMessageException`

  - ### updateAddressCity

    public AddressCity updateAddressCity(AddressCity city) throws SQLException
    Throws:
      `SQLException`

  - ### deleteAddressCity

    public void deleteAddressCity(int id) throws SQLException, BGMessageException
    Throws:
      `SQLException`
      `BGMessageException`

  - ### updateAddressArea

    public AddressItem updateAddressArea(AddressItem item) throws SQLException
    Throws:
      `SQLException`

  - ### updateAddressQuarter

    public AddressItem updateAddressQuarter(AddressItem addressItem) throws SQLException
    Throws:
      `SQLException`

  - ### updateAddressStreet

    public AddressItem updateAddressStreet(AddressItem addressItem) throws SQLException
    Throws:
      `SQLException`

  - ### deleteAddressArea

    public void deleteAddressArea(int id) throws SQLException, BGMessageException
    Throws:
      `SQLException`
      `BGMessageException`

  - ### deleteAddressQuarter

    public void deleteAddressQuarter(int id) throws SQLException, BGMessageException
    Throws:
      `SQLException`
      `BGMessageException`

  - ### deleteAddressStreet

    public void deleteAddressStreet(int id) throws SQLException, BGMessageException
    Throws:
      `SQLException`
      `BGMessageException`

  - ### updateAddressHouse

    public AddressHouse updateAddressHouse(AddressHouse addressHouse) throws SQLException
    Throws:
      `SQLException`

  - ### deleteAddressHouse

    public void deleteAddressHouse(int id) throws SQLException, BGMessageException
    Throws:
      `SQLException`
      `BGMessageException`

  - ### getAddressHouseFromRs

    public static AddressHouse getAddressHouseFromRs(ResultSet rs, String prefix, int loadLevel) throws SQLException
    Throws:
      `SQLException`

  - ### getAddressItemFromRs

    public static AddressItem getAddressItemFromRs(ResultSet rs, String prefix) throws SQLException
    Throws:
      `SQLException`

  - ### getAddressCountryFromRs

    public static AddressCountry getAddressCountryFromRs(ResultSet rs, String prefix) throws SQLException
    Throws:
      `SQLException`

  - ### getAddressCityFromRs

    public static AddressCity getAddressCityFromRs(ResultSet rs, String prefix) throws SQLException
    Throws:
      `SQLException`

  - ### getUpdatedCountries

    public List<AddressCountry> getUpdatedCountries(long time, int[] countriesId) throws SQLException
    Throws:
      `SQLException`

  - ### getUpdatedCities

    public List<AddressCity> getUpdatedCities(long time, int[] citiesId) throws SQLException
    Throws:
      `SQLException`

  - ### getUpdatedHouses

    public List<AddressHouse> getUpdatedHouses(long time, int[] citiesId) throws SQLException
    Throws:
      `SQLException`

  - ### getUpdatedAreas

    public List<AddressItem> getUpdatedAreas(long time, int[] citiesId) throws SQLException
    Throws:
      `SQLException`

  - ### getUpdatedQuarters

    public List<AddressItem> getUpdatedQuarters(long time, int[] citiesId) throws SQLException
    Throws:
      `SQLException`

  - ### getUpdatedStreets

    public List<AddressItem> getUpdatedStreets(long time, int[] citiesId) throws SQLException
    Throws:
      `SQLException`

  - ### getCountryIdByCityId

    public List<Integer> getCountryIdByCityId(int[] citiesId) throws SQLException
    Throws:
      `SQLException`

  - ### getAddressStreetsBySubstring

    public List<AddressItem> getAddressStreetsBySubstring(String streetSubstring, List<Integer> cityIds) throws SQLException
    Поиск улиц по подстроке в заданных городах
    Parameters:
      `streetSubstring` - подстрока поиска
      `cityIds` - список id городов, в которых нужно искать если cityIds == null, то поиск по всем городам (город не задан)
    Returns:
    Throws:
      `SQLException`

  - ### getCityIdByAddress

    public int getCityIdByAddress(String address) throws SQLException
    Throws:
      `SQLException`

  - ### getHouseIdsByStreetAndHouse

    public List<Integer> getHouseIdsByStreetAndHouse(int streetId, String house, List<Integer> cityIds) throws SQLException
    Throws:
      `SQLException`