java.lang.Object
fr.paris.lutece.plugins.geocodes.business.CityDAO
All Implemented Interfaces:
ICityDAO

public final class CityDAO extends Object implements ICityDAO
This class provides Data Access methods for City objects
  • Constructor Details

    • CityDAO

      public CityDAO()
  • Method Details

    • insert

      public City insert(City city, fr.paris.lutece.portal.service.plugin.Plugin plugin)
      Insert a new record in the table.
      Specified by:
      insert in interface ICityDAO
      Parameters:
      city - instance of the City object to insert
      plugin - the Plugin
    • addCityChanges

      public void addCityChanges(City city, String author, String status, fr.paris.lutece.portal.service.plugin.Plugin plugin)
      Insert a new record in the history table.
      Specified by:
      addCityChanges in interface ICityDAO
      Parameters:
      city - instance of the City object to insert
      plugin - the Plugin
    • searchCitiesChanges

      public List<String> searchCitiesChanges(fr.paris.lutece.portal.service.plugin.Plugin plugin, String cityLabel, String cityCode, String placeCode, boolean approximateSearch, String status)
      Load the data of all the city objects and returns them as a list
      Specified by:
      searchCitiesChanges in interface ICityDAO
      Parameters:
      plugin - the Plugin
      Returns:
      The list which contains the data of all the cities that have changes
    • selectCityChangesByCodeAndDate

      public CityChanges selectCityChangesByCodeAndDate(String code, Date date, fr.paris.lutece.portal.service.plugin.Plugin plugin)
      Load the data of all the city objects and returns them as a list
      Specified by:
      selectCityChangesByCodeAndDate in interface ICityDAO
      plugin - the Plugin
      Returns:
      The list which contains the data of all the city objects
    • selectCityChangesListByCode

      public List<CityChanges> selectCityChangesListByCode(String code, fr.paris.lutece.portal.service.plugin.Plugin plugin)
      Load the data of the city object and returns it
      Specified by:
      selectCityChangesListByCode in interface ICityDAO
      plugin - the Plugin
      Returns:
      The list which contains the data of all the city objects
    • storeChanges

      public CityChanges storeChanges(CityChanges cityChanges, fr.paris.lutece.portal.service.plugin.Plugin plugin)
      Load the data of the city object and returns it
      Specified by:
      storeChanges in interface ICityDAO
      Parameters:
      cityChanges - The CityHistory to update
      plugin - the Plugin
      Returns:
      The list which contains the data of all the city objects
    • load

      public Optional<City> load(int nKey, fr.paris.lutece.portal.service.plugin.Plugin plugin)
      Load the data from the table
      Specified by:
      load in interface ICityDAO
      Parameters:
      nKey - The identifier of the city
      plugin - the Plugin
      Returns:
      The instance of the city
    • loadByCode

      public List<City> loadByCode(String strCode, fr.paris.lutece.portal.service.plugin.Plugin plugin)
      Load the data from the table
      Specified by:
      loadByCode in interface ICityDAO
      plugin - the Plugin
      Returns:
      The instance of the city
    • loadByDateAndCode

      public Optional<City> loadByDateAndCode(Date dateCode, String strCode, fr.paris.lutece.portal.service.plugin.Plugin plugin)
      Load the data from the table, non deprecated codes first, deprecated codes if none is found
      Specified by:
      loadByDateAndCode in interface ICityDAO
      Parameters:
      dateCode - the date of avaibility
      strCode - The identifier of the city
      plugin - the Plugin
      Returns:
      The instance of the city
    • delete

      public void delete(int nKey, fr.paris.lutece.portal.service.plugin.Plugin plugin)
      Delete a record from the table
      Specified by:
      delete in interface ICityDAO
      Parameters:
      nKey - The identifier of the City to delete
      plugin - the Plugin
    • store

      public void store(City city, fr.paris.lutece.portal.service.plugin.Plugin plugin)
      Update the record in the table
      Specified by:
      store in interface ICityDAO
      Parameters:
      city - the reference of the City
      plugin - the Plugin
    • selectCitiesList

      public List<City> selectCitiesList(fr.paris.lutece.portal.service.plugin.Plugin plugin)
      Load the data of all the city objects and returns them as a list
      Specified by:
      selectCitiesList in interface ICityDAO
      Parameters:
      plugin - the Plugin
      Returns:
      The list which contains the data of all the city objects
    • selectCitiesListByValue

      public List<City> selectCitiesListByValue(String strVal, fr.paris.lutece.portal.service.plugin.Plugin plugin)
      Load the data of all the city objects and returns them as a list
      Specified by:
      selectCitiesListByValue in interface ICityDAO
      plugin - the Plugin
      Returns:
      The list which contains the data of all the city objects
    • selectCitiesListByValueLike

      public List<City> selectCitiesListByValueLike(String strVal, fr.paris.lutece.portal.service.plugin.Plugin plugin)
      Load the data of all the city objects and returns them as a list
      Specified by:
      selectCitiesListByValueLike in interface ICityDAO
      plugin - the Plugin
      Returns:
      The list which contains the data of all the city objects
    • getChangesExistence

      public boolean getChangesExistence(City city, fr.paris.lutece.portal.service.plugin.Plugin plugin)
      Specified by:
      getChangesExistence in interface ICityDAO
    • selectCityByCodeAndDate

      public City selectCityByCodeAndDate(String code, Date date, fr.paris.lutece.portal.service.plugin.Plugin plugin)
      Specified by:
      selectCityByCodeAndDate in interface ICityDAO
    • selectCitiesCodesListByDate

      public List<String> selectCitiesCodesListByDate(Date dateCity, fr.paris.lutece.portal.service.plugin.Plugin plugin)
      Load the data of all the city codes objects and returns them as a list
      Specified by:
      selectCitiesCodesListByDate in interface ICityDAO
      Parameters:
      dateCity - date of the city
      plugin - the Plugin
      Returns:
      The list which contains the data of all the city objects
    • selectCitiesListByValueAndDate

      public List<City> selectCitiesListByValueAndDate(String strVal, Date dateCity, fr.paris.lutece.portal.service.plugin.Plugin plugin)
      Load the data of all the city objects and returns them as a list
      Specified by:
      selectCitiesListByValueAndDate in interface ICityDAO
      Parameters:
      strVal - name of the city
      dateCity - date of the city
      plugin - the Plugin
      Returns:
      The list which contains the data of all the city objects
    • selectCitiesListByValueAndDateLike

      public List<City> selectCitiesListByValueAndDateLike(String strVal, Date dateCity, fr.paris.lutece.portal.service.plugin.Plugin plugin)
      Load the data of all the city objects and returns them as a list
      Specified by:
      selectCitiesListByValueAndDateLike in interface ICityDAO
      Parameters:
      strVal - name of the city
      dateCity - date of the city
      plugin - the Plugin
      Returns:
      The list which contains the data of all the city objects
    • selectIdCitiesList

      public List<Integer> selectIdCitiesList(fr.paris.lutece.portal.service.plugin.Plugin plugin, String cityLabel, String cityCode, String placeCode, boolean approximateSearch)
      Load the id of all the city objects and returns them as a list
      Specified by:
      selectIdCitiesList in interface ICityDAO
      Parameters:
      plugin - the Plugin
      Returns:
      The list which contains the id of all the city objects
    • selectCitiesReferenceList

      public fr.paris.lutece.util.ReferenceList selectCitiesReferenceList(fr.paris.lutece.portal.service.plugin.Plugin plugin)
      Load the data of all the city objects and returns them as a referenceList
      Specified by:
      selectCitiesReferenceList in interface ICityDAO
      Parameters:
      plugin - the Plugin
      Returns:
      The referenceList which contains the data of all the city objects
    • selectCitiesListByIds

      public List<City> selectCitiesListByIds(fr.paris.lutece.portal.service.plugin.Plugin plugin, List<Integer> listIds)
      Load the data of all the avant objects and returns them as a list
      Specified by:
      selectCitiesListByIds in interface ICityDAO
      listIds - liste of ids
      Returns:
      The list which contains the data of all the avant objects
    • getCitiesListByCode

      public List<City> getCitiesListByCode(fr.paris.lutece.portal.service.plugin.Plugin plugin, String code)
      Description copied from interface: ICityDAO
      Load the data of all the avant objects and returns them as a list
      Specified by:
      getCitiesListByCode in interface ICityDAO
      Returns:
      The list which contains the data of all the avant objects
    • selectCitiesListByLastDate

      public List<City> selectCitiesListByLastDate(fr.paris.lutece.portal.service.plugin.Plugin plugin)
      Load the data of all the city objects by last date update and returns them as a referenceList
      Specified by:
      selectCitiesListByLastDate in interface ICityDAO
      Parameters:
      plugin - the Plugin
      Returns:
      The list which contains the data of all the city objects