001    /**
002     * Copyright (c) 2000-2012 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.Company;
018    
019    /**
020     * The persistence interface for the company service.
021     *
022     * <p>
023     * Caching information and settings can be found in <code>portal.properties</code>
024     * </p>
025     *
026     * @author Brian Wing Shun Chan
027     * @see CompanyPersistenceImpl
028     * @see CompanyUtil
029     * @generated
030     */
031    public interface CompanyPersistence extends BasePersistence<Company> {
032            /*
033             * NOTE FOR DEVELOPERS:
034             *
035             * Never modify or reference this interface directly. Always use {@link CompanyUtil} to access the company persistence. Modify <code>service.xml</code> and rerun ServiceBuilder to regenerate this interface.
036             */
037    
038            /**
039            * Caches the company in the entity cache if it is enabled.
040            *
041            * @param company the company
042            */
043            public void cacheResult(com.liferay.portal.model.Company company);
044    
045            /**
046            * Caches the companies in the entity cache if it is enabled.
047            *
048            * @param companies the companies
049            */
050            public void cacheResult(
051                    java.util.List<com.liferay.portal.model.Company> companies);
052    
053            /**
054            * Creates a new company with the primary key. Does not add the company to the database.
055            *
056            * @param companyId the primary key for the new company
057            * @return the new company
058            */
059            public com.liferay.portal.model.Company create(long companyId);
060    
061            /**
062            * Removes the company with the primary key from the database. Also notifies the appropriate model listeners.
063            *
064            * @param companyId the primary key of the company
065            * @return the company that was removed
066            * @throws com.liferay.portal.NoSuchCompanyException if a company with the primary key could not be found
067            * @throws SystemException if a system exception occurred
068            */
069            public com.liferay.portal.model.Company remove(long companyId)
070                    throws com.liferay.portal.NoSuchCompanyException,
071                            com.liferay.portal.kernel.exception.SystemException;
072    
073            public com.liferay.portal.model.Company updateImpl(
074                    com.liferay.portal.model.Company company, boolean merge)
075                    throws com.liferay.portal.kernel.exception.SystemException;
076    
077            /**
078            * Returns the company with the primary key or throws a {@link com.liferay.portal.NoSuchCompanyException} if it could not be found.
079            *
080            * @param companyId the primary key of the company
081            * @return the company
082            * @throws com.liferay.portal.NoSuchCompanyException if a company with the primary key could not be found
083            * @throws SystemException if a system exception occurred
084            */
085            public com.liferay.portal.model.Company findByPrimaryKey(long companyId)
086                    throws com.liferay.portal.NoSuchCompanyException,
087                            com.liferay.portal.kernel.exception.SystemException;
088    
089            /**
090            * Returns the company with the primary key or returns <code>null</code> if it could not be found.
091            *
092            * @param companyId the primary key of the company
093            * @return the company, or <code>null</code> if a company with the primary key could not be found
094            * @throws SystemException if a system exception occurred
095            */
096            public com.liferay.portal.model.Company fetchByPrimaryKey(long companyId)
097                    throws com.liferay.portal.kernel.exception.SystemException;
098    
099            /**
100            * Returns the company where webId = &#63; or throws a {@link com.liferay.portal.NoSuchCompanyException} if it could not be found.
101            *
102            * @param webId the web ID
103            * @return the matching company
104            * @throws com.liferay.portal.NoSuchCompanyException if a matching company could not be found
105            * @throws SystemException if a system exception occurred
106            */
107            public com.liferay.portal.model.Company findByWebId(java.lang.String webId)
108                    throws com.liferay.portal.NoSuchCompanyException,
109                            com.liferay.portal.kernel.exception.SystemException;
110    
111            /**
112            * Returns the company where webId = &#63; or returns <code>null</code> if it could not be found. Uses the finder cache.
113            *
114            * @param webId the web ID
115            * @return the matching company, or <code>null</code> if a matching company could not be found
116            * @throws SystemException if a system exception occurred
117            */
118            public com.liferay.portal.model.Company fetchByWebId(java.lang.String webId)
119                    throws com.liferay.portal.kernel.exception.SystemException;
120    
121            /**
122            * Returns the company where webId = &#63; or returns <code>null</code> if it could not be found, optionally using the finder cache.
123            *
124            * @param webId the web ID
125            * @param retrieveFromCache whether to use the finder cache
126            * @return the matching company, or <code>null</code> if a matching company could not be found
127            * @throws SystemException if a system exception occurred
128            */
129            public com.liferay.portal.model.Company fetchByWebId(
130                    java.lang.String webId, boolean retrieveFromCache)
131                    throws com.liferay.portal.kernel.exception.SystemException;
132    
133            /**
134            * Returns the company where mx = &#63; or throws a {@link com.liferay.portal.NoSuchCompanyException} if it could not be found.
135            *
136            * @param mx the mx
137            * @return the matching company
138            * @throws com.liferay.portal.NoSuchCompanyException if a matching company could not be found
139            * @throws SystemException if a system exception occurred
140            */
141            public com.liferay.portal.model.Company findByMx(java.lang.String mx)
142                    throws com.liferay.portal.NoSuchCompanyException,
143                            com.liferay.portal.kernel.exception.SystemException;
144    
145            /**
146            * Returns the company where mx = &#63; or returns <code>null</code> if it could not be found. Uses the finder cache.
147            *
148            * @param mx the mx
149            * @return the matching company, or <code>null</code> if a matching company could not be found
150            * @throws SystemException if a system exception occurred
151            */
152            public com.liferay.portal.model.Company fetchByMx(java.lang.String mx)
153                    throws com.liferay.portal.kernel.exception.SystemException;
154    
155            /**
156            * Returns the company where mx = &#63; or returns <code>null</code> if it could not be found, optionally using the finder cache.
157            *
158            * @param mx the mx
159            * @param retrieveFromCache whether to use the finder cache
160            * @return the matching company, or <code>null</code> if a matching company could not be found
161            * @throws SystemException if a system exception occurred
162            */
163            public com.liferay.portal.model.Company fetchByMx(java.lang.String mx,
164                    boolean retrieveFromCache)
165                    throws com.liferay.portal.kernel.exception.SystemException;
166    
167            /**
168            * Returns the company where logoId = &#63; or throws a {@link com.liferay.portal.NoSuchCompanyException} if it could not be found.
169            *
170            * @param logoId the logo ID
171            * @return the matching company
172            * @throws com.liferay.portal.NoSuchCompanyException if a matching company could not be found
173            * @throws SystemException if a system exception occurred
174            */
175            public com.liferay.portal.model.Company findByLogoId(long logoId)
176                    throws com.liferay.portal.NoSuchCompanyException,
177                            com.liferay.portal.kernel.exception.SystemException;
178    
179            /**
180            * Returns the company where logoId = &#63; or returns <code>null</code> if it could not be found. Uses the finder cache.
181            *
182            * @param logoId the logo ID
183            * @return the matching company, or <code>null</code> if a matching company could not be found
184            * @throws SystemException if a system exception occurred
185            */
186            public com.liferay.portal.model.Company fetchByLogoId(long logoId)
187                    throws com.liferay.portal.kernel.exception.SystemException;
188    
189            /**
190            * Returns the company where logoId = &#63; or returns <code>null</code> if it could not be found, optionally using the finder cache.
191            *
192            * @param logoId the logo ID
193            * @param retrieveFromCache whether to use the finder cache
194            * @return the matching company, or <code>null</code> if a matching company could not be found
195            * @throws SystemException if a system exception occurred
196            */
197            public com.liferay.portal.model.Company fetchByLogoId(long logoId,
198                    boolean retrieveFromCache)
199                    throws com.liferay.portal.kernel.exception.SystemException;
200    
201            /**
202            * Returns all the companies where system = &#63;.
203            *
204            * @param system the system
205            * @return the matching companies
206            * @throws SystemException if a system exception occurred
207            */
208            public java.util.List<com.liferay.portal.model.Company> findBySystem(
209                    boolean system)
210                    throws com.liferay.portal.kernel.exception.SystemException;
211    
212            /**
213            * Returns a range of all the companies where system = &#63;.
214            *
215            * <p>
216            * 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.
217            * </p>
218            *
219            * @param system the system
220            * @param start the lower bound of the range of companies
221            * @param end the upper bound of the range of companies (not inclusive)
222            * @return the range of matching companies
223            * @throws SystemException if a system exception occurred
224            */
225            public java.util.List<com.liferay.portal.model.Company> findBySystem(
226                    boolean system, int start, int end)
227                    throws com.liferay.portal.kernel.exception.SystemException;
228    
229            /**
230            * Returns an ordered range of all the companies where system = &#63;.
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 system the system
237            * @param start the lower bound of the range of companies
238            * @param end the upper bound of the range of companies (not inclusive)
239            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
240            * @return the ordered range of matching companies
241            * @throws SystemException if a system exception occurred
242            */
243            public java.util.List<com.liferay.portal.model.Company> findBySystem(
244                    boolean system, int start, int end,
245                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
246                    throws com.liferay.portal.kernel.exception.SystemException;
247    
248            /**
249            * Returns the first company in the ordered set where system = &#63;.
250            *
251            * <p>
252            * 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.
253            * </p>
254            *
255            * @param system the system
256            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
257            * @return the first matching company
258            * @throws com.liferay.portal.NoSuchCompanyException if a matching company could not be found
259            * @throws SystemException if a system exception occurred
260            */
261            public com.liferay.portal.model.Company findBySystem_First(boolean system,
262                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
263                    throws com.liferay.portal.NoSuchCompanyException,
264                            com.liferay.portal.kernel.exception.SystemException;
265    
266            /**
267            * Returns the last company in the ordered set where system = &#63;.
268            *
269            * <p>
270            * 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.
271            * </p>
272            *
273            * @param system the system
274            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
275            * @return the last matching company
276            * @throws com.liferay.portal.NoSuchCompanyException if a matching company could not be found
277            * @throws SystemException if a system exception occurred
278            */
279            public com.liferay.portal.model.Company findBySystem_Last(boolean system,
280                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
281                    throws com.liferay.portal.NoSuchCompanyException,
282                            com.liferay.portal.kernel.exception.SystemException;
283    
284            /**
285            * Returns the companies before and after the current company in the ordered set where system = &#63;.
286            *
287            * <p>
288            * 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.
289            * </p>
290            *
291            * @param companyId the primary key of the current company
292            * @param system the system
293            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
294            * @return the previous, current, and next company
295            * @throws com.liferay.portal.NoSuchCompanyException if a company with the primary key could not be found
296            * @throws SystemException if a system exception occurred
297            */
298            public com.liferay.portal.model.Company[] findBySystem_PrevAndNext(
299                    long companyId, boolean system,
300                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
301                    throws com.liferay.portal.NoSuchCompanyException,
302                            com.liferay.portal.kernel.exception.SystemException;
303    
304            /**
305            * Returns all the companies.
306            *
307            * @return the companies
308            * @throws SystemException if a system exception occurred
309            */
310            public java.util.List<com.liferay.portal.model.Company> findAll()
311                    throws com.liferay.portal.kernel.exception.SystemException;
312    
313            /**
314            * Returns a range of all the companies.
315            *
316            * <p>
317            * 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.
318            * </p>
319            *
320            * @param start the lower bound of the range of companies
321            * @param end the upper bound of the range of companies (not inclusive)
322            * @return the range of companies
323            * @throws SystemException if a system exception occurred
324            */
325            public java.util.List<com.liferay.portal.model.Company> findAll(int start,
326                    int end) throws com.liferay.portal.kernel.exception.SystemException;
327    
328            /**
329            * Returns an ordered range of all the companies.
330            *
331            * <p>
332            * 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.
333            * </p>
334            *
335            * @param start the lower bound of the range of companies
336            * @param end the upper bound of the range of companies (not inclusive)
337            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
338            * @return the ordered range of companies
339            * @throws SystemException if a system exception occurred
340            */
341            public java.util.List<com.liferay.portal.model.Company> findAll(int start,
342                    int end,
343                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
344                    throws com.liferay.portal.kernel.exception.SystemException;
345    
346            /**
347            * Removes the company where webId = &#63; from the database.
348            *
349            * @param webId the web ID
350            * @throws SystemException if a system exception occurred
351            */
352            public void removeByWebId(java.lang.String webId)
353                    throws com.liferay.portal.NoSuchCompanyException,
354                            com.liferay.portal.kernel.exception.SystemException;
355    
356            /**
357            * Removes the company where mx = &#63; from the database.
358            *
359            * @param mx the mx
360            * @throws SystemException if a system exception occurred
361            */
362            public void removeByMx(java.lang.String mx)
363                    throws com.liferay.portal.NoSuchCompanyException,
364                            com.liferay.portal.kernel.exception.SystemException;
365    
366            /**
367            * Removes the company where logoId = &#63; from the database.
368            *
369            * @param logoId the logo ID
370            * @throws SystemException if a system exception occurred
371            */
372            public void removeByLogoId(long logoId)
373                    throws com.liferay.portal.NoSuchCompanyException,
374                            com.liferay.portal.kernel.exception.SystemException;
375    
376            /**
377            * Removes all the companies where system = &#63; from the database.
378            *
379            * @param system the system
380            * @throws SystemException if a system exception occurred
381            */
382            public void removeBySystem(boolean system)
383                    throws com.liferay.portal.kernel.exception.SystemException;
384    
385            /**
386            * Removes all the companies from the database.
387            *
388            * @throws SystemException if a system exception occurred
389            */
390            public void removeAll()
391                    throws com.liferay.portal.kernel.exception.SystemException;
392    
393            /**
394            * Returns the number of companies where webId = &#63;.
395            *
396            * @param webId the web ID
397            * @return the number of matching companies
398            * @throws SystemException if a system exception occurred
399            */
400            public int countByWebId(java.lang.String webId)
401                    throws com.liferay.portal.kernel.exception.SystemException;
402    
403            /**
404            * Returns the number of companies where mx = &#63;.
405            *
406            * @param mx the mx
407            * @return the number of matching companies
408            * @throws SystemException if a system exception occurred
409            */
410            public int countByMx(java.lang.String mx)
411                    throws com.liferay.portal.kernel.exception.SystemException;
412    
413            /**
414            * Returns the number of companies where logoId = &#63;.
415            *
416            * @param logoId the logo ID
417            * @return the number of matching companies
418            * @throws SystemException if a system exception occurred
419            */
420            public int countByLogoId(long logoId)
421                    throws com.liferay.portal.kernel.exception.SystemException;
422    
423            /**
424            * Returns the number of companies where system = &#63;.
425            *
426            * @param system the system
427            * @return the number of matching companies
428            * @throws SystemException if a system exception occurred
429            */
430            public int countBySystem(boolean system)
431                    throws com.liferay.portal.kernel.exception.SystemException;
432    
433            /**
434            * Returns the number of companies.
435            *
436            * @return the number of companies
437            * @throws SystemException if a system exception occurred
438            */
439            public int countAll()
440                    throws com.liferay.portal.kernel.exception.SystemException;
441    }