001    /**
002     * Copyright (c) 2000-2010 Liferay, Inc. All rights reserved.
003     *
004     * This library is free software; you can redistribute it and/or modify it under
005     * the terms of the GNU Lesser General Public License as published by the Free
006     * Software Foundation; either version 2.1 of the License, or (at your option)
007     * any later version.
008     *
009     * This library is distributed in the hope that it will be useful, but WITHOUT
010     * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
011     * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
012     * details.
013     */
014    
015    package com.liferay.portal.service.persistence;
016    
017    import com.liferay.portal.model.Contact;
018    
019    /**
020     * The persistence interface for the contact service.
021     *
022     * <p>
023     * Never modify this interface directly. Modify <code>service.xml</code> and rerun ServiceBuilder to regnerate this interface.
024     * </p>
025     *
026     * @author Brian Wing Shun Chan
027     * @see ContactPersistenceImpl
028     * @see ContactUtil
029     * @generated
030     */
031    public interface ContactPersistence extends BasePersistence<Contact> {
032            /**
033            * Caches the contact in the entity cache if it is enabled.
034            *
035            * @param contact the contact to cache
036            */
037            public void cacheResult(com.liferay.portal.model.Contact contact);
038    
039            /**
040            * Caches the contacts in the entity cache if it is enabled.
041            *
042            * @param contacts the contacts to cache
043            */
044            public void cacheResult(
045                    java.util.List<com.liferay.portal.model.Contact> contacts);
046    
047            /**
048            * Creates a new contact with the primary key.
049            *
050            * @param contactId the primary key for the new contact
051            * @return the new contact
052            */
053            public com.liferay.portal.model.Contact create(long contactId);
054    
055            /**
056            * Removes the contact with the primary key from the database. Also notifies the appropriate model listeners.
057            *
058            * @param contactId the primary key of the contact to remove
059            * @return the contact that was removed
060            * @throws com.liferay.portal.NoSuchContactException if a contact with the primary key could not be found
061            * @throws SystemException if a system exception occurred
062            */
063            public com.liferay.portal.model.Contact remove(long contactId)
064                    throws com.liferay.portal.NoSuchContactException,
065                            com.liferay.portal.kernel.exception.SystemException;
066    
067            public com.liferay.portal.model.Contact updateImpl(
068                    com.liferay.portal.model.Contact contact, boolean merge)
069                    throws com.liferay.portal.kernel.exception.SystemException;
070    
071            /**
072            * Finds the contact with the primary key or throws a {@link com.liferay.portal.NoSuchContactException} if it could not be found.
073            *
074            * @param contactId the primary key of the contact to find
075            * @return the contact
076            * @throws com.liferay.portal.NoSuchContactException if a contact with the primary key could not be found
077            * @throws SystemException if a system exception occurred
078            */
079            public com.liferay.portal.model.Contact findByPrimaryKey(long contactId)
080                    throws com.liferay.portal.NoSuchContactException,
081                            com.liferay.portal.kernel.exception.SystemException;
082    
083            /**
084            * Finds the contact with the primary key or returns <code>null</code> if it could not be found.
085            *
086            * @param contactId the primary key of the contact to find
087            * @return the contact, or <code>null</code> if a contact with the primary key could not be found
088            * @throws SystemException if a system exception occurred
089            */
090            public com.liferay.portal.model.Contact fetchByPrimaryKey(long contactId)
091                    throws com.liferay.portal.kernel.exception.SystemException;
092    
093            /**
094            * Finds all the contacts where companyId = &#63;.
095            *
096            * @param companyId the company id to search with
097            * @return the matching contacts
098            * @throws SystemException if a system exception occurred
099            */
100            public java.util.List<com.liferay.portal.model.Contact> findByCompanyId(
101                    long companyId)
102                    throws com.liferay.portal.kernel.exception.SystemException;
103    
104            /**
105            * Finds a range of all the contacts where companyId = &#63;.
106            *
107            * <p>
108            * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
109            * </p>
110            *
111            * @param companyId the company id to search with
112            * @param start the lower bound of the range of contacts to return
113            * @param end the upper bound of the range of contacts to return (not inclusive)
114            * @return the range of matching contacts
115            * @throws SystemException if a system exception occurred
116            */
117            public java.util.List<com.liferay.portal.model.Contact> findByCompanyId(
118                    long companyId, int start, int end)
119                    throws com.liferay.portal.kernel.exception.SystemException;
120    
121            /**
122            * Finds an ordered range of all the contacts where companyId = &#63;.
123            *
124            * <p>
125            * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
126            * </p>
127            *
128            * @param companyId the company id to search with
129            * @param start the lower bound of the range of contacts to return
130            * @param end the upper bound of the range of contacts to return (not inclusive)
131            * @param orderByComparator the comparator to order the results by
132            * @return the ordered range of matching contacts
133            * @throws SystemException if a system exception occurred
134            */
135            public java.util.List<com.liferay.portal.model.Contact> findByCompanyId(
136                    long companyId, int start, int end,
137                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
138                    throws com.liferay.portal.kernel.exception.SystemException;
139    
140            /**
141            * Finds the first contact in the ordered set where companyId = &#63;.
142            *
143            * <p>
144            * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
145            * </p>
146            *
147            * @param companyId the company id to search with
148            * @param orderByComparator the comparator to order the set by
149            * @return the first matching contact
150            * @throws com.liferay.portal.NoSuchContactException if a matching contact could not be found
151            * @throws SystemException if a system exception occurred
152            */
153            public com.liferay.portal.model.Contact findByCompanyId_First(
154                    long companyId,
155                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
156                    throws com.liferay.portal.NoSuchContactException,
157                            com.liferay.portal.kernel.exception.SystemException;
158    
159            /**
160            * Finds the last contact in the ordered set where companyId = &#63;.
161            *
162            * <p>
163            * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
164            * </p>
165            *
166            * @param companyId the company id to search with
167            * @param orderByComparator the comparator to order the set by
168            * @return the last matching contact
169            * @throws com.liferay.portal.NoSuchContactException if a matching contact could not be found
170            * @throws SystemException if a system exception occurred
171            */
172            public com.liferay.portal.model.Contact findByCompanyId_Last(
173                    long companyId,
174                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
175                    throws com.liferay.portal.NoSuchContactException,
176                            com.liferay.portal.kernel.exception.SystemException;
177    
178            /**
179            * Finds the contacts before and after the current contact in the ordered set where companyId = &#63;.
180            *
181            * <p>
182            * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
183            * </p>
184            *
185            * @param contactId the primary key of the current contact
186            * @param companyId the company id to search with
187            * @param orderByComparator the comparator to order the set by
188            * @return the previous, current, and next contact
189            * @throws com.liferay.portal.NoSuchContactException if a contact with the primary key could not be found
190            * @throws SystemException if a system exception occurred
191            */
192            public com.liferay.portal.model.Contact[] findByCompanyId_PrevAndNext(
193                    long contactId, long companyId,
194                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
195                    throws com.liferay.portal.NoSuchContactException,
196                            com.liferay.portal.kernel.exception.SystemException;
197    
198            /**
199            * Finds all the contacts.
200            *
201            * @return the contacts
202            * @throws SystemException if a system exception occurred
203            */
204            public java.util.List<com.liferay.portal.model.Contact> findAll()
205                    throws com.liferay.portal.kernel.exception.SystemException;
206    
207            /**
208            * Finds a range of all the contacts.
209            *
210            * <p>
211            * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
212            * </p>
213            *
214            * @param start the lower bound of the range of contacts to return
215            * @param end the upper bound of the range of contacts to return (not inclusive)
216            * @return the range of contacts
217            * @throws SystemException if a system exception occurred
218            */
219            public java.util.List<com.liferay.portal.model.Contact> findAll(int start,
220                    int end) throws com.liferay.portal.kernel.exception.SystemException;
221    
222            /**
223            * Finds an ordered range of all the contacts.
224            *
225            * <p>
226            * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
227            * </p>
228            *
229            * @param start the lower bound of the range of contacts to return
230            * @param end the upper bound of the range of contacts to return (not inclusive)
231            * @param orderByComparator the comparator to order the results by
232            * @return the ordered range of contacts
233            * @throws SystemException if a system exception occurred
234            */
235            public java.util.List<com.liferay.portal.model.Contact> findAll(int start,
236                    int end,
237                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
238                    throws com.liferay.portal.kernel.exception.SystemException;
239    
240            /**
241            * Removes all the contacts where companyId = &#63; from the database.
242            *
243            * @param companyId the company id to search with
244            * @throws SystemException if a system exception occurred
245            */
246            public void removeByCompanyId(long companyId)
247                    throws com.liferay.portal.kernel.exception.SystemException;
248    
249            /**
250            * Removes all the contacts from the database.
251            *
252            * @throws SystemException if a system exception occurred
253            */
254            public void removeAll()
255                    throws com.liferay.portal.kernel.exception.SystemException;
256    
257            /**
258            * Counts all the contacts where companyId = &#63;.
259            *
260            * @param companyId the company id to search with
261            * @return the number of matching contacts
262            * @throws SystemException if a system exception occurred
263            */
264            public int countByCompanyId(long companyId)
265                    throws com.liferay.portal.kernel.exception.SystemException;
266    
267            /**
268            * Counts all the contacts.
269            *
270            * @return the number of contacts
271            * @throws SystemException if a system exception occurred
272            */
273            public int countAll()
274                    throws com.liferay.portal.kernel.exception.SystemException;
275    }