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