public class AddressDAO extends CommonDAO
Modifier and Type | Field and Description |
---|---|
static int |
LOAD_LEVEL_CITY |
static int |
LOAD_LEVEL_COUNTRY |
static int |
LOAD_LEVEL_HOUSE |
static int |
LOAD_LEVEL_STREET |
con, dateFormat_DDMMYYYY, dateFormat_DDMMYYYY_HHMM, log, SQL_AND, SQL_DELETE, SQL_DESC, SQL_FROM, SQL_GROUP_BY, SQL_INNER_JOIN, SQL_INSERT, SQL_LEFT_JOIN, SQL_LIMIT, SQL_ORDER_BY, SQL_REPLACE, SQL_SELECT, SQL_SELECT_ALL_FROM, SQL_SELECT_COUNT_ROWS, SQL_SET, SQL_UPDATE, SQL_WHERE
Constructor and Description |
---|
AddressDAO(java.sql.Connection con) |
Modifier and Type | Method and Description |
---|---|
static void |
addHouseSelectQueryJoins(java.lang.StringBuilder query,
int loadLevel) |
java.sql.PreparedStatement |
checkItem(int id,
java.lang.String table,
java.lang.String title) |
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) |
AddressCity |
getAddressCity(int id,
boolean loadCountryData) |
static AddressCity |
getAddressCityFromRs(java.sql.ResultSet rs,
java.lang.String prefix) |
AddressCountry |
getAddressCountry(int id) |
static AddressCountry |
getAddressCountryFromRs(java.sql.ResultSet rs,
java.lang.String prefix) |
AddressHouse |
getAddressHouse(int id,
boolean loadCountryData,
boolean loadCityData,
boolean loadStreetData) |
static AddressHouse |
getAddressHouseFromRs(java.sql.ResultSet rs,
java.lang.String prefix,
int loadLevel) |
static AddressItem |
getAddressItemFromRs(java.sql.ResultSet rs,
java.lang.String prefix) |
AddressItem |
getAddressQuarter(int id,
boolean loadCountryData,
boolean loadCityData) |
AddressItem |
getAddressStreet(int id,
boolean loadCountryData,
boolean loadCityData) |
java.util.List<AddressItem> |
getAddressStreetsBySubstring(java.lang.String streetSubstring,
java.util.List<java.lang.Integer> cityIds)
Поиск улиц по подстроке в заданных городах
|
java.lang.Integer |
getCityIdByAddress(java.lang.String address) |
java.util.List<java.lang.Integer> |
getCountryIdByCityId(int[] citiesId) |
java.util.List<java.lang.Integer> |
getHouseIdsByStreetAndHouse(int streetId,
java.lang.String house,
java.util.List<java.lang.Integer> cityIds) |
java.util.List<AddressItem> |
getUpdatedAreas(long time,
int[] citiesId) |
java.util.List<AddressCity> |
getUpdatedCities(long time,
int[] citiesId) |
java.util.List<AddressCountry> |
getUpdatedCountries(long time,
int[] countriesId) |
java.util.List<AddressHouse> |
getUpdatedHouses(long time,
int[] citiesId) |
java.util.List<AddressItem> |
getUpdatedQuarters(long time,
int[] citiesId) |
java.util.List<AddressItem> |
getUpdatedStreets(long time,
int[] citiesId) |
void |
searchAddressAreaList(SearchResult<AddressItem> searchResult,
int cityId) |
void |
searchAddressAreaList(SearchResult<AddressItem> searchResult,
int cityId,
java.lang.String title,
boolean loadCountryData,
boolean loadCityData) |
void |
searchAddressCityList(SearchResult<AddressCity> searchResult,
int countryId,
java.lang.String title,
boolean loadCountryData,
java.util.Set<java.lang.Integer> cityIdFilter) |
void |
searchAddressCountryList(SearchResult<AddressCountry> searchResult,
java.lang.String title) |
void |
searchAddressHouseList(SearchResult<AddressHouse> searchResult,
int streetId,
java.lang.String housePrefix) |
void |
searchAddressHouseList(SearchResult<AddressHouse> searchResult,
int streetId,
java.lang.String house,
boolean absolute,
boolean loadCountryData,
boolean loadCityData,
boolean loadStreetData) |
void |
searchAddressQuarterList(SearchResult<AddressItem> searchResult,
int cityId) |
void |
searchAddressQuarterList(SearchResult<AddressItem> searchResult,
int cityId,
java.lang.String title,
boolean loadCountryData,
boolean loadCityData) |
void |
searchAddressStreetList(SearchResult<AddressItem> searchResult,
int cityId) |
void |
searchAddressStreetList(SearchResult<AddressItem> searchResult,
java.util.Set<java.lang.Integer> cityIds,
java.lang.String title,
boolean loadCountryData,
boolean loadCityData) |
void |
updateAddressArea(AddressItem addressItem) |
void |
updateAddressCity(AddressCity addressCity) |
void |
updateAddressCountry(AddressCountry addressCountry) |
void |
updateAddressHouse(AddressHouse addressHouse) |
void |
updateAddressQuarter(AddressItem addressItem) |
void |
updateAddressStreet(AddressItem addressItem) |
addLikeSql, convertDateToSqlDate, convertDateToTimestamp, deleteById, getFoundRows, getGroupedIds, getGroupedIds, getIds, getIds, getLikePattern, getMySQLLimit, getPeriodSql, lastInsertId, setPeriodParamValue, setRecordCount, sqlToBgException, updateColumn, updateIds, updateIds
public static final int LOAD_LEVEL_HOUSE
public static final int LOAD_LEVEL_STREET
public static final int LOAD_LEVEL_CITY
public static final int LOAD_LEVEL_COUNTRY
public void searchAddressCountryList(SearchResult<AddressCountry> searchResult, java.lang.String title) throws java.sql.SQLException
java.sql.SQLException
public AddressCountry getAddressCountry(int id) throws java.sql.SQLException
java.sql.SQLException
public void searchAddressCityList(SearchResult<AddressCity> searchResult, int countryId, java.lang.String title, boolean loadCountryData, java.util.Set<java.lang.Integer> cityIdFilter) throws java.sql.SQLException
java.sql.SQLException
public AddressCity getAddressCity(int id, boolean loadCountryData) throws java.sql.SQLException
java.sql.SQLException
public void searchAddressAreaList(SearchResult<AddressItem> searchResult, int cityId) throws java.sql.SQLException
java.sql.SQLException
public void searchAddressAreaList(SearchResult<AddressItem> searchResult, int cityId, java.lang.String title, boolean loadCountryData, boolean loadCityData) throws java.sql.SQLException
java.sql.SQLException
public AddressItem getAddressArea(int id, boolean loadCountryData, boolean loadCityData) throws java.sql.SQLException
java.sql.SQLException
public void searchAddressQuarterList(SearchResult<AddressItem> searchResult, int cityId) throws java.sql.SQLException
java.sql.SQLException
public void searchAddressQuarterList(SearchResult<AddressItem> searchResult, int cityId, java.lang.String title, boolean loadCountryData, boolean loadCityData) throws java.sql.SQLException
java.sql.SQLException
public AddressItem getAddressQuarter(int id, boolean loadCountryData, boolean loadCityData) throws java.sql.SQLException
java.sql.SQLException
public void searchAddressStreetList(SearchResult<AddressItem> searchResult, int cityId) throws java.sql.SQLException
java.sql.SQLException
public void searchAddressStreetList(SearchResult<AddressItem> searchResult, java.util.Set<java.lang.Integer> cityIds, java.lang.String title, boolean loadCountryData, boolean loadCityData) throws java.sql.SQLException
java.sql.SQLException
public AddressItem getAddressStreet(int id, boolean loadCountryData, boolean loadCityData) throws java.sql.SQLException
java.sql.SQLException
public void searchAddressHouseList(SearchResult<AddressHouse> searchResult, int streetId, java.lang.String housePrefix) throws java.sql.SQLException
java.sql.SQLException
public void searchAddressHouseList(SearchResult<AddressHouse> searchResult, int streetId, java.lang.String house, boolean absolute, boolean loadCountryData, boolean loadCityData, boolean loadStreetData) throws java.sql.SQLException
java.sql.SQLException
public AddressHouse getAddressHouse(int id, boolean loadCountryData, boolean loadCityData, boolean loadStreetData) throws BGException
BGException
public static void addHouseSelectQueryJoins(java.lang.StringBuilder query, int loadLevel)
public void updateAddressCountry(AddressCountry addressCountry) throws BGException
BGException
public void deleteAddressCountry(int id) throws BGException
BGException
public void updateAddressCity(AddressCity addressCity) throws BGException
BGException
public void deleteAddressCity(int id) throws BGException
BGException
public java.sql.PreparedStatement checkItem(int id, java.lang.String table, java.lang.String title) throws java.sql.SQLException, BGMessageException
java.sql.SQLException
BGMessageException
public void updateAddressArea(AddressItem addressItem) throws BGException
BGException
public void updateAddressQuarter(AddressItem addressItem) throws BGException
BGException
public void updateAddressStreet(AddressItem addressItem) throws BGException
BGException
public void deleteAddressArea(int id) throws BGException
BGException
public void deleteAddressQuarter(int id) throws BGException
BGException
public void deleteAddressStreet(int id) throws BGException
BGException
public void updateAddressHouse(AddressHouse addressHouse) throws java.sql.SQLException
java.sql.SQLException
public void deleteAddressHouse(int id) throws BGException
BGException
public static AddressHouse getAddressHouseFromRs(java.sql.ResultSet rs, java.lang.String prefix, int loadLevel) throws java.sql.SQLException
java.sql.SQLException
public static AddressItem getAddressItemFromRs(java.sql.ResultSet rs, java.lang.String prefix) throws java.sql.SQLException
java.sql.SQLException
public static AddressCountry getAddressCountryFromRs(java.sql.ResultSet rs, java.lang.String prefix) throws java.sql.SQLException
java.sql.SQLException
public static AddressCity getAddressCityFromRs(java.sql.ResultSet rs, java.lang.String prefix) throws java.sql.SQLException
java.sql.SQLException
public java.util.List<AddressCountry> getUpdatedCountries(long time, int[] countriesId) throws java.sql.SQLException
java.sql.SQLException
public java.util.List<AddressCity> getUpdatedCities(long time, int[] citiesId) throws java.sql.SQLException
java.sql.SQLException
public java.util.List<AddressHouse> getUpdatedHouses(long time, int[] citiesId) throws java.sql.SQLException
java.sql.SQLException
public java.util.List<AddressItem> getUpdatedAreas(long time, int[] citiesId) throws java.sql.SQLException
java.sql.SQLException
public java.util.List<AddressItem> getUpdatedQuarters(long time, int[] citiesId) throws java.sql.SQLException
java.sql.SQLException
public java.util.List<AddressItem> getUpdatedStreets(long time, int[] citiesId) throws java.sql.SQLException
java.sql.SQLException
public java.util.List<java.lang.Integer> getCountryIdByCityId(int[] citiesId) throws java.sql.SQLException
java.sql.SQLException
public java.util.List<AddressItem> getAddressStreetsBySubstring(java.lang.String streetSubstring, java.util.List<java.lang.Integer> cityIds) throws java.sql.SQLException
streetSubstring
- подстрока поискаcityIds
- список id городов, в которых нужно искать
если cityIds == null, то поиск по всем городам (город не задан)java.sql.SQLException
public java.lang.Integer getCityIdByAddress(java.lang.String address) throws java.sql.SQLException
java.sql.SQLException
public java.util.List<java.lang.Integer> getHouseIdsByStreetAndHouse(int streetId, java.lang.String house, java.util.List<java.lang.Integer> cityIds) throws java.sql.SQLException
java.sql.SQLException