public class PortletItemUtil
extends java.lang.Object
com.liferay.portal.service.persistence.impl.PortletItemPersistenceImpl
and provides direct access to the database for CRUD operations. This utility should only be used by the service layer, as it must operate within a transaction. Never access this utility in a JSP, controller, model, or other front-end class.
Caching information and settings can be found in portal.properties
PortletItemPersistence
Constructor and Description |
---|
PortletItemUtil() |
Modifier and Type | Method and Description |
---|---|
static void |
cacheResult(java.util.List<PortletItem> portletItems)
Caches the portlet items in the entity cache if it is enabled.
|
static void |
cacheResult(PortletItem portletItem)
Caches the portlet item in the entity cache if it is enabled.
|
static void |
clearCache() |
static void |
clearCache(PortletItem portletItem) |
static int |
countAll()
Returns the number of portlet items.
|
static int |
countByG_C(long groupId,
long classNameId)
Returns the number of portlet items where groupId = ? and classNameId = ?.
|
static int |
countByG_N_P_C(long groupId,
java.lang.String name,
java.lang.String portletId,
long classNameId)
Returns the number of portlet items where groupId = ? and name = ? and portletId = ? and classNameId = ?.
|
static int |
countByG_P_C(long groupId,
java.lang.String portletId,
long classNameId)
Returns the number of portlet items where groupId = ? and portletId = ? and classNameId = ?.
|
static long |
countWithDynamicQuery(DynamicQuery dynamicQuery) |
static PortletItem |
create(long portletItemId)
Creates a new portlet item with the primary key.
|
static PortletItem |
fetchByG_C_First(long groupId,
long classNameId,
OrderByComparator<PortletItem> orderByComparator)
Returns the first portlet item in the ordered set where groupId = ? and classNameId = ?.
|
static PortletItem |
fetchByG_C_Last(long groupId,
long classNameId,
OrderByComparator<PortletItem> orderByComparator)
Returns the last portlet item in the ordered set where groupId = ? and classNameId = ?.
|
static PortletItem |
fetchByG_N_P_C(long groupId,
java.lang.String name,
java.lang.String portletId,
long classNameId)
Returns the portlet item where groupId = ? and name = ? and portletId = ? and classNameId = ? or returns
null if it could not be found. |
static PortletItem |
fetchByG_N_P_C(long groupId,
java.lang.String name,
java.lang.String portletId,
long classNameId,
boolean useFinderCache)
Returns the portlet item where groupId = ? and name = ? and portletId = ? and classNameId = ? or returns
null if it could not be found, optionally using the finder cache. |
static PortletItem |
fetchByG_P_C_First(long groupId,
java.lang.String portletId,
long classNameId,
OrderByComparator<PortletItem> orderByComparator)
Returns the first portlet item in the ordered set where groupId = ? and portletId = ? and classNameId = ?.
|
static PortletItem |
fetchByG_P_C_Last(long groupId,
java.lang.String portletId,
long classNameId,
OrderByComparator<PortletItem> orderByComparator)
Returns the last portlet item in the ordered set where groupId = ? and portletId = ? and classNameId = ?.
|
static PortletItem |
fetchByPrimaryKey(long portletItemId)
Returns the portlet item with the primary key or returns
null if it could not be found. |
static java.util.Map<java.io.Serializable,PortletItem> |
fetchByPrimaryKeys(java.util.Set<java.io.Serializable> primaryKeys) |
static java.util.List<PortletItem> |
findAll()
Returns all the portlet items.
|
static java.util.List<PortletItem> |
findAll(int start,
int end)
Returns a range of all the portlet items.
|
static java.util.List<PortletItem> |
findAll(int start,
int end,
OrderByComparator<PortletItem> orderByComparator)
Returns an ordered range of all the portlet items.
|
static java.util.List<PortletItem> |
findAll(int start,
int end,
OrderByComparator<PortletItem> orderByComparator,
boolean useFinderCache)
Returns an ordered range of all the portlet items.
|
static PortletItem |
findByG_C_First(long groupId,
long classNameId,
OrderByComparator<PortletItem> orderByComparator)
Returns the first portlet item in the ordered set where groupId = ? and classNameId = ?.
|
static PortletItem |
findByG_C_Last(long groupId,
long classNameId,
OrderByComparator<PortletItem> orderByComparator)
Returns the last portlet item in the ordered set where groupId = ? and classNameId = ?.
|
static PortletItem[] |
findByG_C_PrevAndNext(long portletItemId,
long groupId,
long classNameId,
OrderByComparator<PortletItem> orderByComparator)
Returns the portlet items before and after the current portlet item in the ordered set where groupId = ? and classNameId = ?.
|
static java.util.List<PortletItem> |
findByG_C(long groupId,
long classNameId)
Returns all the portlet items where groupId = ? and classNameId = ?.
|
static java.util.List<PortletItem> |
findByG_C(long groupId,
long classNameId,
int start,
int end)
Returns a range of all the portlet items where groupId = ? and classNameId = ?.
|
static java.util.List<PortletItem> |
findByG_C(long groupId,
long classNameId,
int start,
int end,
OrderByComparator<PortletItem> orderByComparator)
Returns an ordered range of all the portlet items where groupId = ? and classNameId = ?.
|
static java.util.List<PortletItem> |
findByG_C(long groupId,
long classNameId,
int start,
int end,
OrderByComparator<PortletItem> orderByComparator,
boolean useFinderCache)
Returns an ordered range of all the portlet items where groupId = ? and classNameId = ?.
|
static PortletItem |
findByG_N_P_C(long groupId,
java.lang.String name,
java.lang.String portletId,
long classNameId)
Returns the portlet item where groupId = ? and name = ? and portletId = ? and classNameId = ? or throws a
NoSuchPortletItemException if it could not be found. |
static PortletItem |
findByG_P_C_First(long groupId,
java.lang.String portletId,
long classNameId,
OrderByComparator<PortletItem> orderByComparator)
Returns the first portlet item in the ordered set where groupId = ? and portletId = ? and classNameId = ?.
|
static PortletItem |
findByG_P_C_Last(long groupId,
java.lang.String portletId,
long classNameId,
OrderByComparator<PortletItem> orderByComparator)
Returns the last portlet item in the ordered set where groupId = ? and portletId = ? and classNameId = ?.
|
static PortletItem[] |
findByG_P_C_PrevAndNext(long portletItemId,
long groupId,
java.lang.String portletId,
long classNameId,
OrderByComparator<PortletItem> orderByComparator)
Returns the portlet items before and after the current portlet item in the ordered set where groupId = ? and portletId = ? and classNameId = ?.
|
static java.util.List<PortletItem> |
findByG_P_C(long groupId,
java.lang.String portletId,
long classNameId)
Returns all the portlet items where groupId = ? and portletId = ? and classNameId = ?.
|
static java.util.List<PortletItem> |
findByG_P_C(long groupId,
java.lang.String portletId,
long classNameId,
int start,
int end)
Returns a range of all the portlet items where groupId = ? and portletId = ? and classNameId = ?.
|
static java.util.List<PortletItem> |
findByG_P_C(long groupId,
java.lang.String portletId,
long classNameId,
int start,
int end,
OrderByComparator<PortletItem> orderByComparator)
Returns an ordered range of all the portlet items where groupId = ? and portletId = ? and classNameId = ?.
|
static java.util.List<PortletItem> |
findByG_P_C(long groupId,
java.lang.String portletId,
long classNameId,
int start,
int end,
OrderByComparator<PortletItem> orderByComparator,
boolean useFinderCache)
Returns an ordered range of all the portlet items where groupId = ? and portletId = ? and classNameId = ?.
|
static PortletItem |
findByPrimaryKey(long portletItemId)
Returns the portlet item with the primary key or throws a
NoSuchPortletItemException if it could not be found. |
static java.util.List<PortletItem> |
findWithDynamicQuery(DynamicQuery dynamicQuery) |
static java.util.List<PortletItem> |
findWithDynamicQuery(DynamicQuery dynamicQuery,
int start,
int end) |
static java.util.List<PortletItem> |
findWithDynamicQuery(DynamicQuery dynamicQuery,
int start,
int end,
OrderByComparator<PortletItem> orderByComparator) |
static PortletItemPersistence |
getPersistence() |
static PortletItem |
remove(long portletItemId)
Removes the portlet item with the primary key from the database.
|
static void |
removeAll()
Removes all the portlet items from the database.
|
static void |
removeByG_C(long groupId,
long classNameId)
Removes all the portlet items where groupId = ? and classNameId = ? from the database.
|
static PortletItem |
removeByG_N_P_C(long groupId,
java.lang.String name,
java.lang.String portletId,
long classNameId)
Removes the portlet item where groupId = ? and name = ? and portletId = ? and classNameId = ? from the database.
|
static void |
removeByG_P_C(long groupId,
java.lang.String portletId,
long classNameId)
Removes all the portlet items where groupId = ? and portletId = ? and classNameId = ? from the database.
|
static PortletItem |
update(PortletItem portletItem) |
static PortletItem |
update(PortletItem portletItem,
ServiceContext serviceContext) |
static PortletItem |
updateImpl(PortletItem portletItem) |
public static void clearCache()
BasePersistence.clearCache()
public static void clearCache(PortletItem portletItem)
public static long countWithDynamicQuery(DynamicQuery dynamicQuery)
public static java.util.Map<java.io.Serializable,PortletItem> fetchByPrimaryKeys(java.util.Set<java.io.Serializable> primaryKeys)
BasePersistence.fetchByPrimaryKeys(Set)
public static java.util.List<PortletItem> findWithDynamicQuery(DynamicQuery dynamicQuery)
public static java.util.List<PortletItem> findWithDynamicQuery(DynamicQuery dynamicQuery, int start, int end)
public static java.util.List<PortletItem> findWithDynamicQuery(DynamicQuery dynamicQuery, int start, int end, OrderByComparator<PortletItem> orderByComparator)
public static PortletItem update(PortletItem portletItem)
public static PortletItem update(PortletItem portletItem, ServiceContext serviceContext)
public static java.util.List<PortletItem> findByG_C(long groupId, long classNameId)
groupId
- the group IDclassNameId
- the class name IDpublic static java.util.List<PortletItem> findByG_C(long groupId, long classNameId, int start, int end)
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, then the query will include the default ORDER BY logic from PortletItemModelImpl
.
groupId
- the group IDclassNameId
- the class name IDstart
- the lower bound of the range of portlet itemsend
- the upper bound of the range of portlet items (not inclusive)public static java.util.List<PortletItem> findByG_C(long groupId, long classNameId, int start, int end, OrderByComparator<PortletItem> orderByComparator)
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, then the query will include the default ORDER BY logic from PortletItemModelImpl
.
groupId
- the group IDclassNameId
- the class name IDstart
- the lower bound of the range of portlet itemsend
- the upper bound of the range of portlet items (not inclusive)orderByComparator
- the comparator to order the results by (optionally null
)public static java.util.List<PortletItem> findByG_C(long groupId, long classNameId, int start, int end, OrderByComparator<PortletItem> orderByComparator, boolean useFinderCache)
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, then the query will include the default ORDER BY logic from PortletItemModelImpl
.
groupId
- the group IDclassNameId
- the class name IDstart
- the lower bound of the range of portlet itemsend
- the upper bound of the range of portlet items (not inclusive)orderByComparator
- the comparator to order the results by (optionally null
)useFinderCache
- whether to use the finder cachepublic static PortletItem findByG_C_First(long groupId, long classNameId, OrderByComparator<PortletItem> orderByComparator) throws NoSuchPortletItemException
groupId
- the group IDclassNameId
- the class name IDorderByComparator
- the comparator to order the set by (optionally null
)NoSuchPortletItemException
- if a matching portlet item could not be foundpublic static PortletItem fetchByG_C_First(long groupId, long classNameId, OrderByComparator<PortletItem> orderByComparator)
groupId
- the group IDclassNameId
- the class name IDorderByComparator
- the comparator to order the set by (optionally null
)null
if a matching portlet item could not be foundpublic static PortletItem findByG_C_Last(long groupId, long classNameId, OrderByComparator<PortletItem> orderByComparator) throws NoSuchPortletItemException
groupId
- the group IDclassNameId
- the class name IDorderByComparator
- the comparator to order the set by (optionally null
)NoSuchPortletItemException
- if a matching portlet item could not be foundpublic static PortletItem fetchByG_C_Last(long groupId, long classNameId, OrderByComparator<PortletItem> orderByComparator)
groupId
- the group IDclassNameId
- the class name IDorderByComparator
- the comparator to order the set by (optionally null
)null
if a matching portlet item could not be foundpublic static PortletItem[] findByG_C_PrevAndNext(long portletItemId, long groupId, long classNameId, OrderByComparator<PortletItem> orderByComparator) throws NoSuchPortletItemException
portletItemId
- the primary key of the current portlet itemgroupId
- the group IDclassNameId
- the class name IDorderByComparator
- the comparator to order the set by (optionally null
)NoSuchPortletItemException
- if a portlet item with the primary key could not be foundpublic static void removeByG_C(long groupId, long classNameId)
groupId
- the group IDclassNameId
- the class name IDpublic static int countByG_C(long groupId, long classNameId)
groupId
- the group IDclassNameId
- the class name IDpublic static java.util.List<PortletItem> findByG_P_C(long groupId, java.lang.String portletId, long classNameId)
groupId
- the group IDportletId
- the portlet IDclassNameId
- the class name IDpublic static java.util.List<PortletItem> findByG_P_C(long groupId, java.lang.String portletId, long classNameId, int start, int end)
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, then the query will include the default ORDER BY logic from PortletItemModelImpl
.
groupId
- the group IDportletId
- the portlet IDclassNameId
- the class name IDstart
- the lower bound of the range of portlet itemsend
- the upper bound of the range of portlet items (not inclusive)public static java.util.List<PortletItem> findByG_P_C(long groupId, java.lang.String portletId, long classNameId, int start, int end, OrderByComparator<PortletItem> orderByComparator)
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, then the query will include the default ORDER BY logic from PortletItemModelImpl
.
groupId
- the group IDportletId
- the portlet IDclassNameId
- the class name IDstart
- the lower bound of the range of portlet itemsend
- the upper bound of the range of portlet items (not inclusive)orderByComparator
- the comparator to order the results by (optionally null
)public static java.util.List<PortletItem> findByG_P_C(long groupId, java.lang.String portletId, long classNameId, int start, int end, OrderByComparator<PortletItem> orderByComparator, boolean useFinderCache)
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, then the query will include the default ORDER BY logic from PortletItemModelImpl
.
groupId
- the group IDportletId
- the portlet IDclassNameId
- the class name IDstart
- the lower bound of the range of portlet itemsend
- the upper bound of the range of portlet items (not inclusive)orderByComparator
- the comparator to order the results by (optionally null
)useFinderCache
- whether to use the finder cachepublic static PortletItem findByG_P_C_First(long groupId, java.lang.String portletId, long classNameId, OrderByComparator<PortletItem> orderByComparator) throws NoSuchPortletItemException
groupId
- the group IDportletId
- the portlet IDclassNameId
- the class name IDorderByComparator
- the comparator to order the set by (optionally null
)NoSuchPortletItemException
- if a matching portlet item could not be foundpublic static PortletItem fetchByG_P_C_First(long groupId, java.lang.String portletId, long classNameId, OrderByComparator<PortletItem> orderByComparator)
groupId
- the group IDportletId
- the portlet IDclassNameId
- the class name IDorderByComparator
- the comparator to order the set by (optionally null
)null
if a matching portlet item could not be foundpublic static PortletItem findByG_P_C_Last(long groupId, java.lang.String portletId, long classNameId, OrderByComparator<PortletItem> orderByComparator) throws NoSuchPortletItemException
groupId
- the group IDportletId
- the portlet IDclassNameId
- the class name IDorderByComparator
- the comparator to order the set by (optionally null
)NoSuchPortletItemException
- if a matching portlet item could not be foundpublic static PortletItem fetchByG_P_C_Last(long groupId, java.lang.String portletId, long classNameId, OrderByComparator<PortletItem> orderByComparator)
groupId
- the group IDportletId
- the portlet IDclassNameId
- the class name IDorderByComparator
- the comparator to order the set by (optionally null
)null
if a matching portlet item could not be foundpublic static PortletItem[] findByG_P_C_PrevAndNext(long portletItemId, long groupId, java.lang.String portletId, long classNameId, OrderByComparator<PortletItem> orderByComparator) throws NoSuchPortletItemException
portletItemId
- the primary key of the current portlet itemgroupId
- the group IDportletId
- the portlet IDclassNameId
- the class name IDorderByComparator
- the comparator to order the set by (optionally null
)NoSuchPortletItemException
- if a portlet item with the primary key could not be foundpublic static void removeByG_P_C(long groupId, java.lang.String portletId, long classNameId)
groupId
- the group IDportletId
- the portlet IDclassNameId
- the class name IDpublic static int countByG_P_C(long groupId, java.lang.String portletId, long classNameId)
groupId
- the group IDportletId
- the portlet IDclassNameId
- the class name IDpublic static PortletItem findByG_N_P_C(long groupId, java.lang.String name, java.lang.String portletId, long classNameId) throws NoSuchPortletItemException
NoSuchPortletItemException
if it could not be found.groupId
- the group IDname
- the nameportletId
- the portlet IDclassNameId
- the class name IDNoSuchPortletItemException
- if a matching portlet item could not be foundpublic static PortletItem fetchByG_N_P_C(long groupId, java.lang.String name, java.lang.String portletId, long classNameId)
null
if it could not be found. Uses the finder cache.groupId
- the group IDname
- the nameportletId
- the portlet IDclassNameId
- the class name IDnull
if a matching portlet item could not be foundpublic static PortletItem fetchByG_N_P_C(long groupId, java.lang.String name, java.lang.String portletId, long classNameId, boolean useFinderCache)
null
if it could not be found, optionally using the finder cache.groupId
- the group IDname
- the nameportletId
- the portlet IDclassNameId
- the class name IDuseFinderCache
- whether to use the finder cachenull
if a matching portlet item could not be foundpublic static PortletItem removeByG_N_P_C(long groupId, java.lang.String name, java.lang.String portletId, long classNameId) throws NoSuchPortletItemException
groupId
- the group IDname
- the nameportletId
- the portlet IDclassNameId
- the class name IDNoSuchPortletItemException
public static int countByG_N_P_C(long groupId, java.lang.String name, java.lang.String portletId, long classNameId)
groupId
- the group IDname
- the nameportletId
- the portlet IDclassNameId
- the class name IDpublic static void cacheResult(PortletItem portletItem)
portletItem
- the portlet itempublic static void cacheResult(java.util.List<PortletItem> portletItems)
portletItems
- the portlet itemspublic static PortletItem create(long portletItemId)
portletItemId
- the primary key for the new portlet itempublic static PortletItem remove(long portletItemId) throws NoSuchPortletItemException
portletItemId
- the primary key of the portlet itemNoSuchPortletItemException
- if a portlet item with the primary key could not be foundpublic static PortletItem updateImpl(PortletItem portletItem)
public static PortletItem findByPrimaryKey(long portletItemId) throws NoSuchPortletItemException
NoSuchPortletItemException
if it could not be found.portletItemId
- the primary key of the portlet itemNoSuchPortletItemException
- if a portlet item with the primary key could not be foundpublic static PortletItem fetchByPrimaryKey(long portletItemId)
null
if it could not be found.portletItemId
- the primary key of the portlet itemnull
if a portlet item with the primary key could not be foundpublic static java.util.List<PortletItem> findAll()
public static java.util.List<PortletItem> findAll(int start, int end)
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, then the query will include the default ORDER BY logic from PortletItemModelImpl
.
start
- the lower bound of the range of portlet itemsend
- the upper bound of the range of portlet items (not inclusive)public static java.util.List<PortletItem> findAll(int start, int end, OrderByComparator<PortletItem> orderByComparator)
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, then the query will include the default ORDER BY logic from PortletItemModelImpl
.
start
- the lower bound of the range of portlet itemsend
- the upper bound of the range of portlet items (not inclusive)orderByComparator
- the comparator to order the results by (optionally null
)public static java.util.List<PortletItem> findAll(int start, int end, OrderByComparator<PortletItem> orderByComparator, boolean useFinderCache)
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, then the query will include the default ORDER BY logic from PortletItemModelImpl
.
start
- the lower bound of the range of portlet itemsend
- the upper bound of the range of portlet items (not inclusive)orderByComparator
- the comparator to order the results by (optionally null
)useFinderCache
- whether to use the finder cachepublic static void removeAll()
public static int countAll()
public static PortletItemPersistence getPersistence()