public class MessageUtil
extends java.lang.Object
com.liferay.mail.reader.service.persistence.impl.MessagePersistenceImpl
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
MessagePersistence
Constructor and Description |
---|
MessageUtil() |
Modifier and Type | Method and Description |
---|---|
static void |
cacheResult(java.util.List<Message> messages)
Caches the messages in the entity cache if it is enabled.
|
static void |
cacheResult(Message message)
Caches the message in the entity cache if it is enabled.
|
static void |
clearCache() |
static void |
clearCache(Message message) |
static int |
countAll()
Returns the number of messages.
|
static int |
countByCompanyId(long companyId)
Returns the number of messages where companyId = ?.
|
static int |
countByF_R(long folderId,
long remoteMessageId)
Returns the number of messages where folderId = ? and remoteMessageId = ?.
|
static int |
countByFolderId(long folderId)
Returns the number of messages where folderId = ?.
|
static long |
countWithDynamicQuery(com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery) |
static Message |
create(long messageId)
Creates a new message with the primary key.
|
static Message |
fetchByCompanyId_First(long companyId,
com.liferay.portal.kernel.util.OrderByComparator<Message> orderByComparator)
Returns the first message in the ordered set where companyId = ?.
|
static Message |
fetchByCompanyId_Last(long companyId,
com.liferay.portal.kernel.util.OrderByComparator<Message> orderByComparator)
Returns the last message in the ordered set where companyId = ?.
|
static Message |
fetchByF_R(long folderId,
long remoteMessageId)
Returns the message where folderId = ? and remoteMessageId = ? or returns
null if it could not be found. |
static Message |
fetchByF_R(long folderId,
long remoteMessageId,
boolean useFinderCache)
Returns the message where folderId = ? and remoteMessageId = ? or returns
null if it could not be found, optionally using the finder cache. |
static Message |
fetchByFolderId_First(long folderId,
com.liferay.portal.kernel.util.OrderByComparator<Message> orderByComparator)
Returns the first message in the ordered set where folderId = ?.
|
static Message |
fetchByFolderId_Last(long folderId,
com.liferay.portal.kernel.util.OrderByComparator<Message> orderByComparator)
Returns the last message in the ordered set where folderId = ?.
|
static Message |
fetchByPrimaryKey(long messageId)
Returns the message with the primary key or returns
null if it could not be found. |
static java.util.Map<java.io.Serializable,Message> |
fetchByPrimaryKeys(java.util.Set<java.io.Serializable> primaryKeys) |
static java.util.List<Message> |
findAll()
Returns all the messages.
|
static java.util.List<Message> |
findAll(int start,
int end)
Returns a range of all the messages.
|
static java.util.List<Message> |
findAll(int start,
int end,
com.liferay.portal.kernel.util.OrderByComparator<Message> orderByComparator)
Returns an ordered range of all the messages.
|
static java.util.List<Message> |
findAll(int start,
int end,
com.liferay.portal.kernel.util.OrderByComparator<Message> orderByComparator,
boolean useFinderCache)
Returns an ordered range of all the messages.
|
static Message |
findByCompanyId_First(long companyId,
com.liferay.portal.kernel.util.OrderByComparator<Message> orderByComparator)
Returns the first message in the ordered set where companyId = ?.
|
static Message |
findByCompanyId_Last(long companyId,
com.liferay.portal.kernel.util.OrderByComparator<Message> orderByComparator)
Returns the last message in the ordered set where companyId = ?.
|
static Message[] |
findByCompanyId_PrevAndNext(long messageId,
long companyId,
com.liferay.portal.kernel.util.OrderByComparator<Message> orderByComparator)
Returns the messages before and after the current message in the ordered set where companyId = ?.
|
static java.util.List<Message> |
findByCompanyId(long companyId)
Returns all the messages where companyId = ?.
|
static java.util.List<Message> |
findByCompanyId(long companyId,
int start,
int end)
Returns a range of all the messages where companyId = ?.
|
static java.util.List<Message> |
findByCompanyId(long companyId,
int start,
int end,
com.liferay.portal.kernel.util.OrderByComparator<Message> orderByComparator)
Returns an ordered range of all the messages where companyId = ?.
|
static java.util.List<Message> |
findByCompanyId(long companyId,
int start,
int end,
com.liferay.portal.kernel.util.OrderByComparator<Message> orderByComparator,
boolean useFinderCache)
Returns an ordered range of all the messages where companyId = ?.
|
static Message |
findByF_R(long folderId,
long remoteMessageId)
Returns the message where folderId = ? and remoteMessageId = ? or throws a
NoSuchMessageException if it could not be found. |
static Message |
findByFolderId_First(long folderId,
com.liferay.portal.kernel.util.OrderByComparator<Message> orderByComparator)
Returns the first message in the ordered set where folderId = ?.
|
static Message |
findByFolderId_Last(long folderId,
com.liferay.portal.kernel.util.OrderByComparator<Message> orderByComparator)
Returns the last message in the ordered set where folderId = ?.
|
static Message[] |
findByFolderId_PrevAndNext(long messageId,
long folderId,
com.liferay.portal.kernel.util.OrderByComparator<Message> orderByComparator)
Returns the messages before and after the current message in the ordered set where folderId = ?.
|
static java.util.List<Message> |
findByFolderId(long folderId)
Returns all the messages where folderId = ?.
|
static java.util.List<Message> |
findByFolderId(long folderId,
int start,
int end)
Returns a range of all the messages where folderId = ?.
|
static java.util.List<Message> |
findByFolderId(long folderId,
int start,
int end,
com.liferay.portal.kernel.util.OrderByComparator<Message> orderByComparator)
Returns an ordered range of all the messages where folderId = ?.
|
static java.util.List<Message> |
findByFolderId(long folderId,
int start,
int end,
com.liferay.portal.kernel.util.OrderByComparator<Message> orderByComparator,
boolean useFinderCache)
Returns an ordered range of all the messages where folderId = ?.
|
static Message |
findByPrimaryKey(long messageId)
Returns the message with the primary key or throws a
NoSuchMessageException if it could not be found. |
static java.util.List<Message> |
findWithDynamicQuery(com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery) |
static java.util.List<Message> |
findWithDynamicQuery(com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery,
int start,
int end) |
static java.util.List<Message> |
findWithDynamicQuery(com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery,
int start,
int end,
com.liferay.portal.kernel.util.OrderByComparator<Message> orderByComparator) |
static java.util.Set<java.lang.String> |
getBadColumnNames() |
static MessagePersistence |
getPersistence() |
static Message |
remove(long messageId)
Removes the message with the primary key from the database.
|
static void |
removeAll()
Removes all the messages from the database.
|
static void |
removeByCompanyId(long companyId)
Removes all the messages where companyId = ? from the database.
|
static Message |
removeByF_R(long folderId,
long remoteMessageId)
Removes the message where folderId = ? and remoteMessageId = ? from the database.
|
static void |
removeByFolderId(long folderId)
Removes all the messages where folderId = ? from the database.
|
static Message |
update(Message message) |
static Message |
update(Message message,
com.liferay.portal.kernel.service.ServiceContext serviceContext) |
static Message |
updateImpl(Message message) |
public static void clearCache()
BasePersistence.clearCache()
public static void clearCache(Message message)
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.Map<java.io.Serializable,Message> fetchByPrimaryKeys(java.util.Set<java.io.Serializable> primaryKeys)
BasePersistence.fetchByPrimaryKeys(Set)
public static java.util.List<Message> findWithDynamicQuery(com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery)
BasePersistence.findWithDynamicQuery(DynamicQuery)
public static java.util.List<Message> findWithDynamicQuery(com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start, int end)
BasePersistence.findWithDynamicQuery(DynamicQuery, int, int)
public static java.util.List<Message> findWithDynamicQuery(com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start, int end, com.liferay.portal.kernel.util.OrderByComparator<Message> orderByComparator)
BasePersistence.findWithDynamicQuery(DynamicQuery, int, int, OrderByComparator)
public static Message update(Message message)
BasePersistence.update(com.liferay.portal.kernel.model.BaseModel)
public static Message update(Message message, com.liferay.portal.kernel.service.ServiceContext serviceContext)
BasePersistence.update(com.liferay.portal.kernel.model.BaseModel, ServiceContext)
public static java.util.List<Message> findByCompanyId(long companyId)
companyId
- the company IDpublic static java.util.List<Message> findByCompanyId(long companyId, 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 MessageModelImpl
.
companyId
- the company IDstart
- the lower bound of the range of messagesend
- the upper bound of the range of messages (not inclusive)public static java.util.List<Message> findByCompanyId(long companyId, int start, int end, com.liferay.portal.kernel.util.OrderByComparator<Message> 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 MessageModelImpl
.
companyId
- the company IDstart
- the lower bound of the range of messagesend
- the upper bound of the range of messages (not inclusive)orderByComparator
- the comparator to order the results by (optionally null
)public static java.util.List<Message> findByCompanyId(long companyId, int start, int end, com.liferay.portal.kernel.util.OrderByComparator<Message> 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 MessageModelImpl
.
companyId
- the company IDstart
- the lower bound of the range of messagesend
- the upper bound of the range of messages (not inclusive)orderByComparator
- the comparator to order the results by (optionally null
)useFinderCache
- whether to use the finder cachepublic static Message findByCompanyId_First(long companyId, com.liferay.portal.kernel.util.OrderByComparator<Message> orderByComparator) throws NoSuchMessageException
companyId
- the company IDorderByComparator
- the comparator to order the set by (optionally null
)NoSuchMessageException
- if a matching message could not be foundpublic static Message fetchByCompanyId_First(long companyId, com.liferay.portal.kernel.util.OrderByComparator<Message> orderByComparator)
companyId
- the company IDorderByComparator
- the comparator to order the set by (optionally null
)null
if a matching message could not be foundpublic static Message findByCompanyId_Last(long companyId, com.liferay.portal.kernel.util.OrderByComparator<Message> orderByComparator) throws NoSuchMessageException
companyId
- the company IDorderByComparator
- the comparator to order the set by (optionally null
)NoSuchMessageException
- if a matching message could not be foundpublic static Message fetchByCompanyId_Last(long companyId, com.liferay.portal.kernel.util.OrderByComparator<Message> orderByComparator)
companyId
- the company IDorderByComparator
- the comparator to order the set by (optionally null
)null
if a matching message could not be foundpublic static Message[] findByCompanyId_PrevAndNext(long messageId, long companyId, com.liferay.portal.kernel.util.OrderByComparator<Message> orderByComparator) throws NoSuchMessageException
messageId
- the primary key of the current messagecompanyId
- the company IDorderByComparator
- the comparator to order the set by (optionally null
)NoSuchMessageException
- if a message with the primary key could not be foundpublic static void removeByCompanyId(long companyId)
companyId
- the company IDpublic static int countByCompanyId(long companyId)
companyId
- the company IDpublic static java.util.List<Message> findByFolderId(long folderId)
folderId
- the folder IDpublic static java.util.List<Message> findByFolderId(long folderId, 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 MessageModelImpl
.
folderId
- the folder IDstart
- the lower bound of the range of messagesend
- the upper bound of the range of messages (not inclusive)public static java.util.List<Message> findByFolderId(long folderId, int start, int end, com.liferay.portal.kernel.util.OrderByComparator<Message> 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 MessageModelImpl
.
folderId
- the folder IDstart
- the lower bound of the range of messagesend
- the upper bound of the range of messages (not inclusive)orderByComparator
- the comparator to order the results by (optionally null
)public static java.util.List<Message> findByFolderId(long folderId, int start, int end, com.liferay.portal.kernel.util.OrderByComparator<Message> 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 MessageModelImpl
.
folderId
- the folder IDstart
- the lower bound of the range of messagesend
- the upper bound of the range of messages (not inclusive)orderByComparator
- the comparator to order the results by (optionally null
)useFinderCache
- whether to use the finder cachepublic static Message findByFolderId_First(long folderId, com.liferay.portal.kernel.util.OrderByComparator<Message> orderByComparator) throws NoSuchMessageException
folderId
- the folder IDorderByComparator
- the comparator to order the set by (optionally null
)NoSuchMessageException
- if a matching message could not be foundpublic static Message fetchByFolderId_First(long folderId, com.liferay.portal.kernel.util.OrderByComparator<Message> orderByComparator)
folderId
- the folder IDorderByComparator
- the comparator to order the set by (optionally null
)null
if a matching message could not be foundpublic static Message findByFolderId_Last(long folderId, com.liferay.portal.kernel.util.OrderByComparator<Message> orderByComparator) throws NoSuchMessageException
folderId
- the folder IDorderByComparator
- the comparator to order the set by (optionally null
)NoSuchMessageException
- if a matching message could not be foundpublic static Message fetchByFolderId_Last(long folderId, com.liferay.portal.kernel.util.OrderByComparator<Message> orderByComparator)
folderId
- the folder IDorderByComparator
- the comparator to order the set by (optionally null
)null
if a matching message could not be foundpublic static Message[] findByFolderId_PrevAndNext(long messageId, long folderId, com.liferay.portal.kernel.util.OrderByComparator<Message> orderByComparator) throws NoSuchMessageException
messageId
- the primary key of the current messagefolderId
- the folder IDorderByComparator
- the comparator to order the set by (optionally null
)NoSuchMessageException
- if a message with the primary key could not be foundpublic static void removeByFolderId(long folderId)
folderId
- the folder IDpublic static int countByFolderId(long folderId)
folderId
- the folder IDpublic static Message findByF_R(long folderId, long remoteMessageId) throws NoSuchMessageException
NoSuchMessageException
if it could not be found.folderId
- the folder IDremoteMessageId
- the remote message IDNoSuchMessageException
- if a matching message could not be foundpublic static Message fetchByF_R(long folderId, long remoteMessageId)
null
if it could not be found. Uses the finder cache.folderId
- the folder IDremoteMessageId
- the remote message IDnull
if a matching message could not be foundpublic static Message fetchByF_R(long folderId, long remoteMessageId, boolean useFinderCache)
null
if it could not be found, optionally using the finder cache.folderId
- the folder IDremoteMessageId
- the remote message IDuseFinderCache
- whether to use the finder cachenull
if a matching message could not be foundpublic static Message removeByF_R(long folderId, long remoteMessageId) throws NoSuchMessageException
folderId
- the folder IDremoteMessageId
- the remote message IDNoSuchMessageException
public static int countByF_R(long folderId, long remoteMessageId)
folderId
- the folder IDremoteMessageId
- the remote message IDpublic static void cacheResult(Message message)
message
- the messagepublic static void cacheResult(java.util.List<Message> messages)
messages
- the messagespublic static Message create(long messageId)
messageId
- the primary key for the new messagepublic static Message remove(long messageId) throws NoSuchMessageException
messageId
- the primary key of the messageNoSuchMessageException
- if a message with the primary key could not be foundpublic static Message findByPrimaryKey(long messageId) throws NoSuchMessageException
NoSuchMessageException
if it could not be found.messageId
- the primary key of the messageNoSuchMessageException
- if a message with the primary key could not be foundpublic static Message fetchByPrimaryKey(long messageId)
null
if it could not be found.messageId
- the primary key of the messagenull
if a message with the primary key could not be foundpublic static java.util.List<Message> findAll()
public static java.util.List<Message> 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 MessageModelImpl
.
start
- the lower bound of the range of messagesend
- the upper bound of the range of messages (not inclusive)public static java.util.List<Message> findAll(int start, int end, com.liferay.portal.kernel.util.OrderByComparator<Message> 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 MessageModelImpl
.
start
- the lower bound of the range of messagesend
- the upper bound of the range of messages (not inclusive)orderByComparator
- the comparator to order the results by (optionally null
)public static java.util.List<Message> findAll(int start, int end, com.liferay.portal.kernel.util.OrderByComparator<Message> 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 MessageModelImpl
.
start
- the lower bound of the range of messagesend
- the upper bound of the range of messages (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 java.util.Set<java.lang.String> getBadColumnNames()
public static MessagePersistence getPersistence()