|
Liferay 6.2-ce-ga5 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.liferay.portal.service.persistence.impl.BasePersistenceImpl<Portlet> com.liferay.portal.service.persistence.PortletPersistenceImpl
public class PortletPersistenceImpl
The persistence implementation for the portlet service.
Caching information and settings can be found in portal.properties
PortletPersistence
,
PortletUtil
Fields inherited from class com.liferay.portal.service.persistence.impl.BasePersistenceImpl |
---|
COUNT_COLUMN_NAME, FINDER_ARGS_EMPTY, listeners, ORDER_BY_ASC, ORDER_BY_ASC_HAS_NEXT, ORDER_BY_CLAUSE, ORDER_BY_DESC, ORDER_BY_DESC_HAS_NEXT, WHERE_AND, WHERE_GREATER_THAN, WHERE_GREATER_THAN_HAS_NEXT, WHERE_LESSER_THAN, WHERE_LESSER_THAN_HAS_NEXT, WHERE_OR |
Constructor Summary | |
---|---|
PortletPersistenceImpl()
|
Method Summary | |
---|---|
void |
afterPropertiesSet()
Initializes the portlet persistence. |
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. |
protected void |
cacheUniqueFindersCache(Portlet portlet)
|
void |
clearCache()
Clears the cache for all portlets. |
void |
clearCache(List<Portlet> portlets)
Clears the cache for a List instances of this model. |
void |
clearCache(Portlet portlet)
Clears the cache for the portlet. |
protected void |
clearUniqueFindersCache(Portlet portlet)
|
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. |
void |
destroy()
|
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. |
Portlet |
fetchByPrimaryKey(Serializable primaryKey)
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 |
findByPrimaryKey(Serializable primaryKey)
Returns the portlet with the primary key or throws a NoSuchModelException if it could not be found. |
protected Set<String> |
getBadColumnNames()
|
protected Portlet |
getByCompanyId_PrevAndNext(Session session,
Portlet portlet,
long companyId,
OrderByComparator orderByComparator,
boolean previous)
|
Portlet |
remove(long id)
Removes the portlet with the primary key from the database. |
Portlet |
remove(Serializable primaryKey)
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. |
protected Portlet |
removeImpl(Portlet portlet)
Removes the model instance from the database. |
protected Portlet |
toUnwrappedModel(Portlet portlet)
|
Portlet |
updateImpl(Portlet portlet)
Updates the model instance in the database or adds it if it does not yet exist. |
Methods inherited from class com.liferay.portal.service.persistence.impl.BasePersistenceImpl |
---|
appendOrderByComparator, appendOrderByComparator, closeSession, countWithDynamicQuery, countWithDynamicQuery, findWithDynamicQuery, findWithDynamicQuery, findWithDynamicQuery, flush, getClassLoader, getCurrentSession, getDataSource, getDB, getDialect, getListeners, getModelClass, openNewSession, openSession, processException, registerListener, remove, removeConjunction, setDataSource, setModelClass, setSessionFactory, unregisterListener, update, update, update, update, updateImpl |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface com.liferay.portal.service.persistence.BasePersistence |
---|
closeSession, countWithDynamicQuery, countWithDynamicQuery, findWithDynamicQuery, findWithDynamicQuery, findWithDynamicQuery, flush, getCurrentSession, getDataSource, getListeners, getModelClass, openSession, processException, registerListener, remove, setDataSource, unregisterListener, update, update, update, update |
Field Detail |
---|
public static final String FINDER_CLASS_NAME_ENTITY
public static final String FINDER_CLASS_NAME_LIST_WITH_PAGINATION
public static final String FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION
public static final FinderPath FINDER_PATH_WITH_PAGINATION_FIND_ALL
public static final FinderPath FINDER_PATH_WITHOUT_PAGINATION_FIND_ALL
public static final FinderPath FINDER_PATH_COUNT_ALL
public static final FinderPath FINDER_PATH_WITH_PAGINATION_FIND_BY_COMPANYID
public static final FinderPath FINDER_PATH_WITHOUT_PAGINATION_FIND_BY_COMPANYID
public static final FinderPath FINDER_PATH_COUNT_BY_COMPANYID
public static final FinderPath FINDER_PATH_FETCH_BY_C_P
public static final FinderPath FINDER_PATH_COUNT_BY_C_P
Constructor Detail |
---|
public PortletPersistenceImpl()
Method Detail |
---|
public List<Portlet> findByCompanyId(long companyId) throws SystemException
findByCompanyId
in interface PortletPersistence
companyId
- the company ID
SystemException
- if a system exception occurredpublic List<Portlet> findByCompanyId(long companyId, int start, int end) throws SystemException
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.
findByCompanyId
in interface PortletPersistence
companyId
- the company IDstart
- the lower bound of the range of portletsend
- the upper bound of the range of portlets (not inclusive)
SystemException
- if a system exception occurredpublic List<Portlet> findByCompanyId(long companyId, int start, int end, OrderByComparator orderByComparator) throws SystemException
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.
findByCompanyId
in interface PortletPersistence
companyId
- the company IDstart
- the lower bound of the range of portletsend
- the upper bound of the range of portlets (not inclusive)orderByComparator
- the comparator to order the results by (optionally null
)
SystemException
- if a system exception occurredpublic Portlet findByCompanyId_First(long companyId, OrderByComparator orderByComparator) throws NoSuchPortletException, SystemException
findByCompanyId_First
in interface PortletPersistence
companyId
- the company IDorderByComparator
- the comparator to order the set by (optionally null
)
NoSuchPortletException
- if a matching portlet could not be found
SystemException
- if a system exception occurredpublic Portlet fetchByCompanyId_First(long companyId, OrderByComparator orderByComparator) throws SystemException
fetchByCompanyId_First
in interface PortletPersistence
companyId
- the company IDorderByComparator
- the comparator to order the set by (optionally null
)
null
if a matching portlet could not be found
SystemException
- if a system exception occurredpublic Portlet findByCompanyId_Last(long companyId, OrderByComparator orderByComparator) throws NoSuchPortletException, SystemException
findByCompanyId_Last
in interface PortletPersistence
companyId
- the company IDorderByComparator
- the comparator to order the set by (optionally null
)
NoSuchPortletException
- if a matching portlet could not be found
SystemException
- if a system exception occurredpublic Portlet fetchByCompanyId_Last(long companyId, OrderByComparator orderByComparator) throws SystemException
fetchByCompanyId_Last
in interface PortletPersistence
companyId
- the company IDorderByComparator
- the comparator to order the set by (optionally null
)
null
if a matching portlet could not be found
SystemException
- if a system exception occurredpublic Portlet[] findByCompanyId_PrevAndNext(long id, long companyId, OrderByComparator orderByComparator) throws NoSuchPortletException, SystemException
findByCompanyId_PrevAndNext
in interface PortletPersistence
id
- the primary key of the current portletcompanyId
- the company IDorderByComparator
- the comparator to order the set by (optionally null
)
NoSuchPortletException
- if a portlet with the primary key could not be found
SystemException
- if a system exception occurredprotected Portlet getByCompanyId_PrevAndNext(Session session, Portlet portlet, long companyId, OrderByComparator orderByComparator, boolean previous)
public void removeByCompanyId(long companyId) throws SystemException
removeByCompanyId
in interface PortletPersistence
companyId
- the company ID
SystemException
- if a system exception occurredpublic int countByCompanyId(long companyId) throws SystemException
countByCompanyId
in interface PortletPersistence
companyId
- the company ID
SystemException
- if a system exception occurredpublic Portlet findByC_P(long companyId, String portletId) throws NoSuchPortletException, SystemException
NoSuchPortletException
if it could not be found.
findByC_P
in interface PortletPersistence
companyId
- the company IDportletId
- the portlet ID
NoSuchPortletException
- if a matching portlet could not be found
SystemException
- if a system exception occurredpublic Portlet fetchByC_P(long companyId, String portletId) throws SystemException
null
if it could not be found. Uses the finder cache.
fetchByC_P
in interface PortletPersistence
companyId
- the company IDportletId
- the portlet ID
null
if a matching portlet could not be found
SystemException
- if a system exception occurredpublic Portlet fetchByC_P(long companyId, String portletId, boolean retrieveFromCache) throws SystemException
null
if it could not be found, optionally using the finder cache.
fetchByC_P
in interface PortletPersistence
companyId
- the company IDportletId
- the portlet IDretrieveFromCache
- whether to use the finder cache
null
if a matching portlet could not be found
SystemException
- if a system exception occurredpublic Portlet removeByC_P(long companyId, String portletId) throws NoSuchPortletException, SystemException
removeByC_P
in interface PortletPersistence
companyId
- the company IDportletId
- the portlet ID
SystemException
- if a system exception occurred
NoSuchPortletException
public int countByC_P(long companyId, String portletId) throws SystemException
countByC_P
in interface PortletPersistence
companyId
- the company IDportletId
- the portlet ID
SystemException
- if a system exception occurredpublic void cacheResult(Portlet portlet)
cacheResult
in interface PortletPersistence
portlet
- the portletpublic void cacheResult(List<Portlet> portlets)
cacheResult
in interface PortletPersistence
portlets
- the portletspublic void clearCache()
The EntityCache
and FinderCache
are both cleared by this method.
clearCache
in interface BasePersistence<Portlet>
clearCache
in class BasePersistenceImpl<Portlet>
public void clearCache(Portlet portlet)
The EntityCache
and FinderCache
are both cleared by this method.
clearCache
in interface BasePersistence<Portlet>
clearCache
in class BasePersistenceImpl<Portlet>
portlet
- the instance of this model to clear the cache forpublic void clearCache(List<Portlet> portlets)
BasePersistence
The EntityCache
and FinderCache
are both cleared by this
method.
clearCache
in interface BasePersistence<Portlet>
clearCache
in class BasePersistenceImpl<Portlet>
portlets
- the List instances of this model to clear the cache forprotected void cacheUniqueFindersCache(Portlet portlet)
protected void clearUniqueFindersCache(Portlet portlet)
public Portlet create(long id)
create
in interface PortletPersistence
id
- the primary key for the new portlet
public Portlet remove(long id) throws NoSuchPortletException, SystemException
remove
in interface PortletPersistence
id
- the primary key of the portlet
NoSuchPortletException
- if a portlet with the primary key could not be found
SystemException
- if a system exception occurredpublic Portlet remove(Serializable primaryKey) throws NoSuchPortletException, SystemException
remove
in interface BasePersistence<Portlet>
remove
in class BasePersistenceImpl<Portlet>
primaryKey
- the primary key of the portlet
NoSuchPortletException
- if a portlet with the primary key could not be found
SystemException
- if a system exception occurredprotected Portlet removeImpl(Portlet portlet) throws SystemException
BasePersistenceImpl
BasePersistenceImpl.update(BaseModel,
boolean)
depends on this method to implement the remove operation; it
only notifies the model listeners.
removeImpl
in class BasePersistenceImpl<Portlet>
portlet
- the model instance to remove
SystemException
- if a system exception occurredpublic Portlet updateImpl(Portlet portlet) throws SystemException
BasePersistenceImpl
BasePersistenceImpl.remove(BaseModel)
depends on this method to implement the
update operation; it only notifies the model listeners.
updateImpl
in interface PortletPersistence
updateImpl
in class BasePersistenceImpl<Portlet>
portlet
- the model instance to update
SystemException
- if a system exception occurredprotected Portlet toUnwrappedModel(Portlet portlet)
public Portlet findByPrimaryKey(Serializable primaryKey) throws NoSuchPortletException, SystemException
NoSuchModelException
if it could not be found.
findByPrimaryKey
in interface BasePersistence<Portlet>
findByPrimaryKey
in class BasePersistenceImpl<Portlet>
primaryKey
- the primary key of the portlet
NoSuchPortletException
- if a portlet with the primary key could not be found
SystemException
- if a system exception occurredpublic Portlet findByPrimaryKey(long id) throws NoSuchPortletException, SystemException
NoSuchPortletException
if it could not be found.
findByPrimaryKey
in interface PortletPersistence
id
- the primary key of the portlet
NoSuchPortletException
- if a portlet with the primary key could not be found
SystemException
- if a system exception occurredpublic Portlet fetchByPrimaryKey(Serializable primaryKey) throws SystemException
null
if it could not be found.
fetchByPrimaryKey
in interface BasePersistence<Portlet>
fetchByPrimaryKey
in class BasePersistenceImpl<Portlet>
primaryKey
- the primary key of the portlet
null
if a portlet with the primary key could not be found
SystemException
- if a system exception occurredpublic Portlet fetchByPrimaryKey(long id) throws SystemException
null
if it could not be found.
fetchByPrimaryKey
in interface PortletPersistence
id
- the primary key of the portlet
null
if a portlet with the primary key could not be found
SystemException
- if a system exception occurredpublic List<Portlet> findAll() throws SystemException
findAll
in interface PortletPersistence
SystemException
- if a system exception occurredpublic List<Portlet> findAll(int start, int end) throws SystemException
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.
findAll
in interface PortletPersistence
start
- the lower bound of the range of portletsend
- the upper bound of the range of portlets (not inclusive)
SystemException
- if a system exception occurredpublic List<Portlet> findAll(int start, int end, OrderByComparator orderByComparator) throws SystemException
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.
findAll
in interface PortletPersistence
start
- the lower bound of the range of portletsend
- the upper bound of the range of portlets (not inclusive)orderByComparator
- the comparator to order the results by (optionally null
)
SystemException
- if a system exception occurredpublic void removeAll() throws SystemException
removeAll
in interface PortletPersistence
SystemException
- if a system exception occurredpublic int countAll() throws SystemException
countAll
in interface PortletPersistence
SystemException
- if a system exception occurredprotected Set<String> getBadColumnNames()
getBadColumnNames
in class BasePersistenceImpl<Portlet>
public void afterPropertiesSet()
public void destroy()
|
Liferay 6.2-ce-ga5 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |