Class CountryDAO

  • All Implemented Interfaces:
    ICountryDAO

    public final class CountryDAO
    extends java.lang.Object
    implements ICountryDAO
    This class provides Data Access methods for Country objects
    • Constructor Summary

      Constructors 
      Constructor Description
      CountryDAO()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void addCountryChanges​(Country country, java.lang.String author, java.util.Date dateUpdate, java.lang.String status, fr.paris.lutece.portal.service.plugin.Plugin plugin)
      Insert a new record in the history table.
      void delete​(int nKey, fr.paris.lutece.portal.service.plugin.Plugin plugin)
      Delete a record from the table
      Country insert​(Country country, fr.paris.lutece.portal.service.plugin.Plugin plugin)
      Insert a new record in the table.
      java.util.Optional<Country> load​(int nKey, fr.paris.lutece.portal.service.plugin.Plugin plugin)
      Load the data from the table
      java.util.Optional<Country> loadByCode​(java.lang.String strCode, boolean bAttached, fr.paris.lutece.portal.service.plugin.Plugin plugin)
      Load the data from the table
      java.util.Optional<Country> loadByCode​(java.lang.String strCode, fr.paris.lutece.portal.service.plugin.Plugin plugin)
      Load the data from the table
      java.util.List<Country> selectCountriesList​(fr.paris.lutece.portal.service.plugin.Plugin plugin)
      Load the data of all the country objects and returns them as a list
      java.util.List<Country> selectCountriesListByIds​(fr.paris.lutece.portal.service.plugin.Plugin plugin, java.util.List<java.lang.Integer> listIds)
      Load the data of all the avant objects and returns them as a list
      java.util.List<Country> selectCountriesListByValue​(java.lang.String strVal, fr.paris.lutece.portal.service.plugin.Plugin plugin)
      Load the data of all the country objects and returns them as a list
      java.util.List<Country> selectCountriesListByValueAndDate​(java.lang.String strVal, java.util.Date dateRef, fr.paris.lutece.portal.service.plugin.Plugin plugin)
      Load the data of all the country objects and returns them as a list
      fr.paris.lutece.util.ReferenceList selectCountriesReferenceList​(fr.paris.lutece.portal.service.plugin.Plugin plugin)
      Load the data of all the country objects and returns them as a referenceList
      CountryChanges selectCountryChanges​(int idHistory, fr.paris.lutece.portal.service.plugin.Plugin plugin)
      Load the data of the city object and returns it
      java.util.List<CountryChanges> selectCountryChangesListByCountryId​(int idCountry, fr.paris.lutece.portal.service.plugin.Plugin plugin)
      Load the data of all the city objects and returns them as a list
      java.util.List<java.lang.Integer> selectIdCountriesList​(fr.paris.lutece.portal.service.plugin.Plugin plugin, java.lang.String countryLabel, java.lang.String countryCode, boolean approximateSearch)
      Load the id of all the country objects and returns them as a list
      void store​(Country country, fr.paris.lutece.portal.service.plugin.Plugin plugin)
      Update the record in the table
      CountryChanges storeChanges​(CountryChanges countryChanges, fr.paris.lutece.portal.service.plugin.Plugin plugin)
      Load the data of the city object and returns it
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • CountryDAO

        public CountryDAO()
    • Method Detail

      • insert

        public Country insert​(Country country,
                              fr.paris.lutece.portal.service.plugin.Plugin plugin)
        Insert a new record in the table.
        Specified by:
        insert in interface ICountryDAO
        Parameters:
        country - instance of the Country object to insert
        plugin - the Plugin
      • addCountryChanges

        public void addCountryChanges​(Country country,
                                      java.lang.String author,
                                      java.util.Date dateUpdate,
                                      java.lang.String status,
                                      fr.paris.lutece.portal.service.plugin.Plugin plugin)
        Insert a new record in the history table.
        Specified by:
        addCountryChanges in interface ICountryDAO
        Parameters:
        country - instance of the Country object to insert
        plugin - the Plugin
      • selectCountryChangesListByCountryId

        public java.util.List<CountryChanges> selectCountryChangesListByCountryId​(int idCountry,
                                                                                  fr.paris.lutece.portal.service.plugin.Plugin plugin)
        Load the data of all the city objects and returns them as a list
        Specified by:
        selectCountryChangesListByCountryId in interface ICountryDAO
        Parameters:
        idCountry - The identifier of the City's History to get
        plugin - the Plugin
        Returns:
        The list which contains the data of all the city objects
      • selectCountryChanges

        public CountryChanges selectCountryChanges​(int idHistory,
                                                   fr.paris.lutece.portal.service.plugin.Plugin plugin)
        Load the data of the city object and returns it
        Specified by:
        selectCountryChanges in interface ICountryDAO
        Parameters:
        idHistory - The identifier of the CountryHistory to save
        plugin - the Plugin
        Returns:
        The list which contains the data of all the city objects
      • storeChanges

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

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

        public java.util.Optional<Country> loadByCode​(java.lang.String strCode,
                                                      fr.paris.lutece.portal.service.plugin.Plugin plugin)
        Load the data from the table
        Specified by:
        loadByCode in interface ICountryDAO
        plugin - the Plugin
        Returns:
        The instance of the country
      • loadByCode

        public java.util.Optional<Country> loadByCode​(java.lang.String strCode,
                                                      boolean bAttached,
                                                      fr.paris.lutece.portal.service.plugin.Plugin plugin)
        Load the data from the table
        Specified by:
        loadByCode in interface ICountryDAO
        Parameters:
        strCode - The identifier of the country
        bAttached - is the country attached
        plugin - the Plugin
        Returns:
        The instance of the country
      • 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 ICountryDAO
        Parameters:
        nKey - The identifier of the Country to delete
        plugin - the Plugin
      • store

        public void store​(Country country,
                          fr.paris.lutece.portal.service.plugin.Plugin plugin)
        Update the record in the table
        Specified by:
        store in interface ICountryDAO
        Parameters:
        country - the reference of the Country
        plugin - the Plugin
      • selectCountriesList

        public java.util.List<Country> selectCountriesList​(fr.paris.lutece.portal.service.plugin.Plugin plugin)
        Load the data of all the country objects and returns them as a list
        Specified by:
        selectCountriesList in interface ICountryDAO
        Parameters:
        plugin - the Plugin
        Returns:
        The list which contains the data of all the country objects
      • selectCountriesListByValueAndDate

        public java.util.List<Country> selectCountriesListByValueAndDate​(java.lang.String strVal,
                                                                         java.util.Date dateRef,
                                                                         fr.paris.lutece.portal.service.plugin.Plugin plugin)
        Load the data of all the country objects and returns them as a list
        Specified by:
        selectCountriesListByValueAndDate in interface ICountryDAO
        plugin - the Plugin
        Returns:
        The list which contains the data of all the country objects
      • selectCountriesListByValue

        public java.util.List<Country> selectCountriesListByValue​(java.lang.String strVal,
                                                                  fr.paris.lutece.portal.service.plugin.Plugin plugin)
        Load the data of all the country objects and returns them as a list
        Specified by:
        selectCountriesListByValue in interface ICountryDAO
        plugin - the Plugin
        Returns:
        The list which contains the data of all the country objects
      • selectIdCountriesList

        public java.util.List<java.lang.Integer> selectIdCountriesList​(fr.paris.lutece.portal.service.plugin.Plugin plugin,
                                                                       java.lang.String countryLabel,
                                                                       java.lang.String countryCode,
                                                                       boolean approximateSearch)
        Load the id of all the country objects and returns them as a list
        Specified by:
        selectIdCountriesList in interface ICountryDAO
        Parameters:
        plugin - the Plugin
        Returns:
        The list which contains the id of all the country objects
      • selectCountriesReferenceList

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

        public java.util.List<Country> selectCountriesListByIds​(fr.paris.lutece.portal.service.plugin.Plugin plugin,
                                                                java.util.List<java.lang.Integer> listIds)
        Load the data of all the avant objects and returns them as a list
        Specified by:
        selectCountriesListByIds in interface ICountryDAO
        listIds - liste of ids
        Returns:
        The list which contains the data of all the avant objects