fr.paris.lutece.plugins.extend.modules.rating.business
Class RatingDAO

java.lang.Object
  extended by fr.paris.lutece.plugins.extend.modules.rating.business.RatingDAO
All Implemented Interfaces:
IRatingDAO

public class RatingDAO
extends Object
implements IRatingDAO

This class provides Data Access methods for Rating objects.


Constructor Summary
RatingDAO()
           
 
Method Summary
 void delete(int nIdRating, fr.paris.lutece.portal.service.plugin.Plugin plugin)
          Delete.
 void deleteByResource(String strIdExtendableResource, String strExtendableResourceType, fr.paris.lutece.portal.service.plugin.Plugin plugin)
          Delete by id hub resource.
 List<Integer> findIdMostRatedResources(String strExtendableResourceType, int nItemsOffset, int nMaxItemsNumber, fr.paris.lutece.portal.service.plugin.Plugin plugin)
          Get the ids of resources ordered by their number of ratings
 void insert(Rating rating, fr.paris.lutece.portal.service.plugin.Plugin plugin)
          Insert.
 Rating load(int nIdRating, fr.paris.lutece.portal.service.plugin.Plugin plugin)
          Load.
 Rating loadByResource(String strIdExtendableResource, String strExtendableResourceType, fr.paris.lutece.portal.service.plugin.Plugin plugin)
          Select by id hub resource.
 void store(Rating rating, fr.paris.lutece.portal.service.plugin.Plugin plugin)
          Store.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RatingDAO

public RatingDAO()
Method Detail

insert

public void insert(Rating rating,
                   fr.paris.lutece.portal.service.plugin.Plugin plugin)
Insert.

Specified by:
insert in interface IRatingDAO
Parameters:
rating - the rating
plugin - the plugin

load

public Rating load(int nIdRating,
                   fr.paris.lutece.portal.service.plugin.Plugin plugin)
Load.

Specified by:
load in interface IRatingDAO
Parameters:
nIdRating - the n id rating
plugin - the plugin
Returns:
the rating

delete

public void delete(int nIdRating,
                   fr.paris.lutece.portal.service.plugin.Plugin plugin)
Delete.

Specified by:
delete in interface IRatingDAO
Parameters:
nIdRating - the n id rating
plugin - the plugin

deleteByResource

public void deleteByResource(String strIdExtendableResource,
                             String strExtendableResourceType,
                             fr.paris.lutece.portal.service.plugin.Plugin plugin)
Delete by id hub resource.

Specified by:
deleteByResource in interface IRatingDAO
Parameters:
strIdExtendableResource - the str id extendable resource
strExtendableResourceType - the str extendable resource type
plugin - the plugin

store

public void store(Rating rating,
                  fr.paris.lutece.portal.service.plugin.Plugin plugin)
Store.

Specified by:
store in interface IRatingDAO
Parameters:
rating - the rating
plugin - the plugin

loadByResource

public Rating loadByResource(String strIdExtendableResource,
                             String strExtendableResourceType,
                             fr.paris.lutece.portal.service.plugin.Plugin plugin)
Select by id hub resource.

Specified by:
loadByResource in interface IRatingDAO
Parameters:
strIdExtendableResource - the str id extendable resource
strExtendableResourceType - the str extendable resource type
plugin - the plugin
Returns:
the rating

findIdMostRatedResources

public List<Integer> findIdMostRatedResources(String strExtendableResourceType,
                                              int nItemsOffset,
                                              int nMaxItemsNumber,
                                              fr.paris.lutece.portal.service.plugin.Plugin plugin)
Get the ids of resources ordered by their number of ratings

Specified by:
findIdMostRatedResources in interface IRatingDAO
Parameters:
strExtendableResourceType - The type of resources to consider
nItemsOffset - The offset of the items to get, or 0 to get items from the first one
nMaxItemsNumber - The maximum number of items to return, or 0 to get every items
plugin - the plugin
Returns:
The list of ids of resources ordered by the number of associated comments


Copyright © 2013 Mairie de Paris. All Rights Reserved.