Class EntryUtil
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
- See Also:
- Generated:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic void
cacheResult
(Entry entry) Caches the entry in the entity cache if it is enabled.static void
cacheResult
(List<Entry> entries) Caches the entries in the entity cache if it is enabled.static void
static void
clearCache
(Entry entry) static int
countAll()
Returns the number of entries.static int
countByU_EA
(long userId, 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 returnsnull
if it could not be found.static Map<Serializable,
Entry> fetchByPrimaryKeys
(Set<Serializable> primaryKeys) static Entry
fetchByU_EA
(long userId, String emailAddress) Returns the entry where userId = ? and emailAddress = ? or returnsnull
if it could not be found.static Entry
fetchByU_EA
(long userId, String emailAddress, boolean useFinderCache) Returns the entry where userId = ? and emailAddress = ? or returnsnull
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 = ?.findAll()
Returns all the entries.findAll
(int start, int end) Returns a range of all the entries.findAll
(int start, int end, com.liferay.portal.kernel.util.OrderByComparator<Entry> orderByComparator) Returns an ordered range of all the entries.findAll
(int start, int end, com.liferay.portal.kernel.util.OrderByComparator<Entry> orderByComparator, boolean useFinderCache) Returns an ordered range of all the entries.static Entry
findByPrimaryKey
(long entryId) Returns the entry with the primary key or throws aNoSuchEntryException
if it could not be found.static Entry
findByU_EA
(long userId, String emailAddress) Returns the entry where userId = ? and emailAddress = ? or throws aNoSuchEntryException
if it could not be found.findByUserId
(long userId) Returns all the entries where userId = ?.findByUserId
(long userId, int start, int end) Returns a range of all the entries where userId = ?.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 = ?.findByUserId
(long userId, int start, int end, com.liferay.portal.kernel.util.OrderByComparator<Entry> orderByComparator, boolean useFinderCache) Returns an ordered range of all the entries where userId = ?.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 = ?.findWithDynamicQuery
(com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery) findWithDynamicQuery
(com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start, int end) findWithDynamicQuery
(com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start, int end, com.liferay.portal.kernel.util.OrderByComparator<Entry> orderByComparator) static EntryPersistence
static Entry
remove
(long entryId) Removes the entry with the primary key from the database.static void
Removes all the entries from the database.static Entry
removeByU_EA
(long userId, 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 void
setPersistence
(EntryPersistence persistence) static Entry
static Entry
static Entry
updateImpl
(Entry entry)
-
Constructor Details
-
EntryUtil
public EntryUtil()
-
-
Method Details
-
clearCache
public static void clearCache()- See Also:
-
BasePersistence.clearCache()
-
clearCache
- See Also:
-
BasePersistence.clearCache(com.liferay.portal.kernel.model.BaseModel)
-
countWithDynamicQuery
public static long countWithDynamicQuery(com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery) - See Also:
-
BasePersistence.countWithDynamicQuery(DynamicQuery)
-
fetchByPrimaryKeys
- See Also:
-
BasePersistence.fetchByPrimaryKeys(Set)
-
findWithDynamicQuery
public static List<Entry> findWithDynamicQuery(com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery) - See Also:
-
BasePersistence.findWithDynamicQuery(DynamicQuery)
-
findWithDynamicQuery
public static List<Entry> findWithDynamicQuery(com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start, int end) - See Also:
-
BasePersistence.findWithDynamicQuery(DynamicQuery, int, int)
-
findWithDynamicQuery
public static List<Entry> findWithDynamicQuery(com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start, int end, com.liferay.portal.kernel.util.OrderByComparator<Entry> orderByComparator) - See Also:
-
BasePersistence.findWithDynamicQuery(DynamicQuery, int, int, OrderByComparator)
-
update
- See Also:
-
BasePersistence.update(com.liferay.portal.kernel.model.BaseModel)
-
update
public static Entry update(Entry entry, com.liferay.portal.kernel.service.ServiceContext serviceContext) - See Also:
-
BasePersistence.update(com.liferay.portal.kernel.model.BaseModel, ServiceContext)
-
findByUserId
Returns all the entries where userId = ?.- Parameters:
userId
- the user ID- Returns:
- the matching entries
-
findByUserId
Returns a range of all the entries where userId = ?.Useful when paginating results. Returns a maximum of
end - start
instances.start
andend
are not primary keys, they are indexes in the result set. Thus,0
refers to the first result in the set. Setting bothstart
andend
toQueryUtil#ALL_POS
will return the full result set. IforderByComparator
is specified, then the query will include the given ORDER BY logic. IforderByComparator
is absent, then the query will include the default ORDER BY logic fromEntryModelImpl
.- Parameters:
userId
- the user IDstart
- the lower bound of the range of entriesend
- the upper bound of the range of entries (not inclusive)- Returns:
- the range of matching entries
-
findByUserId
public static 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 = ?.Useful when paginating results. Returns a maximum of
end - start
instances.start
andend
are not primary keys, they are indexes in the result set. Thus,0
refers to the first result in the set. Setting bothstart
andend
toQueryUtil#ALL_POS
will return the full result set. IforderByComparator
is specified, then the query will include the given ORDER BY logic. IforderByComparator
is absent, then the query will include the default ORDER BY logic fromEntryModelImpl
.- Parameters:
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 (optionallynull
)- Returns:
- the ordered range of matching entries
-
findByUserId
public static List<Entry> findByUserId(long userId, int start, int end, com.liferay.portal.kernel.util.OrderByComparator<Entry> orderByComparator, boolean useFinderCache) Returns an ordered range of all the entries where userId = ?.Useful when paginating results. Returns a maximum of
end - start
instances.start
andend
are not primary keys, they are indexes in the result set. Thus,0
refers to the first result in the set. Setting bothstart
andend
toQueryUtil#ALL_POS
will return the full result set. IforderByComparator
is specified, then the query will include the given ORDER BY logic. IforderByComparator
is absent, then the query will include the default ORDER BY logic fromEntryModelImpl
.- Parameters:
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 (optionallynull
)useFinderCache
- whether to use the finder cache- Returns:
- the ordered range of matching entries
-
findByUserId_First
public static Entry findByUserId_First(long userId, com.liferay.portal.kernel.util.OrderByComparator<Entry> orderByComparator) throws NoSuchEntryException Returns the first entry in the ordered set where userId = ?.- Parameters:
userId
- the user IDorderByComparator
- the comparator to order the set by (optionallynull
)- Returns:
- the first matching entry
- Throws:
NoSuchEntryException
- if a matching entry could not be foundNoSuchEntryException
-
fetchByUserId_First
public static Entry fetchByUserId_First(long userId, com.liferay.portal.kernel.util.OrderByComparator<Entry> orderByComparator) Returns the first entry in the ordered set where userId = ?.- Parameters:
userId
- the user IDorderByComparator
- the comparator to order the set by (optionallynull
)- Returns:
- the first matching entry, or
null
if a matching entry could not be found
-
findByUserId_Last
public static Entry findByUserId_Last(long userId, com.liferay.portal.kernel.util.OrderByComparator<Entry> orderByComparator) throws NoSuchEntryException Returns the last entry in the ordered set where userId = ?.- Parameters:
userId
- the user IDorderByComparator
- the comparator to order the set by (optionallynull
)- Returns:
- the last matching entry
- Throws:
NoSuchEntryException
- if a matching entry could not be foundNoSuchEntryException
-
fetchByUserId_Last
public static Entry fetchByUserId_Last(long userId, com.liferay.portal.kernel.util.OrderByComparator<Entry> orderByComparator) Returns the last entry in the ordered set where userId = ?.- Parameters:
userId
- the user IDorderByComparator
- the comparator to order the set by (optionallynull
)- Returns:
- the last matching entry, or
null
if a matching entry could not be found
-
findByUserId_PrevAndNext
public static Entry[] findByUserId_PrevAndNext(long entryId, long userId, com.liferay.portal.kernel.util.OrderByComparator<Entry> orderByComparator) throws NoSuchEntryException Returns the entries before and after the current entry in the ordered set where userId = ?.- Parameters:
entryId
- the primary key of the current entryuserId
- the user IDorderByComparator
- the comparator to order the set by (optionallynull
)- Returns:
- the previous, current, and next entry
- Throws:
NoSuchEntryException
- if a entry with the primary key could not be foundNoSuchEntryException
-
removeByUserId
public static void removeByUserId(long userId) Removes all the entries where userId = ? from the database.- Parameters:
userId
- the user ID
-
countByUserId
public static int countByUserId(long userId) Returns the number of entries where userId = ?.- Parameters:
userId
- the user ID- Returns:
- the number of matching entries
-
findByU_EA
Returns the entry where userId = ? and emailAddress = ? or throws aNoSuchEntryException
if it could not be found.- Parameters:
userId
- the user IDemailAddress
- the email address- Returns:
- the matching entry
- Throws:
NoSuchEntryException
- if a matching entry could not be foundNoSuchEntryException
-
fetchByU_EA
Returns the entry where userId = ? and emailAddress = ? or returnsnull
if it could not be found. Uses the finder cache.- Parameters:
userId
- the user IDemailAddress
- the email address- Returns:
- the matching entry, or
null
if a matching entry could not be found
-
fetchByU_EA
Returns the entry where userId = ? and emailAddress = ? or returnsnull
if it could not be found, optionally using the finder cache.- Parameters:
userId
- the user IDemailAddress
- the email addressuseFinderCache
- whether to use the finder cache- Returns:
- the matching entry, or
null
if a matching entry could not be found
-
removeByU_EA
Removes the entry where userId = ? and emailAddress = ? from the database.- Parameters:
userId
- the user IDemailAddress
- the email address- Returns:
- the entry that was removed
- Throws:
NoSuchEntryException
-
countByU_EA
Returns the number of entries where userId = ? and emailAddress = ?.- Parameters:
userId
- the user IDemailAddress
- the email address- Returns:
- the number of matching entries
-
cacheResult
Caches the entry in the entity cache if it is enabled.- Parameters:
entry
- the entry
-
cacheResult
Caches the entries in the entity cache if it is enabled.- Parameters:
entries
- the entries
-
create
Creates a new entry with the primary key. Does not add the entry to the database.- Parameters:
entryId
- the primary key for the new entry- Returns:
- the new entry
-
remove
Removes the entry with the primary key from the database. Also notifies the appropriate model listeners.- Parameters:
entryId
- the primary key of the entry- Returns:
- the entry that was removed
- Throws:
NoSuchEntryException
- if a entry with the primary key could not be foundNoSuchEntryException
-
updateImpl
-
findByPrimaryKey
Returns the entry with the primary key or throws aNoSuchEntryException
if it could not be found.- Parameters:
entryId
- the primary key of the entry- Returns:
- the entry
- Throws:
NoSuchEntryException
- if a entry with the primary key could not be foundNoSuchEntryException
-
fetchByPrimaryKey
Returns the entry with the primary key or returnsnull
if it could not be found.- Parameters:
entryId
- the primary key of the entry- Returns:
- the entry, or
null
if a entry with the primary key could not be found
-
findAll
Returns all the entries.- Returns:
- the entries
-
findAll
Returns a range of all the entries.Useful when paginating results. Returns a maximum of
end - start
instances.start
andend
are not primary keys, they are indexes in the result set. Thus,0
refers to the first result in the set. Setting bothstart
andend
toQueryUtil#ALL_POS
will return the full result set. IforderByComparator
is specified, then the query will include the given ORDER BY logic. IforderByComparator
is absent, then the query will include the default ORDER BY logic fromEntryModelImpl
.- Parameters:
start
- the lower bound of the range of entriesend
- the upper bound of the range of entries (not inclusive)- Returns:
- the range of entries
-
findAll
public static List<Entry> findAll(int start, int end, com.liferay.portal.kernel.util.OrderByComparator<Entry> orderByComparator) Returns an ordered range of all the entries.Useful when paginating results. Returns a maximum of
end - start
instances.start
andend
are not primary keys, they are indexes in the result set. Thus,0
refers to the first result in the set. Setting bothstart
andend
toQueryUtil#ALL_POS
will return the full result set. IforderByComparator
is specified, then the query will include the given ORDER BY logic. IforderByComparator
is absent, then the query will include the default ORDER BY logic fromEntryModelImpl
.- Parameters:
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 (optionallynull
)- Returns:
- the ordered range of entries
-
findAll
public static List<Entry> findAll(int start, int end, com.liferay.portal.kernel.util.OrderByComparator<Entry> orderByComparator, boolean useFinderCache) Returns an ordered range of all the entries.Useful when paginating results. Returns a maximum of
end - start
instances.start
andend
are not primary keys, they are indexes in the result set. Thus,0
refers to the first result in the set. Setting bothstart
andend
toQueryUtil#ALL_POS
will return the full result set. IforderByComparator
is specified, then the query will include the given ORDER BY logic. IforderByComparator
is absent, then the query will include the default ORDER BY logic fromEntryModelImpl
.- Parameters:
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 (optionallynull
)useFinderCache
- whether to use the finder cache- Returns:
- the ordered range of entries
-
removeAll
public static void removeAll()Removes all the entries from the database. -
countAll
public static int countAll()Returns the number of entries.- Returns:
- the number of entries
-
getPersistence
-
setPersistence
-