Liferay 6.0.5

com.liferay.portal.service.persistence
Interface ContactPersistence

All Superinterfaces:
BasePersistence<Contact>
All Known Implementing Classes:
ContactPersistenceImpl

public interface ContactPersistence
extends BasePersistence<Contact>

The persistence interface for the contact service.

Never modify or reference this interface directly. Always use ContactUtil to access the contact persistence. Modify service.xml and rerun ServiceBuilder to regenerate this interface.

Caching information and settings can be found in portal.properties

See Also:
ContactPersistenceImpl, ContactUtil
ServiceBuilder generated this class. Modifications in this class will be overwritten the next time is generated.

Method Summary
 void cacheResult(Contact contact)
          Caches the contact in the entity cache if it is enabled.
 void cacheResult(List<Contact> contacts)
          Caches the contacts in the entity cache if it is enabled.
 int countAll()
          Counts all the contacts.
 int countByCompanyId(long companyId)
          Counts all the contacts where companyId = ?.
 Contact create(long contactId)
          Creates a new contact with the primary key.
 Contact fetchByPrimaryKey(long contactId)
          Finds the contact with the primary key or returns null if it could not be found.
 List<Contact> findAll()
          Finds all the contacts.
 List<Contact> findAll(int start, int end)
          Finds a range of all the contacts.
 List<Contact> findAll(int start, int end, OrderByComparator orderByComparator)
          Finds an ordered range of all the contacts.
 Contact findByCompanyId_First(long companyId, OrderByComparator orderByComparator)
          Finds the first contact in the ordered set where companyId = ?.
 Contact findByCompanyId_Last(long companyId, OrderByComparator orderByComparator)
          Finds the last contact in the ordered set where companyId = ?.
 Contact[] findByCompanyId_PrevAndNext(long contactId, long companyId, OrderByComparator orderByComparator)
          Finds the contacts before and after the current contact in the ordered set where companyId = ?.
 List<Contact> findByCompanyId(long companyId)
          Finds all the contacts where companyId = ?.
 List<Contact> findByCompanyId(long companyId, int start, int end)
          Finds a range of all the contacts where companyId = ?.
 List<Contact> findByCompanyId(long companyId, int start, int end, OrderByComparator orderByComparator)
          Finds an ordered range of all the contacts where companyId = ?.
 Contact findByPrimaryKey(long contactId)
          Finds the contact with the primary key or throws a NoSuchContactException if it could not be found.
 Contact remove(long contactId)
          Removes the contact with the primary key from the database.
 void removeAll()
          Removes all the contacts from the database.
 void removeByCompanyId(long companyId)
          Removes all the contacts where companyId = ? from the database.
 Contact updateImpl(Contact contact, boolean merge)
           
 
Methods inherited from interface com.liferay.portal.service.persistence.BasePersistence
clearCache, clearCache, countWithDynamicQuery, fetchByPrimaryKey, findByPrimaryKey, findWithDynamicQuery, findWithDynamicQuery, findWithDynamicQuery, getDataSource, getListeners, registerListener, remove, remove, setDataSource, unregisterListener, update, update
 

Method Detail

cacheResult

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

Parameters:
contact - the contact to cache

cacheResult

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

Parameters:
contacts - the contacts to cache

create

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

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 to remove
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

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

findByPrimaryKey

Contact findByPrimaryKey(long contactId)
                         throws NoSuchContactException,
                                SystemException
Finds the contact with the primary key or throws a NoSuchContactException if it could not be found.

Parameters:
contactId - the primary key of the contact to find
Returns:
the contact
Throws:
NoSuchContactException - if a contact with the primary key could not be found
SystemException - if a system exception occurred

fetchByPrimaryKey

Contact fetchByPrimaryKey(long contactId)
                          throws SystemException
Finds the contact with the primary key or returns null if it could not be found.

Parameters:
contactId - the primary key of the contact to find
Returns:
the contact, or null if a contact with the primary key could not be found
Throws:
SystemException - if a system exception occurred

findByCompanyId

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

Parameters:
companyId - the company id to search with
Returns:
the matching contacts
Throws:
SystemException - if a system exception occurred

findByCompanyId

List<Contact> findByCompanyId(long companyId,
                              int start,
                              int end)
                              throws SystemException
Finds 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 to search with
start - the lower bound of the range of contacts to return
end - the upper bound of the range of contacts to return (not inclusive)
Returns:
the range of matching contacts
Throws:
SystemException - if a system exception occurred

findByCompanyId

List<Contact> findByCompanyId(long companyId,
                              int start,
                              int end,
                              OrderByComparator orderByComparator)
                              throws SystemException
Finds 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 to search with
start - the lower bound of the range of contacts to return
end - the upper bound of the range of contacts to return (not inclusive)
orderByComparator - the comparator to order the results by
Returns:
the ordered range of matching contacts
Throws:
SystemException - if a system exception occurred

findByCompanyId_First

Contact findByCompanyId_First(long companyId,
                              OrderByComparator orderByComparator)
                              throws NoSuchContactException,
                                     SystemException
Finds the first contact in the ordered set 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 to search with
orderByComparator - the comparator to order the set by
Returns:
the first matching contact
Throws:
NoSuchContactException - if a matching contact could not be found
SystemException - if a system exception occurred

findByCompanyId_Last

Contact findByCompanyId_Last(long companyId,
                             OrderByComparator orderByComparator)
                             throws NoSuchContactException,
                                    SystemException
Finds the last contact in the ordered set 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 to search with
orderByComparator - the comparator to order the set by
Returns:
the last matching contact
Throws:
NoSuchContactException - if a matching contact could not be found
SystemException - if a system exception occurred

findByCompanyId_PrevAndNext

Contact[] findByCompanyId_PrevAndNext(long contactId,
                                      long companyId,
                                      OrderByComparator orderByComparator)
                                      throws NoSuchContactException,
                                             SystemException
Finds the contacts before and after the current contact in the ordered set 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:
contactId - the primary key of the current contact
companyId - the company id to search with
orderByComparator - the comparator to order the set by
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

List<Contact> findAll()
                      throws SystemException
Finds all the contacts.

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

findAll

List<Contact> findAll(int start,
                      int end)
                      throws SystemException
Finds 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 to return
end - the upper bound of the range of contacts to return (not inclusive)
Returns:
the range of contacts
Throws:
SystemException - if a system exception occurred

findAll

List<Contact> findAll(int start,
                      int end,
                      OrderByComparator orderByComparator)
                      throws SystemException
Finds 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 to return
end - the upper bound of the range of contacts to return (not inclusive)
orderByComparator - the comparator to order the results by
Returns:
the ordered range of contacts
Throws:
SystemException - if a system exception occurred

removeByCompanyId

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

Parameters:
companyId - the company id to search with
Throws:
SystemException - if a system exception occurred

removeAll

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

Throws:
SystemException - if a system exception occurred

countByCompanyId

int countByCompanyId(long companyId)
                     throws SystemException
Counts all the contacts where companyId = ?.

Parameters:
companyId - the company id to search with
Returns:
the number of matching contacts
Throws:
SystemException - if a system exception occurred

countAll

int countAll()
             throws SystemException
Counts all the contacts.

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

Liferay 6.0.5