Liferay 7.0-ce-b4

com.liferay.portal.service.persistence
Class ContactUtil

java.lang.Object
  extended by com.liferay.portal.service.persistence.ContactUtil

@ProviderType
public class ContactUtil
extends Object

The persistence utility for the contact service. This utility wraps ContactPersistenceImpl 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:
ContactPersistence, ContactPersistenceImpl

Constructor Summary
ContactUtil()
           
 
Method Summary
static void cacheResult(Contact contact)
          Caches the contact in the entity cache if it is enabled.
static void cacheResult(List<Contact> contacts)
          Caches the contacts in the entity cache if it is enabled.
static void clearCache()
           
static void clearCache(Contact contact)
           
static int countAll()
          Returns the number of contacts.
static int countByAccountId(long accountId)
          Returns the number of contacts where accountId = ?.
static int countByC_C(long classNameId, long classPK)
          Returns the number of contacts where classNameId = ? and classPK = ?.
static int countByCompanyId(long companyId)
          Returns the number of contacts where companyId = ?.
static long countWithDynamicQuery(DynamicQuery dynamicQuery)
           
static Contact create(long contactId)
          Creates a new contact with the primary key.
static Contact fetchByAccountId_First(long accountId, OrderByComparator<Contact> orderByComparator)
          Returns the first contact in the ordered set where accountId = ?.
static Contact fetchByAccountId_Last(long accountId, OrderByComparator<Contact> orderByComparator)
          Returns the last contact in the ordered set where accountId = ?.
static Contact fetchByC_C_First(long classNameId, long classPK, OrderByComparator<Contact> orderByComparator)
          Returns the first contact in the ordered set where classNameId = ? and classPK = ?.
static Contact fetchByC_C_Last(long classNameId, long classPK, OrderByComparator<Contact> orderByComparator)
          Returns the last contact in the ordered set where classNameId = ? and classPK = ?.
static Contact fetchByCompanyId_First(long companyId, OrderByComparator<Contact> orderByComparator)
          Returns the first contact in the ordered set where companyId = ?.
static Contact fetchByCompanyId_Last(long companyId, OrderByComparator<Contact> orderByComparator)
          Returns the last contact in the ordered set where companyId = ?.
static Contact fetchByPrimaryKey(long contactId)
          Returns the contact with the primary key or returns null if it could not be found.
static Map<Serializable,Contact> fetchByPrimaryKeys(Set<Serializable> primaryKeys)
           
static List<Contact> findAll()
          Returns all the contacts.
static List<Contact> findAll(int start, int end)
          Returns a range of all the contacts.
static List<Contact> findAll(int start, int end, OrderByComparator<Contact> orderByComparator)
          Returns an ordered range of all the contacts.
static List<Contact> findAll(int start, int end, OrderByComparator<Contact> orderByComparator, boolean retrieveFromCache)
          Returns an ordered range of all the contacts.
static Contact findByAccountId_First(long accountId, OrderByComparator<Contact> orderByComparator)
          Returns the first contact in the ordered set where accountId = ?.
static Contact findByAccountId_Last(long accountId, OrderByComparator<Contact> orderByComparator)
          Returns the last contact in the ordered set where accountId = ?.
static Contact[] findByAccountId_PrevAndNext(long contactId, long accountId, OrderByComparator<Contact> orderByComparator)
          Returns the contacts before and after the current contact in the ordered set where accountId = ?.
static List<Contact> findByAccountId(long accountId)
          Returns all the contacts where accountId = ?.
static List<Contact> findByAccountId(long accountId, int start, int end)
          Returns a range of all the contacts where accountId = ?.
static List<Contact> findByAccountId(long accountId, int start, int end, OrderByComparator<Contact> orderByComparator)
          Returns an ordered range of all the contacts where accountId = ?.
static List<Contact> findByAccountId(long accountId, int start, int end, OrderByComparator<Contact> orderByComparator, boolean retrieveFromCache)
          Returns an ordered range of all the contacts where accountId = ?.
static Contact findByC_C_First(long classNameId, long classPK, OrderByComparator<Contact> orderByComparator)
          Returns the first contact in the ordered set where classNameId = ? and classPK = ?.
static Contact findByC_C_Last(long classNameId, long classPK, OrderByComparator<Contact> orderByComparator)
          Returns the last contact in the ordered set where classNameId = ? and classPK = ?.
static Contact[] findByC_C_PrevAndNext(long contactId, long classNameId, long classPK, OrderByComparator<Contact> orderByComparator)
          Returns the contacts before and after the current contact in the ordered set where classNameId = ? and classPK = ?.
static List<Contact> findByC_C(long classNameId, long classPK)
          Returns all the contacts where classNameId = ? and classPK = ?.
static List<Contact> findByC_C(long classNameId, long classPK, int start, int end)
          Returns a range of all the contacts where classNameId = ? and classPK = ?.
static List<Contact> findByC_C(long classNameId, long classPK, int start, int end, OrderByComparator<Contact> orderByComparator)
          Returns an ordered range of all the contacts where classNameId = ? and classPK = ?.
static List<Contact> findByC_C(long classNameId, long classPK, int start, int end, OrderByComparator<Contact> orderByComparator, boolean retrieveFromCache)
          Returns an ordered range of all the contacts where classNameId = ? and classPK = ?.
static Contact findByCompanyId_First(long companyId, OrderByComparator<Contact> orderByComparator)
          Returns the first contact in the ordered set where companyId = ?.
static Contact findByCompanyId_Last(long companyId, OrderByComparator<Contact> orderByComparator)
          Returns the last contact in the ordered set where companyId = ?.
static Contact[] findByCompanyId_PrevAndNext(long contactId, long companyId, OrderByComparator<Contact> orderByComparator)
          Returns the contacts before and after the current contact in the ordered set where companyId = ?.
static List<Contact> findByCompanyId(long companyId)
          Returns all the contacts where companyId = ?.
static List<Contact> findByCompanyId(long companyId, int start, int end)
          Returns a range of all the contacts where companyId = ?.
static List<Contact> findByCompanyId(long companyId, int start, int end, OrderByComparator<Contact> orderByComparator)
          Returns an ordered range of all the contacts where companyId = ?.
static List<Contact> findByCompanyId(long companyId, int start, int end, OrderByComparator<Contact> orderByComparator, boolean retrieveFromCache)
          Returns an ordered range of all the contacts where companyId = ?.
static Contact findByPrimaryKey(long contactId)
          Returns the contact with the primary key or throws a NoSuchContactException if it could not be found.
static List<Contact> findWithDynamicQuery(DynamicQuery dynamicQuery)
           
static List<Contact> findWithDynamicQuery(DynamicQuery dynamicQuery, int start, int end)
           
static List<Contact> findWithDynamicQuery(DynamicQuery dynamicQuery, int start, int end, OrderByComparator<Contact> orderByComparator)
           
static ContactPersistence getPersistence()
           
static Contact remove(long contactId)
          Removes the contact with the primary key from the database.
static void removeAll()
          Removes all the contacts from the database.
static void removeByAccountId(long accountId)
          Removes all the contacts where accountId = ? from the database.
static void removeByC_C(long classNameId, long classPK)
          Removes all the contacts where classNameId = ? and classPK = ? from the database.
static void removeByCompanyId(long companyId)
          Removes all the contacts where companyId = ? from the database.
static Contact update(Contact contact)
           
static Contact update(Contact contact, ServiceContext serviceContext)
           
static Contact updateImpl(Contact contact)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ContactUtil

public ContactUtil()
Method Detail

clearCache

public static void clearCache()
See Also:
BasePersistence.clearCache()

clearCache

public static void clearCache(Contact contact)
See Also:
BasePersistence.clearCache(com.liferay.portal.model.BaseModel)

countWithDynamicQuery

public static long countWithDynamicQuery(DynamicQuery dynamicQuery)
See Also:
BasePersistence.countWithDynamicQuery(DynamicQuery)

findWithDynamicQuery

public static List<Contact> findWithDynamicQuery(DynamicQuery dynamicQuery)
See Also:
BasePersistence.findWithDynamicQuery(DynamicQuery)

findWithDynamicQuery

public static List<Contact> findWithDynamicQuery(DynamicQuery dynamicQuery,
                                                 int start,
                                                 int end)
See Also:
BasePersistence.findWithDynamicQuery(DynamicQuery, int, int)

findWithDynamicQuery

public static List<Contact> findWithDynamicQuery(DynamicQuery dynamicQuery,
                                                 int start,
                                                 int end,
                                                 OrderByComparator<Contact> orderByComparator)
See Also:
BasePersistence.findWithDynamicQuery(DynamicQuery, int, int, OrderByComparator)

update

public static Contact update(Contact contact)
See Also:
BasePersistence.update(com.liferay.portal.model.BaseModel)

update

public static Contact update(Contact contact,
                             ServiceContext serviceContext)
See Also:
BasePersistence.update(com.liferay.portal.model.BaseModel, ServiceContext)

findByCompanyId

public static List<Contact> findByCompanyId(long companyId)
Returns all the contacts where companyId = ?.

Parameters:
companyId - the company ID
Returns:
the matching contacts

findByCompanyId

public static List<Contact> findByCompanyId(long companyId,
                                            int start,
                                            int end)
Returns a range of all the contacts where companyId = ?.

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 ContactModelImpl. 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.

Parameters:
companyId - the company ID
start - the lower bound of the range of contacts
end - the upper bound of the range of contacts (not inclusive)
Returns:
the range of matching contacts

findByCompanyId

public static List<Contact> findByCompanyId(long companyId,
                                            int start,
                                            int end,
                                            OrderByComparator<Contact> orderByComparator)
Returns an ordered range of all the contacts where companyId = ?.

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 ContactModelImpl. 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.

Parameters:
companyId - the company ID
start - the lower bound of the range of contacts
end - the upper bound of the range of contacts (not inclusive)
orderByComparator - the comparator to order the results by (optionally null)
Returns:
the ordered range of matching contacts

findByCompanyId

public static List<Contact> findByCompanyId(long companyId,
                                            int start,
                                            int end,
                                            OrderByComparator<Contact> orderByComparator,
                                            boolean retrieveFromCache)
Returns an ordered range of all the contacts where companyId = ?.

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 ContactModelImpl. 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.

Parameters:
companyId - the company ID
start - the lower bound of the range of contacts
end - the upper bound of the range of contacts (not inclusive)
orderByComparator - the comparator to order the results by (optionally null)
retrieveFromCache - whether to retrieve from the finder cache
Returns:
the ordered range of matching contacts

findByCompanyId_First

public static Contact findByCompanyId_First(long companyId,
                                            OrderByComparator<Contact> orderByComparator)
                                     throws NoSuchContactException
Returns the first contact in the ordered set where companyId = ?.

Parameters:
companyId - the company ID
orderByComparator - the comparator to order the set by (optionally null)
Returns:
the first matching contact
Throws:
NoSuchContactException - if a matching contact could not be found

fetchByCompanyId_First

public static Contact fetchByCompanyId_First(long companyId,
                                             OrderByComparator<Contact> orderByComparator)
Returns the first contact in the ordered set where companyId = ?.

Parameters:
companyId - the company ID
orderByComparator - the comparator to order the set by (optionally null)
Returns:
the first matching contact, or null if a matching contact could not be found

findByCompanyId_Last

public static Contact findByCompanyId_Last(long companyId,
                                           OrderByComparator<Contact> orderByComparator)
                                    throws NoSuchContactException
Returns the last contact in the ordered set where companyId = ?.

Parameters:
companyId - the company ID
orderByComparator - the comparator to order the set by (optionally null)
Returns:
the last matching contact
Throws:
NoSuchContactException - if a matching contact could not be found

fetchByCompanyId_Last

public static Contact fetchByCompanyId_Last(long companyId,
                                            OrderByComparator<Contact> orderByComparator)
Returns the last contact in the ordered set where companyId = ?.

Parameters:
companyId - the company ID
orderByComparator - the comparator to order the set by (optionally null)
Returns:
the last matching contact, or null if a matching contact could not be found

findByCompanyId_PrevAndNext

public static Contact[] findByCompanyId_PrevAndNext(long contactId,
                                                    long companyId,
                                                    OrderByComparator<Contact> orderByComparator)
                                             throws NoSuchContactException
Returns the contacts before and after the current contact in the ordered set where companyId = ?.

Parameters:
contactId - the primary key of the current contact
companyId - the company ID
orderByComparator - the comparator to order the set by (optionally null)
Returns:
the previous, current, and next contact
Throws:
NoSuchContactException - if a contact with the primary key could not be found

removeByCompanyId

public static void removeByCompanyId(long companyId)
Removes all the contacts where companyId = ? from the database.

Parameters:
companyId - the company ID

countByCompanyId

public static int countByCompanyId(long companyId)
Returns the number of contacts where companyId = ?.

Parameters:
companyId - the company ID
Returns:
the number of matching contacts

findByAccountId

public static List<Contact> findByAccountId(long accountId)
Returns all the contacts where accountId = ?.

Parameters:
accountId - the account ID
Returns:
the matching contacts

findByAccountId

public static List<Contact> findByAccountId(long accountId,
                                            int start,
                                            int end)
Returns a range of all the contacts where accountId = ?.

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 ContactModelImpl. 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.

Parameters:
accountId - the account ID
start - the lower bound of the range of contacts
end - the upper bound of the range of contacts (not inclusive)
Returns:
the range of matching contacts

findByAccountId

public static List<Contact> findByAccountId(long accountId,
                                            int start,
                                            int end,
                                            OrderByComparator<Contact> orderByComparator)
Returns an ordered range of all the contacts where accountId = ?.

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 ContactModelImpl. 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.

Parameters:
accountId - the account ID
start - the lower bound of the range of contacts
end - the upper bound of the range of contacts (not inclusive)
orderByComparator - the comparator to order the results by (optionally null)
Returns:
the ordered range of matching contacts

findByAccountId

public static List<Contact> findByAccountId(long accountId,
                                            int start,
                                            int end,
                                            OrderByComparator<Contact> orderByComparator,
                                            boolean retrieveFromCache)
Returns an ordered range of all the contacts where accountId = ?.

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 ContactModelImpl. 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.

Parameters:
accountId - the account ID
start - the lower bound of the range of contacts
end - the upper bound of the range of contacts (not inclusive)
orderByComparator - the comparator to order the results by (optionally null)
retrieveFromCache - whether to retrieve from the finder cache
Returns:
the ordered range of matching contacts

findByAccountId_First

public static Contact findByAccountId_First(long accountId,
                                            OrderByComparator<Contact> orderByComparator)
                                     throws NoSuchContactException
Returns the first contact in the ordered set where accountId = ?.

Parameters:
accountId - the account ID
orderByComparator - the comparator to order the set by (optionally null)
Returns:
the first matching contact
Throws:
NoSuchContactException - if a matching contact could not be found

fetchByAccountId_First

public static Contact fetchByAccountId_First(long accountId,
                                             OrderByComparator<Contact> orderByComparator)
Returns the first contact in the ordered set where accountId = ?.

Parameters:
accountId - the account ID
orderByComparator - the comparator to order the set by (optionally null)
Returns:
the first matching contact, or null if a matching contact could not be found

findByAccountId_Last

public static Contact findByAccountId_Last(long accountId,
                                           OrderByComparator<Contact> orderByComparator)
                                    throws NoSuchContactException
Returns the last contact in the ordered set where accountId = ?.

Parameters:
accountId - the account ID
orderByComparator - the comparator to order the set by (optionally null)
Returns:
the last matching contact
Throws:
NoSuchContactException - if a matching contact could not be found

fetchByAccountId_Last

public static Contact fetchByAccountId_Last(long accountId,
                                            OrderByComparator<Contact> orderByComparator)
Returns the last contact in the ordered set where accountId = ?.

Parameters:
accountId - the account ID
orderByComparator - the comparator to order the set by (optionally null)
Returns:
the last matching contact, or null if a matching contact could not be found

findByAccountId_PrevAndNext

public static Contact[] findByAccountId_PrevAndNext(long contactId,
                                                    long accountId,
                                                    OrderByComparator<Contact> orderByComparator)
                                             throws NoSuchContactException
Returns the contacts before and after the current contact in the ordered set where accountId = ?.

Parameters:
contactId - the primary key of the current contact
accountId - the account ID
orderByComparator - the comparator to order the set by (optionally null)
Returns:
the previous, current, and next contact
Throws:
NoSuchContactException - if a contact with the primary key could not be found

removeByAccountId

public static void removeByAccountId(long accountId)
Removes all the contacts where accountId = ? from the database.

Parameters:
accountId - the account ID

countByAccountId

public static int countByAccountId(long accountId)
Returns the number of contacts where accountId = ?.

Parameters:
accountId - the account ID
Returns:
the number of matching contacts

findByC_C

public static List<Contact> findByC_C(long classNameId,
                                      long classPK)
Returns all the contacts where classNameId = ? and classPK = ?.

Parameters:
classNameId - the class name ID
classPK - the class p k
Returns:
the matching contacts

findByC_C

public static List<Contact> findByC_C(long classNameId,
                                      long classPK,
                                      int start,
                                      int end)
Returns a range of all the contacts where classNameId = ? and classPK = ?.

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 ContactModelImpl. 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.

Parameters:
classNameId - the class name ID
classPK - the class p k
start - the lower bound of the range of contacts
end - the upper bound of the range of contacts (not inclusive)
Returns:
the range of matching contacts

findByC_C

public static List<Contact> findByC_C(long classNameId,
                                      long classPK,
                                      int start,
                                      int end,
                                      OrderByComparator<Contact> orderByComparator)
Returns an ordered range of all the contacts where classNameId = ? and classPK = ?.

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 ContactModelImpl. 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.

Parameters:
classNameId - the class name ID
classPK - the class p k
start - the lower bound of the range of contacts
end - the upper bound of the range of contacts (not inclusive)
orderByComparator - the comparator to order the results by (optionally null)
Returns:
the ordered range of matching contacts

findByC_C

public static List<Contact> findByC_C(long classNameId,
                                      long classPK,
                                      int start,
                                      int end,
                                      OrderByComparator<Contact> orderByComparator,
                                      boolean retrieveFromCache)
Returns an ordered range of all the contacts where classNameId = ? and classPK = ?.

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 ContactModelImpl. 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.

Parameters:
classNameId - the class name ID
classPK - the class p k
start - the lower bound of the range of contacts
end - the upper bound of the range of contacts (not inclusive)
orderByComparator - the comparator to order the results by (optionally null)
retrieveFromCache - whether to retrieve from the finder cache
Returns:
the ordered range of matching contacts

findByC_C_First

public static Contact findByC_C_First(long classNameId,
                                      long classPK,
                                      OrderByComparator<Contact> orderByComparator)
                               throws NoSuchContactException
Returns the first contact in the ordered set where classNameId = ? and classPK = ?.

Parameters:
classNameId - the class name ID
classPK - the class p k
orderByComparator - the comparator to order the set by (optionally null)
Returns:
the first matching contact
Throws:
NoSuchContactException - if a matching contact could not be found

fetchByC_C_First

public static Contact fetchByC_C_First(long classNameId,
                                       long classPK,
                                       OrderByComparator<Contact> orderByComparator)
Returns the first contact in the ordered set where classNameId = ? and classPK = ?.

Parameters:
classNameId - the class name ID
classPK - the class p k
orderByComparator - the comparator to order the set by (optionally null)
Returns:
the first matching contact, or null if a matching contact could not be found

findByC_C_Last

public static Contact findByC_C_Last(long classNameId,
                                     long classPK,
                                     OrderByComparator<Contact> orderByComparator)
                              throws NoSuchContactException
Returns the last contact in the ordered set where classNameId = ? and classPK = ?.

Parameters:
classNameId - the class name ID
classPK - the class p k
orderByComparator - the comparator to order the set by (optionally null)
Returns:
the last matching contact
Throws:
NoSuchContactException - if a matching contact could not be found

fetchByC_C_Last

public static Contact fetchByC_C_Last(long classNameId,
                                      long classPK,
                                      OrderByComparator<Contact> orderByComparator)
Returns the last contact in the ordered set where classNameId = ? and classPK = ?.

Parameters:
classNameId - the class name ID
classPK - the class p k
orderByComparator - the comparator to order the set by (optionally null)
Returns:
the last matching contact, or null if a matching contact could not be found

findByC_C_PrevAndNext

public static Contact[] findByC_C_PrevAndNext(long contactId,
                                              long classNameId,
                                              long classPK,
                                              OrderByComparator<Contact> orderByComparator)
                                       throws NoSuchContactException
Returns the contacts before and after the current contact in the ordered set where classNameId = ? and classPK = ?.

Parameters:
contactId - the primary key of the current contact
classNameId - the class name ID
classPK - the class p k
orderByComparator - the comparator to order the set by (optionally null)
Returns:
the previous, current, and next contact
Throws:
NoSuchContactException - if a contact with the primary key could not be found

removeByC_C

public static void removeByC_C(long classNameId,
                               long classPK)
Removes all the contacts where classNameId = ? and classPK = ? from the database.

Parameters:
classNameId - the class name ID
classPK - the class p k

countByC_C

public static int countByC_C(long classNameId,
                             long classPK)
Returns the number of contacts where classNameId = ? and classPK = ?.

Parameters:
classNameId - the class name ID
classPK - the class p k
Returns:
the number of matching contacts

cacheResult

public static void cacheResult(Contact contact)
Caches the contact in the entity cache if it is enabled.

Parameters:
contact - the contact

cacheResult

public static void cacheResult(List<Contact> contacts)
Caches the contacts in the entity cache if it is enabled.

Parameters:
contacts - the contacts

create

public static Contact create(long contactId)
Creates a new contact with the primary key. Does not add the contact to the database.

Parameters:
contactId - the primary key for the new contact
Returns:
the new contact

remove

public static Contact remove(long contactId)
                      throws NoSuchContactException
Removes the contact with the primary key from the database. Also notifies the appropriate model listeners.

Parameters:
contactId - the primary key of the contact
Returns:
the contact that was removed
Throws:
NoSuchContactException - if a contact with the primary key could not be found

updateImpl

public static Contact updateImpl(Contact contact)

findByPrimaryKey

public static Contact findByPrimaryKey(long contactId)
                                throws NoSuchContactException
Returns the contact with the primary key or throws a NoSuchContactException if it could not be found.

Parameters:
contactId - the primary key of the contact
Returns:
the contact
Throws:
NoSuchContactException - if a contact with the primary key could not be found

fetchByPrimaryKey

public static Contact fetchByPrimaryKey(long contactId)
Returns the contact with the primary key or returns null if it could not be found.

Parameters:
contactId - the primary key of the contact
Returns:
the contact, or null if a contact with the primary key could not be found

fetchByPrimaryKeys

public static Map<Serializable,Contact> fetchByPrimaryKeys(Set<Serializable> primaryKeys)

findAll

public static List<Contact> findAll()
Returns all the contacts.

Returns:
the contacts

findAll

public static List<Contact> findAll(int start,
                                    int end)
Returns a range of all the contacts.

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 ContactModelImpl. 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.

Parameters:
start - the lower bound of the range of contacts
end - the upper bound of the range of contacts (not inclusive)
Returns:
the range of contacts

findAll

public static List<Contact> findAll(int start,
                                    int end,
                                    OrderByComparator<Contact> orderByComparator)
Returns an ordered range of all the contacts.

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 ContactModelImpl. 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.

Parameters:
start - the lower bound of the range of contacts
end - the upper bound of the range of contacts (not inclusive)
orderByComparator - the comparator to order the results by (optionally null)
Returns:
the ordered range of contacts

findAll

public static List<Contact> findAll(int start,
                                    int end,
                                    OrderByComparator<Contact> orderByComparator,
                                    boolean retrieveFromCache)
Returns an ordered range of all the contacts.

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 ContactModelImpl. 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.

Parameters:
start - the lower bound of the range of contacts
end - the upper bound of the range of contacts (not inclusive)
orderByComparator - the comparator to order the results by (optionally null)
retrieveFromCache - whether to retrieve from the finder cache
Returns:
the ordered range of contacts

removeAll

public static void removeAll()
Removes all the contacts from the database.


countAll

public static int countAll()
Returns the number of contacts.

Returns:
the number of contacts

getPersistence

public static ContactPersistence getPersistence()

Liferay 7.0-ce-b4