java.lang.Object
fr.paris.lutece.plugins.mydashboard.modules.favorites.business.FavoriteDAO
All Implemented Interfaces:
IFavoriteDAO

public final class FavoriteDAO extends Object implements IFavoriteDAO
This class provides Data Access methods for Favorite objects
  • Constructor Details

    • FavoriteDAO

      public FavoriteDAO()
  • Method Details

    • newPrimaryKey

      public int newPrimaryKey(fr.paris.lutece.portal.service.plugin.Plugin plugin)
      Generates a new primary key
      Parameters:
      plugin - The Plugin
      Returns:
      The new primary key
    • insert

      public void insert(Favorite favorite, fr.paris.lutece.portal.service.plugin.Plugin plugin)
      Insert a new record in the table.
      Specified by:
      insert in interface IFavoriteDAO
      Parameters:
      favorite - instance of the Favorite object to insert
      plugin - the Plugin
    • load

      public Favorite load(int nKey, fr.paris.lutece.portal.service.plugin.Plugin plugin)
      Load the data from the table
      Specified by:
      load in interface IFavoriteDAO
      Parameters:
      nKey - The identifier of the favorite
      plugin - the Plugin
      Returns:
      The instance of the favorite
    • 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 IFavoriteDAO
      Parameters:
      nKey - The identifier of the Favorite to delete
      plugin - the Plugin
    • store

      public void store(Favorite favorite, fr.paris.lutece.portal.service.plugin.Plugin plugin)
      Update the record in the table
      Specified by:
      store in interface IFavoriteDAO
      Parameters:
      favorite - the reference of the Favorite
      plugin - the Plugin
    • selectFavoritesList

      public List<Favorite> selectFavoritesList(fr.paris.lutece.portal.service.plugin.Plugin plugin)
      Load the data of all the favorite objects and returns them as a list
      Specified by:
      selectFavoritesList in interface IFavoriteDAO
      Parameters:
      plugin - the Plugin
      Returns:
      The list which contains the data of all the favorite objects
    • selectIdFavoritesList

      public List<Integer> selectIdFavoritesList(fr.paris.lutece.portal.service.plugin.Plugin plugin)
      Load the id of all the favorite objects and returns them as a list
      Specified by:
      selectIdFavoritesList in interface IFavoriteDAO
      Parameters:
      plugin - the Plugin
      Returns:
      The list which contains the id of all the favorite objects
    • selectFavoritesReferenceList

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

      public List<Favorite> selectActivatedFavoritesList(fr.paris.lutece.portal.service.plugin.Plugin plugin)
      Load the data of all the activated favorite objects and returns them as a list
      Specified by:
      selectActivatedFavoritesList in interface IFavoriteDAO
      Parameters:
      plugin - the Plugin
      Returns:
      The List which contains the data of all the activated favorite objects
    • selectProviderNameFavoritesList

      public List<Favorite> selectProviderNameFavoritesList(String strProviderName, fr.paris.lutece.portal.service.plugin.Plugin plugin)
      Load the data of all the favorite provided by the ProviderName
      Specified by:
      selectProviderNameFavoritesList in interface IFavoriteDAO
      Parameters:
      strProviderName - the favorite provider name
      plugin - the Plugin
      Returns:
      The List which contains the data of all the activated favorite objects
    • countProviderNameRemoteId

      public int countProviderNameRemoteId(String strProviderName, String strRemoteId, fr.paris.lutece.portal.service.plugin.Plugin plugin)
      Count the number of favorite for one provider name AND one remote id (should be 1 or 0)
      Specified by:
      countProviderNameRemoteId in interface IFavoriteDAO
      Parameters:
      strProviderName - the favorite provider name
      strRemoteId - the favorite remote id
      plugin - the Plugin
      Returns:
      The count of favorites corresponding to provider name and remote id given
    • selectDefaultFavoritesList

      public List<Favorite> selectDefaultFavoritesList(fr.paris.lutece.portal.service.plugin.Plugin plugin)
      Return the default favorites list
      Specified by:
      selectDefaultFavoritesList in interface IFavoriteDAO
      Returns:
      the list of default favorites
    • selectCategoryCodeFavoritesList

      public List<Favorite> selectCategoryCodeFavoritesList(String strCategoryCode, fr.paris.lutece.portal.service.plugin.Plugin plugin)
      Load the data of all the favorite provided by the category code
      Specified by:
      selectCategoryCodeFavoritesList in interface IFavoriteDAO
      Parameters:
      strCategoryCode - the category code
      plugin - the Plugin
      Returns:
      The List which contains the data of all the favorites filtered by the category code
    • selectCategoryCodeActivatedFavoritesList

      public List<Favorite> selectCategoryCodeActivatedFavoritesList(String strCategoryCode, fr.paris.lutece.portal.service.plugin.Plugin plugin)
      Specified by:
      selectCategoryCodeActivatedFavoritesList in interface IFavoriteDAO