public class FolderUtil
extends java.lang.Object
com.liferay.mail.reader.service.persistence.impl.FolderPersistenceImpl
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
FolderPersistence
Constructor and Description |
---|
FolderUtil() |
Modifier and Type | Method and Description |
---|---|
static void |
cacheResult(Folder folder)
Caches the folder in the entity cache if it is enabled.
|
static void |
cacheResult(java.util.List<Folder> folders)
Caches the folders in the entity cache if it is enabled.
|
static void |
clearCache() |
static void |
clearCache(Folder folder) |
static int |
countAll()
Returns the number of folders.
|
static int |
countByA_F(long accountId,
java.lang.String fullName)
Returns the number of folders where accountId = ? and fullName = ?.
|
static int |
countByAccountId(long accountId)
Returns the number of folders where accountId = ?.
|
static long |
countWithDynamicQuery(DynamicQuery dynamicQuery) |
static Folder |
create(long folderId)
Creates a new folder with the primary key.
|
static Folder |
fetchByA_F(long accountId,
java.lang.String fullName)
Returns the folder where accountId = ? and fullName = ? or returns
null if it could not be found. |
static Folder |
fetchByA_F(long accountId,
java.lang.String fullName,
boolean useFinderCache)
Returns the folder where accountId = ? and fullName = ? or returns
null if it could not be found, optionally using the finder cache. |
static Folder |
fetchByAccountId_First(long accountId,
OrderByComparator<Folder> orderByComparator)
Returns the first folder in the ordered set where accountId = ?.
|
static Folder |
fetchByAccountId_Last(long accountId,
OrderByComparator<Folder> orderByComparator)
Returns the last folder in the ordered set where accountId = ?.
|
static Folder |
fetchByPrimaryKey(long folderId)
Returns the folder with the primary key or returns
null if it could not be found. |
static java.util.Map<java.io.Serializable,Folder> |
fetchByPrimaryKeys(java.util.Set<java.io.Serializable> primaryKeys) |
static java.util.List<Folder> |
findAll()
Returns all the folders.
|
static java.util.List<Folder> |
findAll(int start,
int end)
Returns a range of all the folders.
|
static java.util.List<Folder> |
findAll(int start,
int end,
OrderByComparator<Folder> orderByComparator)
Returns an ordered range of all the folders.
|
static java.util.List<Folder> |
findAll(int start,
int end,
OrderByComparator<Folder> orderByComparator,
boolean useFinderCache)
Returns an ordered range of all the folders.
|
static Folder |
findByA_F(long accountId,
java.lang.String fullName)
Returns the folder where accountId = ? and fullName = ? or throws a
NoSuchFolderException if it could not be found. |
static Folder |
findByAccountId_First(long accountId,
OrderByComparator<Folder> orderByComparator)
Returns the first folder in the ordered set where accountId = ?.
|
static Folder |
findByAccountId_Last(long accountId,
OrderByComparator<Folder> orderByComparator)
Returns the last folder in the ordered set where accountId = ?.
|
static Folder[] |
findByAccountId_PrevAndNext(long folderId,
long accountId,
OrderByComparator<Folder> orderByComparator)
Returns the folders before and after the current folder in the ordered set where accountId = ?.
|
static java.util.List<Folder> |
findByAccountId(long accountId)
Returns all the folders where accountId = ?.
|
static java.util.List<Folder> |
findByAccountId(long accountId,
int start,
int end)
Returns a range of all the folders where accountId = ?.
|
static java.util.List<Folder> |
findByAccountId(long accountId,
int start,
int end,
OrderByComparator<Folder> orderByComparator)
Returns an ordered range of all the folders where accountId = ?.
|
static java.util.List<Folder> |
findByAccountId(long accountId,
int start,
int end,
OrderByComparator<Folder> orderByComparator,
boolean useFinderCache)
Returns an ordered range of all the folders where accountId = ?.
|
static Folder |
findByPrimaryKey(long folderId)
Returns the folder with the primary key or throws a
NoSuchFolderException if it could not be found. |
static java.util.List<Folder> |
findWithDynamicQuery(DynamicQuery dynamicQuery) |
static java.util.List<Folder> |
findWithDynamicQuery(DynamicQuery dynamicQuery,
int start,
int end) |
static java.util.List<Folder> |
findWithDynamicQuery(DynamicQuery dynamicQuery,
int start,
int end,
OrderByComparator<Folder> orderByComparator) |
static FolderPersistence |
getPersistence() |
static Folder |
remove(long folderId)
Removes the folder with the primary key from the database.
|
static void |
removeAll()
Removes all the folders from the database.
|
static Folder |
removeByA_F(long accountId,
java.lang.String fullName)
Removes the folder where accountId = ? and fullName = ? from the database.
|
static void |
removeByAccountId(long accountId)
Removes all the folders where accountId = ? from the database.
|
static Folder |
update(Folder folder) |
static Folder |
update(Folder folder,
ServiceContext serviceContext) |
static Folder |
updateImpl(Folder folder) |
public static void clearCache()
BasePersistence.clearCache()
public static void clearCache(Folder folder)
public static long countWithDynamicQuery(DynamicQuery dynamicQuery)
public static java.util.Map<java.io.Serializable,Folder> fetchByPrimaryKeys(java.util.Set<java.io.Serializable> primaryKeys)
BasePersistence.fetchByPrimaryKeys(Set)
public static java.util.List<Folder> findWithDynamicQuery(DynamicQuery dynamicQuery)
public static java.util.List<Folder> findWithDynamicQuery(DynamicQuery dynamicQuery, int start, int end)
public static java.util.List<Folder> findWithDynamicQuery(DynamicQuery dynamicQuery, int start, int end, OrderByComparator<Folder> orderByComparator)
public static Folder update(Folder folder, ServiceContext serviceContext)
public static java.util.List<Folder> findByAccountId(long accountId)
accountId
- the account IDpublic static java.util.List<Folder> findByAccountId(long accountId, 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 FolderModelImpl
.
accountId
- the account IDstart
- the lower bound of the range of foldersend
- the upper bound of the range of folders (not inclusive)public static java.util.List<Folder> findByAccountId(long accountId, int start, int end, OrderByComparator<Folder> 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 FolderModelImpl
.
accountId
- the account IDstart
- the lower bound of the range of foldersend
- the upper bound of the range of folders (not inclusive)orderByComparator
- the comparator to order the results by (optionally null
)public static java.util.List<Folder> findByAccountId(long accountId, int start, int end, OrderByComparator<Folder> 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 FolderModelImpl
.
accountId
- the account IDstart
- the lower bound of the range of foldersend
- the upper bound of the range of folders (not inclusive)orderByComparator
- the comparator to order the results by (optionally null
)useFinderCache
- whether to use the finder cachepublic static Folder findByAccountId_First(long accountId, OrderByComparator<Folder> orderByComparator) throws NoSuchFolderException
accountId
- the account IDorderByComparator
- the comparator to order the set by (optionally null
)NoSuchFolderException
- if a matching folder could not be foundpublic static Folder fetchByAccountId_First(long accountId, OrderByComparator<Folder> orderByComparator)
accountId
- the account IDorderByComparator
- the comparator to order the set by (optionally null
)null
if a matching folder could not be foundpublic static Folder findByAccountId_Last(long accountId, OrderByComparator<Folder> orderByComparator) throws NoSuchFolderException
accountId
- the account IDorderByComparator
- the comparator to order the set by (optionally null
)NoSuchFolderException
- if a matching folder could not be foundpublic static Folder fetchByAccountId_Last(long accountId, OrderByComparator<Folder> orderByComparator)
accountId
- the account IDorderByComparator
- the comparator to order the set by (optionally null
)null
if a matching folder could not be foundpublic static Folder[] findByAccountId_PrevAndNext(long folderId, long accountId, OrderByComparator<Folder> orderByComparator) throws NoSuchFolderException
folderId
- the primary key of the current folderaccountId
- the account IDorderByComparator
- the comparator to order the set by (optionally null
)NoSuchFolderException
- if a folder with the primary key could not be foundpublic static void removeByAccountId(long accountId)
accountId
- the account IDpublic static int countByAccountId(long accountId)
accountId
- the account IDpublic static Folder findByA_F(long accountId, java.lang.String fullName) throws NoSuchFolderException
NoSuchFolderException
if it could not be found.accountId
- the account IDfullName
- the full nameNoSuchFolderException
- if a matching folder could not be foundpublic static Folder fetchByA_F(long accountId, java.lang.String fullName)
null
if it could not be found. Uses the finder cache.accountId
- the account IDfullName
- the full namenull
if a matching folder could not be foundpublic static Folder fetchByA_F(long accountId, java.lang.String fullName, boolean useFinderCache)
null
if it could not be found, optionally using the finder cache.accountId
- the account IDfullName
- the full nameuseFinderCache
- whether to use the finder cachenull
if a matching folder could not be foundpublic static Folder removeByA_F(long accountId, java.lang.String fullName) throws NoSuchFolderException
accountId
- the account IDfullName
- the full nameNoSuchFolderException
public static int countByA_F(long accountId, java.lang.String fullName)
accountId
- the account IDfullName
- the full namepublic static void cacheResult(Folder folder)
folder
- the folderpublic static void cacheResult(java.util.List<Folder> folders)
folders
- the folderspublic static Folder create(long folderId)
folderId
- the primary key for the new folderpublic static Folder remove(long folderId) throws NoSuchFolderException
folderId
- the primary key of the folderNoSuchFolderException
- if a folder with the primary key could not be foundpublic static Folder findByPrimaryKey(long folderId) throws NoSuchFolderException
NoSuchFolderException
if it could not be found.folderId
- the primary key of the folderNoSuchFolderException
- if a folder with the primary key could not be foundpublic static Folder fetchByPrimaryKey(long folderId)
null
if it could not be found.folderId
- the primary key of the foldernull
if a folder with the primary key could not be foundpublic static java.util.List<Folder> findAll()
public static java.util.List<Folder> 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 FolderModelImpl
.
start
- the lower bound of the range of foldersend
- the upper bound of the range of folders (not inclusive)public static java.util.List<Folder> findAll(int start, int end, OrderByComparator<Folder> 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 FolderModelImpl
.
start
- the lower bound of the range of foldersend
- the upper bound of the range of folders (not inclusive)orderByComparator
- the comparator to order the results by (optionally null
)public static java.util.List<Folder> findAll(int start, int end, OrderByComparator<Folder> 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 FolderModelImpl
.
start
- the lower bound of the range of foldersend
- the upper bound of the range of folders (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 FolderPersistence getPersistence()