@ProviderType
public class EntryUtil
extends java.lang.Object
com.liferay.contacts.service.persistence.impl.EntryPersistenceImpl
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
EntryPersistence
,
com.liferay.contacts.service.persistence.impl.EntryPersistenceImpl
Constructor and Description |
---|
EntryUtil() |
Modifier and Type | Method and Description |
---|---|
static void |
cacheResult(Entry entry)
Caches the entry in the entity cache if it is enabled.
|
static void |
cacheResult(java.util.List<Entry> entries)
Caches the entries in the entity cache if it is enabled.
|
static void |
clearCache() |
static void |
clearCache(Entry entry) |
static int |
countAll()
Returns the number of entries.
|
static int |
countByU_EA(long userId,
java.lang.String emailAddress)
Returns the number of entries where userId = ? and emailAddress = ?.
|
static int |
countByUserId(long userId)
Returns the number of entries where userId = ?.
|
static long |
countWithDynamicQuery(com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery) |
static Entry |
create(long entryId)
Creates a new entry with the primary key.
|
static Entry |
fetchByPrimaryKey(long entryId)
Returns the entry with the primary key or returns
null if it could not be found. |
static java.util.Map<java.io.Serializable,Entry> |
fetchByPrimaryKeys(java.util.Set<java.io.Serializable> primaryKeys) |
static Entry |
fetchByU_EA(long userId,
java.lang.String emailAddress)
Returns the entry where userId = ? and emailAddress = ? or returns
null if it could not be found. |
static Entry |
fetchByU_EA(long userId,
java.lang.String emailAddress,
boolean retrieveFromCache)
Returns the entry where userId = ? and emailAddress = ? or returns
null if it could not be found, optionally using the finder cache. |
static Entry |
fetchByUserId_First(long userId,
com.liferay.portal.kernel.util.OrderByComparator<Entry> orderByComparator)
Returns the first entry in the ordered set where userId = ?.
|
static Entry |
fetchByUserId_Last(long userId,
com.liferay.portal.kernel.util.OrderByComparator<Entry> orderByComparator)
Returns the last entry in the ordered set where userId = ?.
|
static java.util.List<Entry> |
findAll()
Returns all the entries.
|
static java.util.List<Entry> |
findAll(int start,
int end)
Returns a range of all the entries.
|
static java.util.List<Entry> |
findAll(int start,
int end,
com.liferay.portal.kernel.util.OrderByComparator<Entry> orderByComparator)
Returns an ordered range of all the entries.
|
static java.util.List<Entry> |
findAll(int start,
int end,
com.liferay.portal.kernel.util.OrderByComparator<Entry> orderByComparator,
boolean retrieveFromCache)
Returns an ordered range of all the entries.
|
static Entry |
findByPrimaryKey(long entryId)
Returns the entry with the primary key or throws a
NoSuchEntryException if it could not be found. |
static Entry |
findByU_EA(long userId,
java.lang.String emailAddress)
Returns the entry where userId = ? and emailAddress = ? or throws a
NoSuchEntryException if it could not be found. |
static Entry |
findByUserId_First(long userId,
com.liferay.portal.kernel.util.OrderByComparator<Entry> orderByComparator)
Returns the first entry in the ordered set where userId = ?.
|
static Entry |
findByUserId_Last(long userId,
com.liferay.portal.kernel.util.OrderByComparator<Entry> orderByComparator)
Returns the last entry in the ordered set where userId = ?.
|
static Entry[] |
findByUserId_PrevAndNext(long entryId,
long userId,
com.liferay.portal.kernel.util.OrderByComparator<Entry> orderByComparator)
Returns the entries before and after the current entry in the ordered set where userId = ?.
|
static java.util.List<Entry> |
findByUserId(long userId)
Returns all the entries where userId = ?.
|
static java.util.List<Entry> |
findByUserId(long userId,
int start,
int end)
Returns a range of all the entries where userId = ?.
|
static java.util.List<Entry> |
findByUserId(long userId,
int start,
int end,
com.liferay.portal.kernel.util.OrderByComparator<Entry> orderByComparator)
Returns an ordered range of all the entries where userId = ?.
|
static java.util.List<Entry> |
findByUserId(long userId,
int start,
int end,
com.liferay.portal.kernel.util.OrderByComparator<Entry> orderByComparator,
boolean retrieveFromCache)
Returns an ordered range of all the entries where userId = ?.
|
static java.util.List<Entry> |
findWithDynamicQuery(com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery) |
static java.util.List<Entry> |
findWithDynamicQuery(com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery,
int start,
int end) |
static java.util.List<Entry> |
findWithDynamicQuery(com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery,
int start,
int end,
com.liferay.portal.kernel.util.OrderByComparator<Entry> orderByComparator) |
static EntryPersistence |
getPersistence() |
static Entry |
remove(long entryId)
Removes the entry with the primary key from the database.
|
static void |
removeAll()
Removes all the entries from the database.
|
static Entry |
removeByU_EA(long userId,
java.lang.String emailAddress)
Removes the entry where userId = ? and emailAddress = ? from the database.
|
static void |
removeByUserId(long userId)
Removes all the entries where userId = ? from the database.
|
static Entry |
update(Entry entry) |
static Entry |
update(Entry entry,
com.liferay.portal.kernel.service.ServiceContext serviceContext) |
static Entry |
updateImpl(Entry entry) |
public static void clearCache()
BasePersistence.clearCache()
public static void clearCache(Entry entry)
BasePersistence.clearCache(com.liferay.portal.kernel.model.BaseModel)
public static long countWithDynamicQuery(com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery)
BasePersistence.countWithDynamicQuery(DynamicQuery)
public static java.util.List<Entry> findWithDynamicQuery(com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery)
BasePersistence.findWithDynamicQuery(DynamicQuery)
public static java.util.List<Entry> findWithDynamicQuery(com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start, int end)
BasePersistence.findWithDynamicQuery(DynamicQuery, int, int)
public static java.util.List<Entry> findWithDynamicQuery(com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start, int end, com.liferay.portal.kernel.util.OrderByComparator<Entry> orderByComparator)
BasePersistence.findWithDynamicQuery(DynamicQuery, int, int, OrderByComparator)
public static Entry update(Entry entry)
BasePersistence.update(com.liferay.portal.kernel.model.BaseModel)
public static Entry update(Entry entry, com.liferay.portal.kernel.service.ServiceContext serviceContext)
BasePersistence.update(com.liferay.portal.kernel.model.BaseModel, ServiceContext)
public static java.util.List<Entry> findByUserId(long userId)
userId
- the user IDpublic static java.util.List<Entry> findByUserId(long userId, 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 and pagination is required (start
and end
are not QueryUtil#ALL_POS
), then the query will include the default ORDER BY logic from EntryModelImpl
. 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.
userId
- the user IDstart
- the lower bound of the range of entriesend
- the upper bound of the range of entries (not inclusive)public static java.util.List<Entry> findByUserId(long userId, int start, int end, com.liferay.portal.kernel.util.OrderByComparator<Entry> 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 and pagination is required (start
and end
are not QueryUtil#ALL_POS
), then the query will include the default ORDER BY logic from EntryModelImpl
. 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.
userId
- the user IDstart
- the lower bound of the range of entriesend
- the upper bound of the range of entries (not inclusive)orderByComparator
- the comparator to order the results by (optionally null
)public static java.util.List<Entry> findByUserId(long userId, int start, int end, com.liferay.portal.kernel.util.OrderByComparator<Entry> orderByComparator, boolean retrieveFromCache)
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 EntryModelImpl
. 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.
userId
- the user IDstart
- the lower bound of the range of entriesend
- the upper bound of the range of entries (not inclusive)orderByComparator
- the comparator to order the results by (optionally null
)retrieveFromCache
- whether to retrieve from the finder cachepublic static Entry findByUserId_First(long userId, com.liferay.portal.kernel.util.OrderByComparator<Entry> orderByComparator) throws NoSuchEntryException
userId
- the user IDorderByComparator
- the comparator to order the set by (optionally null
)NoSuchEntryException
- if a matching entry could not be foundpublic static Entry fetchByUserId_First(long userId, com.liferay.portal.kernel.util.OrderByComparator<Entry> orderByComparator)
userId
- the user IDorderByComparator
- the comparator to order the set by (optionally null
)null
if a matching entry could not be foundpublic static Entry findByUserId_Last(long userId, com.liferay.portal.kernel.util.OrderByComparator<Entry> orderByComparator) throws NoSuchEntryException
userId
- the user IDorderByComparator
- the comparator to order the set by (optionally null
)NoSuchEntryException
- if a matching entry could not be foundpublic static Entry fetchByUserId_Last(long userId, com.liferay.portal.kernel.util.OrderByComparator<Entry> orderByComparator)
userId
- the user IDorderByComparator
- the comparator to order the set by (optionally null
)null
if a matching entry could not be foundpublic static Entry[] findByUserId_PrevAndNext(long entryId, long userId, com.liferay.portal.kernel.util.OrderByComparator<Entry> orderByComparator) throws NoSuchEntryException
entryId
- the primary key of the current entryuserId
- the user IDorderByComparator
- the comparator to order the set by (optionally null
)NoSuchEntryException
- if a entry with the primary key could not be foundpublic static void removeByUserId(long userId)
userId
- the user IDpublic static int countByUserId(long userId)
userId
- the user IDpublic static Entry findByU_EA(long userId, java.lang.String emailAddress) throws NoSuchEntryException
NoSuchEntryException
if it could not be found.userId
- the user IDemailAddress
- the email addressNoSuchEntryException
- if a matching entry could not be foundpublic static Entry fetchByU_EA(long userId, java.lang.String emailAddress)
null
if it could not be found. Uses the finder cache.userId
- the user IDemailAddress
- the email addressnull
if a matching entry could not be foundpublic static Entry fetchByU_EA(long userId, java.lang.String emailAddress, boolean retrieveFromCache)
null
if it could not be found, optionally using the finder cache.userId
- the user IDemailAddress
- the email addressretrieveFromCache
- whether to retrieve from the finder cachenull
if a matching entry could not be foundpublic static Entry removeByU_EA(long userId, java.lang.String emailAddress) throws NoSuchEntryException
userId
- the user IDemailAddress
- the email addressNoSuchEntryException
public static int countByU_EA(long userId, java.lang.String emailAddress)
userId
- the user IDemailAddress
- the email addresspublic static void cacheResult(Entry entry)
entry
- the entrypublic static void cacheResult(java.util.List<Entry> entries)
entries
- the entriespublic static Entry create(long entryId)
entryId
- the primary key for the new entrypublic static Entry remove(long entryId) throws NoSuchEntryException
entryId
- the primary key of the entryNoSuchEntryException
- if a entry with the primary key could not be foundpublic static Entry findByPrimaryKey(long entryId) throws NoSuchEntryException
NoSuchEntryException
if it could not be found.entryId
- the primary key of the entryNoSuchEntryException
- if a entry with the primary key could not be foundpublic static Entry fetchByPrimaryKey(long entryId)
null
if it could not be found.entryId
- the primary key of the entrynull
if a entry with the primary key could not be foundpublic static java.util.Map<java.io.Serializable,Entry> fetchByPrimaryKeys(java.util.Set<java.io.Serializable> primaryKeys)
public static java.util.List<Entry> findAll()
public static java.util.List<Entry> 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 and pagination is required (start
and end
are not QueryUtil#ALL_POS
), then the query will include the default ORDER BY logic from EntryModelImpl
. 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.
start
- the lower bound of the range of entriesend
- the upper bound of the range of entries (not inclusive)public static java.util.List<Entry> findAll(int start, int end, com.liferay.portal.kernel.util.OrderByComparator<Entry> 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 and pagination is required (start
and end
are not QueryUtil#ALL_POS
), then the query will include the default ORDER BY logic from EntryModelImpl
. 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.
start
- the lower bound of the range of entriesend
- the upper bound of the range of entries (not inclusive)orderByComparator
- the comparator to order the results by (optionally null
)public static java.util.List<Entry> findAll(int start, int end, com.liferay.portal.kernel.util.OrderByComparator<Entry> orderByComparator, boolean retrieveFromCache)
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 EntryModelImpl
. 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.
start
- the lower bound of the range of entriesend
- the upper bound of the range of entries (not inclusive)orderByComparator
- the comparator to order the results by (optionally null
)retrieveFromCache
- whether to retrieve from the finder cachepublic static void removeAll()
public static int countAll()
public static EntryPersistence getPersistence()