Liferay 6.2-ce-ga5

com.liferay.portal.service.persistence
Interface PortletPersistence

All Superinterfaces:
BasePersistence<Portlet>

@ProviderType
public interface PortletPersistence
extends BasePersistence<Portlet>

The persistence interface for the portlet service.

Caching information and settings can be found in portal.properties

See Also:
PortletPersistenceImpl, PortletUtil

Method Summary
 void cacheResult(List<Portlet> portlets)
          Caches the portlets in the entity cache if it is enabled.
 void cacheResult(Portlet portlet)
          Caches the portlet in the entity cache if it is enabled.
 int countAll()
          Returns the number of portlets.
 int countByC_P(long companyId, String portletId)
          Returns the number of portlets where companyId = ? and portletId = ?.
 int countByCompanyId(long companyId)
          Returns the number of portlets where companyId = ?.
 Portlet create(long id)
          Creates a new portlet with the primary key.
 Portlet fetchByC_P(long companyId, String portletId)
          Returns the portlet where companyId = ? and portletId = ? or returns null if it could not be found.
 Portlet fetchByC_P(long companyId, String portletId, boolean retrieveFromCache)
          Returns the portlet where companyId = ? and portletId = ? or returns null if it could not be found, optionally using the finder cache.
 Portlet fetchByCompanyId_First(long companyId, OrderByComparator orderByComparator)
          Returns the first portlet in the ordered set where companyId = ?.
 Portlet fetchByCompanyId_Last(long companyId, OrderByComparator orderByComparator)
          Returns the last portlet in the ordered set where companyId = ?.
 Portlet fetchByPrimaryKey(long id)
          Returns the portlet with the primary key or returns null if it could not be found.
 List<Portlet> findAll()
          Returns all the portlets.
 List<Portlet> findAll(int start, int end)
          Returns a range of all the portlets.
 List<Portlet> findAll(int start, int end, OrderByComparator orderByComparator)
          Returns an ordered range of all the portlets.
 Portlet findByC_P(long companyId, String portletId)
          Returns the portlet where companyId = ? and portletId = ? or throws a NoSuchPortletException if it could not be found.
 Portlet findByCompanyId_First(long companyId, OrderByComparator orderByComparator)
          Returns the first portlet in the ordered set where companyId = ?.
 Portlet findByCompanyId_Last(long companyId, OrderByComparator orderByComparator)
          Returns the last portlet in the ordered set where companyId = ?.
 Portlet[] findByCompanyId_PrevAndNext(long id, long companyId, OrderByComparator orderByComparator)
          Returns the portlets before and after the current portlet in the ordered set where companyId = ?.
 List<Portlet> findByCompanyId(long companyId)
          Returns all the portlets where companyId = ?.
 List<Portlet> findByCompanyId(long companyId, int start, int end)
          Returns a range of all the portlets where companyId = ?.
 List<Portlet> findByCompanyId(long companyId, int start, int end, OrderByComparator orderByComparator)
          Returns an ordered range of all the portlets where companyId = ?.
 Portlet findByPrimaryKey(long id)
          Returns the portlet with the primary key or throws a NoSuchPortletException if it could not be found.
 Portlet remove(long id)
          Removes the portlet with the primary key from the database.
 void removeAll()
          Removes all the portlets from the database.
 Portlet removeByC_P(long companyId, String portletId)
          Removes the portlet where companyId = ? and portletId = ? from the database.
 void removeByCompanyId(long companyId)
          Removes all the portlets where companyId = ? from the database.
 Portlet updateImpl(Portlet portlet)
           
 
Methods inherited from interface com.liferay.portal.service.persistence.BasePersistence
clearCache, clearCache, clearCache, closeSession, countWithDynamicQuery, countWithDynamicQuery, fetchByPrimaryKey, findByPrimaryKey, findWithDynamicQuery, findWithDynamicQuery, findWithDynamicQuery, flush, getCurrentSession, getDataSource, getListeners, getModelClass, openSession, processException, registerListener, remove, remove, setDataSource, unregisterListener, update, update, update, update
 

Method Detail

findByCompanyId

List<Portlet> findByCompanyId(long companyId)
                              throws SystemException
Returns all the portlets where companyId = ?.

Parameters:
companyId - the company ID
Returns:
the matching portlets
Throws:
SystemException - if a system exception occurred

findByCompanyId

List<Portlet> findByCompanyId(long companyId,
                              int start,
                              int end)
                              throws SystemException
Returns a range of all the portlets where companyId = ?.

Useful when paginating results. Returns a maximum of end - start instances. start and end are not primary keys, they are indexes in the result set. Thus, 0 refers to the first result in the set. Setting both start and end to QueryUtil.ALL_POS will return the full result set. If orderByComparator is specified, then the query will include the given ORDER BY logic. If orderByComparator is absent and pagination is required (start and end are not QueryUtil.ALL_POS), then the query will include the default ORDER BY logic from PortletModelImpl. If both orderByComparator and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order.

Parameters:
companyId - the company ID
start - the lower bound of the range of portlets
end - the upper bound of the range of portlets (not inclusive)
Returns:
the range of matching portlets
Throws:
SystemException - if a system exception occurred

findByCompanyId

List<Portlet> findByCompanyId(long companyId,
                              int start,
                              int end,
                              OrderByComparator orderByComparator)
                              throws SystemException
Returns an ordered range of all the portlets where companyId = ?.

Useful when paginating results. Returns a maximum of end - start instances. start and end are not primary keys, they are indexes in the result set. Thus, 0 refers to the first result in the set. Setting both start and end to QueryUtil.ALL_POS will return the full result set. If orderByComparator is specified, then the query will include the given ORDER BY logic. If orderByComparator is absent and pagination is required (start and end are not QueryUtil.ALL_POS), then the query will include the default ORDER BY logic from PortletModelImpl. If both orderByComparator and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order.

Parameters:
companyId - the company ID
start - the lower bound of the range of portlets
end - the upper bound of the range of portlets (not inclusive)
orderByComparator - the comparator to order the results by (optionally null)
Returns:
the ordered range of matching portlets
Throws:
SystemException - if a system exception occurred

findByCompanyId_First

Portlet findByCompanyId_First(long companyId,
                              OrderByComparator orderByComparator)
                              throws NoSuchPortletException,
                                     SystemException
Returns the first portlet in the ordered set where companyId = ?.

Parameters:
companyId - the company ID
orderByComparator - the comparator to order the set by (optionally null)
Returns:
the first matching portlet
Throws:
NoSuchPortletException - if a matching portlet could not be found
SystemException - if a system exception occurred

fetchByCompanyId_First

Portlet fetchByCompanyId_First(long companyId,
                               OrderByComparator orderByComparator)
                               throws SystemException
Returns the first portlet in the ordered set where companyId = ?.

Parameters:
companyId - the company ID
orderByComparator - the comparator to order the set by (optionally null)
Returns:
the first matching portlet, or null if a matching portlet could not be found
Throws:
SystemException - if a system exception occurred

findByCompanyId_Last

Portlet findByCompanyId_Last(long companyId,
                             OrderByComparator orderByComparator)
                             throws NoSuchPortletException,
                                    SystemException
Returns the last portlet in the ordered set where companyId = ?.

Parameters:
companyId - the company ID
orderByComparator - the comparator to order the set by (optionally null)
Returns:
the last matching portlet
Throws:
NoSuchPortletException - if a matching portlet could not be found
SystemException - if a system exception occurred

fetchByCompanyId_Last

Portlet fetchByCompanyId_Last(long companyId,
                              OrderByComparator orderByComparator)
                              throws SystemException
Returns the last portlet in the ordered set where companyId = ?.

Parameters:
companyId - the company ID
orderByComparator - the comparator to order the set by (optionally null)
Returns:
the last matching portlet, or null if a matching portlet could not be found
Throws:
SystemException - if a system exception occurred

findByCompanyId_PrevAndNext

Portlet[] findByCompanyId_PrevAndNext(long id,
                                      long companyId,
                                      OrderByComparator orderByComparator)
                                      throws NoSuchPortletException,
                                             SystemException
Returns the portlets before and after the current portlet in the ordered set where companyId = ?.

Parameters:
id - the primary key of the current portlet
companyId - the company ID
orderByComparator - the comparator to order the set by (optionally null)
Returns:
the previous, current, and next portlet
Throws:
NoSuchPortletException - if a portlet with the primary key could not be found
SystemException - if a system exception occurred

removeByCompanyId

void removeByCompanyId(long companyId)
                       throws SystemException
Removes all the portlets where companyId = ? from the database.

Parameters:
companyId - the company ID
Throws:
SystemException - if a system exception occurred

countByCompanyId

int countByCompanyId(long companyId)
                     throws SystemException
Returns the number of portlets where companyId = ?.

Parameters:
companyId - the company ID
Returns:
the number of matching portlets
Throws:
SystemException - if a system exception occurred

findByC_P

Portlet findByC_P(long companyId,
                  String portletId)
                  throws NoSuchPortletException,
                         SystemException
Returns the portlet where companyId = ? and portletId = ? or throws a NoSuchPortletException if it could not be found.

Parameters:
companyId - the company ID
portletId - the portlet ID
Returns:
the matching portlet
Throws:
NoSuchPortletException - if a matching portlet could not be found
SystemException - if a system exception occurred

fetchByC_P

Portlet fetchByC_P(long companyId,
                   String portletId)
                   throws SystemException
Returns the portlet where companyId = ? and portletId = ? or returns null if it could not be found. Uses the finder cache.

Parameters:
companyId - the company ID
portletId - the portlet ID
Returns:
the matching portlet, or null if a matching portlet could not be found
Throws:
SystemException - if a system exception occurred

fetchByC_P

Portlet fetchByC_P(long companyId,
                   String portletId,
                   boolean retrieveFromCache)
                   throws SystemException
Returns the portlet where companyId = ? and portletId = ? or returns null if it could not be found, optionally using the finder cache.

Parameters:
companyId - the company ID
portletId - the portlet ID
retrieveFromCache - whether to use the finder cache
Returns:
the matching portlet, or null if a matching portlet could not be found
Throws:
SystemException - if a system exception occurred

removeByC_P

Portlet removeByC_P(long companyId,
                    String portletId)
                    throws NoSuchPortletException,
                           SystemException
Removes the portlet where companyId = ? and portletId = ? from the database.

Parameters:
companyId - the company ID
portletId - the portlet ID
Returns:
the portlet that was removed
Throws:
SystemException - if a system exception occurred
NoSuchPortletException

countByC_P

int countByC_P(long companyId,
               String portletId)
               throws SystemException
Returns the number of portlets where companyId = ? and portletId = ?.

Parameters:
companyId - the company ID
portletId - the portlet ID
Returns:
the number of matching portlets
Throws:
SystemException - if a system exception occurred

cacheResult

void cacheResult(Portlet portlet)
Caches the portlet in the entity cache if it is enabled.

Parameters:
portlet - the portlet

cacheResult

void cacheResult(List<Portlet> portlets)
Caches the portlets in the entity cache if it is enabled.

Parameters:
portlets - the portlets

create

Portlet create(long id)
Creates a new portlet with the primary key. Does not add the portlet to the database.

Parameters:
id - the primary key for the new portlet
Returns:
the new portlet

remove

Portlet remove(long id)
               throws NoSuchPortletException,
                      SystemException
Removes the portlet with the primary key from the database. Also notifies the appropriate model listeners.

Parameters:
id - the primary key of the portlet
Returns:
the portlet that was removed
Throws:
NoSuchPortletException - if a portlet with the primary key could not be found
SystemException - if a system exception occurred

updateImpl

Portlet updateImpl(Portlet portlet)
                   throws SystemException
Throws:
SystemException

findByPrimaryKey

Portlet findByPrimaryKey(long id)
                         throws NoSuchPortletException,
                                SystemException
Returns the portlet with the primary key or throws a NoSuchPortletException if it could not be found.

Parameters:
id - the primary key of the portlet
Returns:
the portlet
Throws:
NoSuchPortletException - if a portlet with the primary key could not be found
SystemException - if a system exception occurred

fetchByPrimaryKey

Portlet fetchByPrimaryKey(long id)
                          throws SystemException
Returns the portlet with the primary key or returns null if it could not be found.

Parameters:
id - the primary key of the portlet
Returns:
the portlet, or null if a portlet with the primary key could not be found
Throws:
SystemException - if a system exception occurred

findAll

List<Portlet> findAll()
                      throws SystemException
Returns all the portlets.

Returns:
the portlets
Throws:
SystemException - if a system exception occurred

findAll

List<Portlet> findAll(int start,
                      int end)
                      throws SystemException
Returns a range of all the portlets.

Useful when paginating results. Returns a maximum of end - start instances. start and end are not primary keys, they are indexes in the result set. Thus, 0 refers to the first result in the set. Setting both start and end to QueryUtil.ALL_POS will return the full result set. If orderByComparator is specified, then the query will include the given ORDER BY logic. If orderByComparator is absent and pagination is required (start and end are not QueryUtil.ALL_POS), then the query will include the default ORDER BY logic from PortletModelImpl. If both orderByComparator and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order.

Parameters:
start - the lower bound of the range of portlets
end - the upper bound of the range of portlets (not inclusive)
Returns:
the range of portlets
Throws:
SystemException - if a system exception occurred

findAll

List<Portlet> findAll(int start,
                      int end,
                      OrderByComparator orderByComparator)
                      throws SystemException
Returns an ordered range of all the portlets.

Useful when paginating results. Returns a maximum of end - start instances. start and end are not primary keys, they are indexes in the result set. Thus, 0 refers to the first result in the set. Setting both start and end to QueryUtil.ALL_POS will return the full result set. If orderByComparator is specified, then the query will include the given ORDER BY logic. If orderByComparator is absent and pagination is required (start and end are not QueryUtil.ALL_POS), then the query will include the default ORDER BY logic from PortletModelImpl. If both orderByComparator and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order.

Parameters:
start - the lower bound of the range of portlets
end - the upper bound of the range of portlets (not inclusive)
orderByComparator - the comparator to order the results by (optionally null)
Returns:
the ordered range of portlets
Throws:
SystemException - if a system exception occurred

removeAll

void removeAll()
               throws SystemException
Removes all the portlets from the database.

Throws:
SystemException - if a system exception occurred

countAll

int countAll()
             throws SystemException
Returns the number of portlets.

Returns:
the number of portlets
Throws:
SystemException - if a system exception occurred

Liferay 6.2-ce-ga5