001    /**
002     * Copyright (c) 2000-2011 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.kernel.exception.SystemException;
018    import com.liferay.portal.model.Contact;
019    
020    /**
021     * The persistence interface for the contact service.
022     *
023     * <p>
024     * Caching information and settings can be found in <code>portal.properties</code>
025     * </p>
026     *
027     * @author Brian Wing Shun Chan
028     * @see ContactPersistenceImpl
029     * @see ContactUtil
030     * @generated
031     */
032    public interface ContactPersistence extends BasePersistence<Contact> {
033            /*
034             * NOTE FOR DEVELOPERS:
035             *
036             * Never modify or reference this interface directly. Always use {@link ContactUtil} to access the contact persistence. Modify <code>service.xml</code> and rerun ServiceBuilder to regenerate this interface.
037             */
038    
039            /**
040            * Caches the contact in the entity cache if it is enabled.
041            *
042            * @param contact the contact
043            */
044            public void cacheResult(com.liferay.portal.model.Contact contact);
045    
046            /**
047            * Caches the contacts in the entity cache if it is enabled.
048            *
049            * @param contacts the contacts
050            */
051            public void cacheResult(
052                    java.util.List<com.liferay.portal.model.Contact> contacts);
053    
054            /**
055            * Creates a new contact with the primary key. Does not add the contact to the database.
056            *
057            * @param contactId the primary key for the new contact
058            * @return the new contact
059            */
060            public com.liferay.portal.model.Contact create(long contactId);
061    
062            /**
063            * Removes the contact with the primary key from the database. Also notifies the appropriate model listeners.
064            *
065            * @param contactId the primary key of the contact
066            * @return the contact that was removed
067            * @throws com.liferay.portal.NoSuchContactException if a contact with the primary key could not be found
068            * @throws SystemException if a system exception occurred
069            */
070            public com.liferay.portal.model.Contact remove(long contactId)
071                    throws com.liferay.portal.NoSuchContactException,
072                            com.liferay.portal.kernel.exception.SystemException;
073    
074            public com.liferay.portal.model.Contact updateImpl(
075                    com.liferay.portal.model.Contact contact, boolean merge)
076                    throws com.liferay.portal.kernel.exception.SystemException;
077    
078            /**
079            * Returns the contact with the primary key or throws a {@link com.liferay.portal.NoSuchContactException} if it could not be found.
080            *
081            * @param contactId the primary key of the contact
082            * @return the contact
083            * @throws com.liferay.portal.NoSuchContactException if a contact with the primary key could not be found
084            * @throws SystemException if a system exception occurred
085            */
086            public com.liferay.portal.model.Contact findByPrimaryKey(long contactId)
087                    throws com.liferay.portal.NoSuchContactException,
088                            com.liferay.portal.kernel.exception.SystemException;
089    
090            /**
091            * Returns the contact with the primary key or returns <code>null</code> if it could not be found.
092            *
093            * @param contactId the primary key of the contact
094            * @return the contact, or <code>null</code> if a contact with the primary key could not be found
095            * @throws SystemException if a system exception occurred
096            */
097            public com.liferay.portal.model.Contact fetchByPrimaryKey(long contactId)
098                    throws com.liferay.portal.kernel.exception.SystemException;
099    
100            /**
101            * Returns all the contacts where companyId = &#63;.
102            *
103            * @param companyId the company ID
104            * @return the matching contacts
105            * @throws SystemException if a system exception occurred
106            */
107            public java.util.List<com.liferay.portal.model.Contact> findByCompanyId(
108                    long companyId)
109                    throws com.liferay.portal.kernel.exception.SystemException;
110    
111            /**
112            * Returns a range of all the contacts where companyId = &#63;.
113            *
114            * <p>
115            * 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.
116            * </p>
117            *
118            * @param companyId the company ID
119            * @param start the lower bound of the range of contacts
120            * @param end the upper bound of the range of contacts (not inclusive)
121            * @return the range of matching contacts
122            * @throws SystemException if a system exception occurred
123            */
124            public java.util.List<com.liferay.portal.model.Contact> findByCompanyId(
125                    long companyId, int start, int end)
126                    throws com.liferay.portal.kernel.exception.SystemException;
127    
128            /**
129            * Returns an ordered range of all the contacts where companyId = &#63;.
130            *
131            * <p>
132            * 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.
133            * </p>
134            *
135            * @param companyId the company ID
136            * @param start the lower bound of the range of contacts
137            * @param end the upper bound of the range of contacts (not inclusive)
138            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
139            * @return the ordered range of matching contacts
140            * @throws SystemException if a system exception occurred
141            */
142            public java.util.List<com.liferay.portal.model.Contact> findByCompanyId(
143                    long companyId, int start, int end,
144                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
145                    throws com.liferay.portal.kernel.exception.SystemException;
146    
147            /**
148            * Returns the first contact in the ordered set where companyId = &#63;.
149            *
150            * <p>
151            * 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.
152            * </p>
153            *
154            * @param companyId the company ID
155            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
156            * @return the first matching contact
157            * @throws com.liferay.portal.NoSuchContactException if a matching contact could not be found
158            * @throws SystemException if a system exception occurred
159            */
160            public com.liferay.portal.model.Contact findByCompanyId_First(
161                    long companyId,
162                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
163                    throws com.liferay.portal.NoSuchContactException,
164                            com.liferay.portal.kernel.exception.SystemException;
165    
166            /**
167            * Returns the last contact in the ordered set where companyId = &#63;.
168            *
169            * <p>
170            * 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.
171            * </p>
172            *
173            * @param companyId the company ID
174            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
175            * @return the last matching contact
176            * @throws com.liferay.portal.NoSuchContactException if a matching contact could not be found
177            * @throws SystemException if a system exception occurred
178            */
179            public com.liferay.portal.model.Contact findByCompanyId_Last(
180                    long companyId,
181                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
182                    throws com.liferay.portal.NoSuchContactException,
183                            com.liferay.portal.kernel.exception.SystemException;
184    
185            /**
186            * Returns the contacts before and after the current contact in the ordered set where companyId = &#63;.
187            *
188            * <p>
189            * 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.
190            * </p>
191            *
192            * @param contactId the primary key of the current contact
193            * @param companyId the company ID
194            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
195            * @return the previous, current, and next contact
196            * @throws com.liferay.portal.NoSuchContactException if a contact with the primary key could not be found
197            * @throws SystemException if a system exception occurred
198            */
199            public com.liferay.portal.model.Contact[] findByCompanyId_PrevAndNext(
200                    long contactId, long companyId,
201                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
202                    throws com.liferay.portal.NoSuchContactException,
203                            com.liferay.portal.kernel.exception.SystemException;
204    
205            /**
206            * Returns all the contacts.
207            *
208            * @return the contacts
209            * @throws SystemException if a system exception occurred
210            */
211            public java.util.List<com.liferay.portal.model.Contact> findAll()
212                    throws com.liferay.portal.kernel.exception.SystemException;
213    
214            /**
215            * Returns a range of all the contacts.
216            *
217            * <p>
218            * 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.
219            * </p>
220            *
221            * @param start the lower bound of the range of contacts
222            * @param end the upper bound of the range of contacts (not inclusive)
223            * @return the range of contacts
224            * @throws SystemException if a system exception occurred
225            */
226            public java.util.List<com.liferay.portal.model.Contact> findAll(int start,
227                    int end) throws com.liferay.portal.kernel.exception.SystemException;
228    
229            /**
230            * Returns an ordered range of all the contacts.
231            *
232            * <p>
233            * 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.
234            * </p>
235            *
236            * @param start the lower bound of the range of contacts
237            * @param end the upper bound of the range of contacts (not inclusive)
238            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
239            * @return the ordered range of contacts
240            * @throws SystemException if a system exception occurred
241            */
242            public java.util.List<com.liferay.portal.model.Contact> findAll(int start,
243                    int end,
244                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
245                    throws com.liferay.portal.kernel.exception.SystemException;
246    
247            /**
248            * Removes all the contacts where companyId = &#63; from the database.
249            *
250            * @param companyId the company ID
251            * @throws SystemException if a system exception occurred
252            */
253            public void removeByCompanyId(long companyId)
254                    throws com.liferay.portal.kernel.exception.SystemException;
255    
256            /**
257            * Removes all the contacts from the database.
258            *
259            * @throws SystemException if a system exception occurred
260            */
261            public void removeAll()
262                    throws com.liferay.portal.kernel.exception.SystemException;
263    
264            /**
265            * Returns the number of contacts where companyId = &#63;.
266            *
267            * @param companyId the company ID
268            * @return the number of matching contacts
269            * @throws SystemException if a system exception occurred
270            */
271            public int countByCompanyId(long companyId)
272                    throws com.liferay.portal.kernel.exception.SystemException;
273    
274            /**
275            * Returns the number of contacts.
276            *
277            * @return the number of contacts
278            * @throws SystemException if a system exception occurred
279            */
280            public int countAll()
281                    throws com.liferay.portal.kernel.exception.SystemException;
282    
283            public Contact remove(Contact contact) throws SystemException;
284    }