public class AccountUtil
extends java.lang.Object
com.liferay.mail.reader.service.persistence.impl.AccountPersistenceImpl
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
AccountPersistence
Constructor and Description |
---|
AccountUtil() |
Modifier and Type | Method and Description |
---|---|
static void |
cacheResult(Account account)
Caches the account in the entity cache if it is enabled.
|
static void |
cacheResult(java.util.List<Account> accounts)
Caches the accounts in the entity cache if it is enabled.
|
static void |
clearCache() |
static void |
clearCache(Account account) |
static int |
countAll()
Returns the number of accounts.
|
static int |
countByU_A(long userId,
java.lang.String address)
Returns the number of accounts where userId = ? and address = ?.
|
static int |
countByUserId(long userId)
Returns the number of accounts where userId = ?.
|
static long |
countWithDynamicQuery(com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery) |
static Account |
create(long accountId)
Creates a new account with the primary key.
|
static Account |
fetchByPrimaryKey(long accountId)
Returns the account with the primary key or returns
null if it could not be found. |
static java.util.Map<java.io.Serializable,Account> |
fetchByPrimaryKeys(java.util.Set<java.io.Serializable> primaryKeys) |
static Account |
fetchByU_A(long userId,
java.lang.String address)
Returns the account where userId = ? and address = ? or returns
null if it could not be found. |
static Account |
fetchByU_A(long userId,
java.lang.String address,
boolean useFinderCache)
Returns the account where userId = ? and address = ? or returns
null if it could not be found, optionally using the finder cache. |
static Account |
fetchByUserId_First(long userId,
com.liferay.portal.kernel.util.OrderByComparator<Account> orderByComparator)
Returns the first account in the ordered set where userId = ?.
|
static Account |
fetchByUserId_Last(long userId,
com.liferay.portal.kernel.util.OrderByComparator<Account> orderByComparator)
Returns the last account in the ordered set where userId = ?.
|
static java.util.List<Account> |
findAll()
Returns all the accounts.
|
static java.util.List<Account> |
findAll(int start,
int end)
Returns a range of all the accounts.
|
static java.util.List<Account> |
findAll(int start,
int end,
com.liferay.portal.kernel.util.OrderByComparator<Account> orderByComparator)
Returns an ordered range of all the accounts.
|
static java.util.List<Account> |
findAll(int start,
int end,
com.liferay.portal.kernel.util.OrderByComparator<Account> orderByComparator,
boolean useFinderCache)
Returns an ordered range of all the accounts.
|
static Account |
findByPrimaryKey(long accountId)
Returns the account with the primary key or throws a
NoSuchAccountException if it could not be found. |
static Account |
findByU_A(long userId,
java.lang.String address)
Returns the account where userId = ? and address = ? or throws a
NoSuchAccountException if it could not be found. |
static Account |
findByUserId_First(long userId,
com.liferay.portal.kernel.util.OrderByComparator<Account> orderByComparator)
Returns the first account in the ordered set where userId = ?.
|
static Account |
findByUserId_Last(long userId,
com.liferay.portal.kernel.util.OrderByComparator<Account> orderByComparator)
Returns the last account in the ordered set where userId = ?.
|
static Account[] |
findByUserId_PrevAndNext(long accountId,
long userId,
com.liferay.portal.kernel.util.OrderByComparator<Account> orderByComparator)
Returns the accounts before and after the current account in the ordered set where userId = ?.
|
static java.util.List<Account> |
findByUserId(long userId)
Returns all the accounts where userId = ?.
|
static java.util.List<Account> |
findByUserId(long userId,
int start,
int end)
Returns a range of all the accounts where userId = ?.
|
static java.util.List<Account> |
findByUserId(long userId,
int start,
int end,
com.liferay.portal.kernel.util.OrderByComparator<Account> orderByComparator)
Returns an ordered range of all the accounts where userId = ?.
|
static java.util.List<Account> |
findByUserId(long userId,
int start,
int end,
com.liferay.portal.kernel.util.OrderByComparator<Account> orderByComparator,
boolean useFinderCache)
Returns an ordered range of all the accounts where userId = ?.
|
static java.util.List<Account> |
findWithDynamicQuery(com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery) |
static java.util.List<Account> |
findWithDynamicQuery(com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery,
int start,
int end) |
static java.util.List<Account> |
findWithDynamicQuery(com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery,
int start,
int end,
com.liferay.portal.kernel.util.OrderByComparator<Account> orderByComparator) |
static java.util.Set<java.lang.String> |
getBadColumnNames() |
static AccountPersistence |
getPersistence() |
static Account |
remove(long accountId)
Removes the account with the primary key from the database.
|
static void |
removeAll()
Removes all the accounts from the database.
|
static Account |
removeByU_A(long userId,
java.lang.String address)
Removes the account where userId = ? and address = ? from the database.
|
static void |
removeByUserId(long userId)
Removes all the accounts where userId = ? from the database.
|
static Account |
update(Account account) |
static Account |
update(Account account,
com.liferay.portal.kernel.service.ServiceContext serviceContext) |
static Account |
updateImpl(Account account) |
public static void clearCache()
BasePersistence.clearCache()
public static void clearCache(Account account)
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,Account> fetchByPrimaryKeys(java.util.Set<java.io.Serializable> primaryKeys)
BasePersistence.fetchByPrimaryKeys(Set)
public static java.util.List<Account> findWithDynamicQuery(com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery)
BasePersistence.findWithDynamicQuery(DynamicQuery)
public static java.util.List<Account> findWithDynamicQuery(com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start, int end)
BasePersistence.findWithDynamicQuery(DynamicQuery, int, int)
public static java.util.List<Account> findWithDynamicQuery(com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start, int end, com.liferay.portal.kernel.util.OrderByComparator<Account> orderByComparator)
BasePersistence.findWithDynamicQuery(DynamicQuery, int, int, OrderByComparator)
public static Account update(Account account)
BasePersistence.update(com.liferay.portal.kernel.model.BaseModel)
public static Account update(Account account, com.liferay.portal.kernel.service.ServiceContext serviceContext)
BasePersistence.update(com.liferay.portal.kernel.model.BaseModel, ServiceContext)
public static java.util.List<Account> findByUserId(long userId)
userId
- the user IDpublic static java.util.List<Account> 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, then the query will include the default ORDER BY logic from AccountModelImpl
.
userId
- the user IDstart
- the lower bound of the range of accountsend
- the upper bound of the range of accounts (not inclusive)public static java.util.List<Account> findByUserId(long userId, int start, int end, com.liferay.portal.kernel.util.OrderByComparator<Account> 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 AccountModelImpl
.
userId
- the user IDstart
- the lower bound of the range of accountsend
- the upper bound of the range of accounts (not inclusive)orderByComparator
- the comparator to order the results by (optionally null
)public static java.util.List<Account> findByUserId(long userId, int start, int end, com.liferay.portal.kernel.util.OrderByComparator<Account> 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 AccountModelImpl
.
userId
- the user IDstart
- the lower bound of the range of accountsend
- the upper bound of the range of accounts (not inclusive)orderByComparator
- the comparator to order the results by (optionally null
)useFinderCache
- whether to use the finder cachepublic static Account findByUserId_First(long userId, com.liferay.portal.kernel.util.OrderByComparator<Account> orderByComparator) throws NoSuchAccountException
userId
- the user IDorderByComparator
- the comparator to order the set by (optionally null
)NoSuchAccountException
- if a matching account could not be foundpublic static Account fetchByUserId_First(long userId, com.liferay.portal.kernel.util.OrderByComparator<Account> orderByComparator)
userId
- the user IDorderByComparator
- the comparator to order the set by (optionally null
)null
if a matching account could not be foundpublic static Account findByUserId_Last(long userId, com.liferay.portal.kernel.util.OrderByComparator<Account> orderByComparator) throws NoSuchAccountException
userId
- the user IDorderByComparator
- the comparator to order the set by (optionally null
)NoSuchAccountException
- if a matching account could not be foundpublic static Account fetchByUserId_Last(long userId, com.liferay.portal.kernel.util.OrderByComparator<Account> orderByComparator)
userId
- the user IDorderByComparator
- the comparator to order the set by (optionally null
)null
if a matching account could not be foundpublic static Account[] findByUserId_PrevAndNext(long accountId, long userId, com.liferay.portal.kernel.util.OrderByComparator<Account> orderByComparator) throws NoSuchAccountException
accountId
- the primary key of the current accountuserId
- the user IDorderByComparator
- the comparator to order the set by (optionally null
)NoSuchAccountException
- if a account 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 Account findByU_A(long userId, java.lang.String address) throws NoSuchAccountException
NoSuchAccountException
if it could not be found.userId
- the user IDaddress
- the addressNoSuchAccountException
- if a matching account could not be foundpublic static Account fetchByU_A(long userId, java.lang.String address)
null
if it could not be found. Uses the finder cache.userId
- the user IDaddress
- the addressnull
if a matching account could not be foundpublic static Account fetchByU_A(long userId, java.lang.String address, boolean useFinderCache)
null
if it could not be found, optionally using the finder cache.userId
- the user IDaddress
- the addressuseFinderCache
- whether to use the finder cachenull
if a matching account could not be foundpublic static Account removeByU_A(long userId, java.lang.String address) throws NoSuchAccountException
userId
- the user IDaddress
- the addressNoSuchAccountException
public static int countByU_A(long userId, java.lang.String address)
userId
- the user IDaddress
- the addresspublic static void cacheResult(Account account)
account
- the accountpublic static void cacheResult(java.util.List<Account> accounts)
accounts
- the accountspublic static Account create(long accountId)
accountId
- the primary key for the new accountpublic static Account remove(long accountId) throws NoSuchAccountException
accountId
- the primary key of the accountNoSuchAccountException
- if a account with the primary key could not be foundpublic static Account findByPrimaryKey(long accountId) throws NoSuchAccountException
NoSuchAccountException
if it could not be found.accountId
- the primary key of the accountNoSuchAccountException
- if a account with the primary key could not be foundpublic static Account fetchByPrimaryKey(long accountId)
null
if it could not be found.accountId
- the primary key of the accountnull
if a account with the primary key could not be foundpublic static java.util.List<Account> findAll()
public static java.util.List<Account> 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 AccountModelImpl
.
start
- the lower bound of the range of accountsend
- the upper bound of the range of accounts (not inclusive)public static java.util.List<Account> findAll(int start, int end, com.liferay.portal.kernel.util.OrderByComparator<Account> 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 AccountModelImpl
.
start
- the lower bound of the range of accountsend
- the upper bound of the range of accounts (not inclusive)orderByComparator
- the comparator to order the results by (optionally null
)public static java.util.List<Account> findAll(int start, int end, com.liferay.portal.kernel.util.OrderByComparator<Account> 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 AccountModelImpl
.
start
- the lower bound of the range of accountsend
- the upper bound of the range of accounts (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 AccountPersistence getPersistence()