Liferay 6.1.2-ce-ga3

com.liferay.portal.service.persistence
Class ContactUtil

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

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
ServiceBuilder generated this class. Modifications in this class will be overwritten the next time it is generated.

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 countByCompanyId(long companyId)
          Returns the number of contacts where companyId = ?.
 long countWithDynamicQuery(DynamicQuery dynamicQuery)
           
static Contact create(long contactId)
          Creates a new contact with the primary key.
static Contact fetchByCompanyId_First(long companyId, OrderByComparator orderByComparator)
          Returns the first contact in the ordered set where companyId = ?.
static Contact fetchByCompanyId_Last(long companyId, OrderByComparator 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 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 orderByComparator)
          Returns an ordered range of all the contacts.
static Contact findByCompanyId_First(long companyId, OrderByComparator orderByComparator)
          Returns the first contact in the ordered set where companyId = ?.
static Contact findByCompanyId_Last(long companyId, OrderByComparator orderByComparator)
          Returns the last contact in the ordered set where companyId = ?.
static Contact[] findByCompanyId_PrevAndNext(long contactId, long companyId, OrderByComparator 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 orderByComparator)
          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 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 removeByCompanyId(long companyId)
          Removes all the contacts where companyId = ? from the database.
 void setPersistence(ContactPersistence persistence)
          Deprecated.  
static Contact update(Contact contact, boolean merge)
           
static Contact update(Contact contact, boolean merge, ServiceContext serviceContext)
           
static Contact updateImpl(Contact contact, boolean merge)
           
 
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 long countWithDynamicQuery(DynamicQuery dynamicQuery)
                           throws SystemException
Throws:
SystemException
See Also:
BasePersistence.countWithDynamicQuery(DynamicQuery)

findWithDynamicQuery

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

findWithDynamicQuery

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

findWithDynamicQuery

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

update

public static Contact update(Contact contact,
                             boolean merge)
                      throws SystemException
Throws:
SystemException
See Also:
BasePersistence.update(com.liferay.portal.model.BaseModel, boolean)

update

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

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,
                             SystemException
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
SystemException - if a system exception occurred

updateImpl

public static Contact updateImpl(Contact contact,
                                 boolean merge)
                          throws SystemException
Throws:
SystemException

findByPrimaryKey

public static Contact findByPrimaryKey(long contactId)
                                throws NoSuchContactException,
                                       SystemException
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
SystemException - if a system exception occurred

fetchByPrimaryKey

public static Contact fetchByPrimaryKey(long contactId)
                                 throws SystemException
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
Throws:
SystemException - if a system exception occurred

findByCompanyId

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

Parameters:
companyId - the company ID
Returns:
the matching contacts
Throws:
SystemException - if a system exception occurred

findByCompanyId

public static List<Contact> findByCompanyId(long companyId,
                                            int start,
                                            int end)
                                     throws SystemException
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.

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
Throws:
SystemException - if a system exception occurred

findByCompanyId

public static List<Contact> findByCompanyId(long companyId,
                                            int start,
                                            int end,
                                            OrderByComparator orderByComparator)
                                     throws SystemException
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.

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
Throws:
SystemException - if a system exception occurred

findByCompanyId_First

public static Contact findByCompanyId_First(long companyId,
                                            OrderByComparator orderByComparator)
                                     throws NoSuchContactException,
                                            SystemException
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
SystemException - if a system exception occurred

fetchByCompanyId_First

public static Contact fetchByCompanyId_First(long companyId,
                                             OrderByComparator orderByComparator)
                                      throws SystemException
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
Throws:
SystemException - if a system exception occurred

findByCompanyId_Last

public static Contact findByCompanyId_Last(long companyId,
                                           OrderByComparator orderByComparator)
                                    throws NoSuchContactException,
                                           SystemException
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
SystemException - if a system exception occurred

fetchByCompanyId_Last

public static Contact fetchByCompanyId_Last(long companyId,
                                            OrderByComparator orderByComparator)
                                     throws SystemException
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
Throws:
SystemException - if a system exception occurred

findByCompanyId_PrevAndNext

public static Contact[] findByCompanyId_PrevAndNext(long contactId,
                                                    long companyId,
                                                    OrderByComparator orderByComparator)
                                             throws NoSuchContactException,
                                                    SystemException
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
SystemException - if a system exception occurred

findAll

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

Returns:
the contacts
Throws:
SystemException - if a system exception occurred

findAll

public static List<Contact> findAll(int start,
                                    int end)
                             throws SystemException
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.

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
Throws:
SystemException - if a system exception occurred

findAll

public static List<Contact> findAll(int start,
                                    int end,
                                    OrderByComparator orderByComparator)
                             throws SystemException
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.

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
Throws:
SystemException - if a system exception occurred

removeByCompanyId

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

Parameters:
companyId - the company ID
Throws:
SystemException - if a system exception occurred

removeAll

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

Throws:
SystemException - if a system exception occurred

countByCompanyId

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

Parameters:
companyId - the company ID
Returns:
the number of matching contacts
Throws:
SystemException - if a system exception occurred

countAll

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

Returns:
the number of contacts
Throws:
SystemException - if a system exception occurred

getPersistence

public static ContactPersistence getPersistence()

setPersistence

public void setPersistence(ContactPersistence persistence)
Deprecated. 


Liferay 6.1.2-ce-ga3