001    /**
002     * Copyright (c) 2000-2013 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.bean.PortalBeanLocatorUtil;
018    import com.liferay.portal.kernel.dao.orm.DynamicQuery;
019    import com.liferay.portal.kernel.exception.SystemException;
020    import com.liferay.portal.kernel.util.OrderByComparator;
021    import com.liferay.portal.kernel.util.ReferenceRegistry;
022    import com.liferay.portal.model.Company;
023    import com.liferay.portal.service.ServiceContext;
024    
025    import java.util.List;
026    
027    /**
028     * The persistence utility for the company service. This utility wraps {@link CompanyPersistenceImpl} and provides direct access to the database for CRUD operations. This utility should only be used by the service layer, as it must operate within a transaction. Never access this utility in a JSP, controller, model, or other front-end class.
029     *
030     * <p>
031     * Caching information and settings can be found in <code>portal.properties</code>
032     * </p>
033     *
034     * @author Brian Wing Shun Chan
035     * @see CompanyPersistence
036     * @see CompanyPersistenceImpl
037     * @generated
038     */
039    public class CompanyUtil {
040            /*
041             * NOTE FOR DEVELOPERS:
042             *
043             * Never modify this class directly. Modify <code>service.xml</code> and rerun ServiceBuilder to regenerate this class.
044             */
045    
046            /**
047             * @see com.liferay.portal.service.persistence.BasePersistence#clearCache()
048             */
049            public static void clearCache() {
050                    getPersistence().clearCache();
051            }
052    
053            /**
054             * @see com.liferay.portal.service.persistence.BasePersistence#clearCache(com.liferay.portal.model.BaseModel)
055             */
056            public static void clearCache(Company company) {
057                    getPersistence().clearCache(company);
058            }
059    
060            /**
061             * @see com.liferay.portal.service.persistence.BasePersistence#countWithDynamicQuery(DynamicQuery)
062             */
063            public static long countWithDynamicQuery(DynamicQuery dynamicQuery)
064                    throws SystemException {
065                    return getPersistence().countWithDynamicQuery(dynamicQuery);
066            }
067    
068            /**
069             * @see com.liferay.portal.service.persistence.BasePersistence#findWithDynamicQuery(DynamicQuery)
070             */
071            public static List<Company> findWithDynamicQuery(DynamicQuery dynamicQuery)
072                    throws SystemException {
073                    return getPersistence().findWithDynamicQuery(dynamicQuery);
074            }
075    
076            /**
077             * @see com.liferay.portal.service.persistence.BasePersistence#findWithDynamicQuery(DynamicQuery, int, int)
078             */
079            public static List<Company> findWithDynamicQuery(
080                    DynamicQuery dynamicQuery, int start, int end)
081                    throws SystemException {
082                    return getPersistence().findWithDynamicQuery(dynamicQuery, start, end);
083            }
084    
085            /**
086             * @see com.liferay.portal.service.persistence.BasePersistence#findWithDynamicQuery(DynamicQuery, int, int, OrderByComparator)
087             */
088            public static List<Company> findWithDynamicQuery(
089                    DynamicQuery dynamicQuery, int start, int end,
090                    OrderByComparator orderByComparator) throws SystemException {
091                    return getPersistence()
092                                       .findWithDynamicQuery(dynamicQuery, start, end,
093                            orderByComparator);
094            }
095    
096            /**
097             * @see com.liferay.portal.service.persistence.BasePersistence#update(com.liferay.portal.model.BaseModel)
098             */
099            public static Company update(Company company) throws SystemException {
100                    return getPersistence().update(company);
101            }
102    
103            /**
104             * @see com.liferay.portal.service.persistence.BasePersistence#update(com.liferay.portal.model.BaseModel, ServiceContext)
105             */
106            public static Company update(Company company, ServiceContext serviceContext)
107                    throws SystemException {
108                    return getPersistence().update(company, serviceContext);
109            }
110    
111            /**
112            * Returns the company where webId = &#63; or throws a {@link com.liferay.portal.NoSuchCompanyException} if it could not be found.
113            *
114            * @param webId the web ID
115            * @return the matching company
116            * @throws com.liferay.portal.NoSuchCompanyException if a matching company could not be found
117            * @throws SystemException if a system exception occurred
118            */
119            public static com.liferay.portal.model.Company findByWebId(
120                    java.lang.String webId)
121                    throws com.liferay.portal.NoSuchCompanyException,
122                            com.liferay.portal.kernel.exception.SystemException {
123                    return getPersistence().findByWebId(webId);
124            }
125    
126            /**
127            * Returns the company where webId = &#63; or returns <code>null</code> if it could not be found. Uses the finder cache.
128            *
129            * @param webId the web ID
130            * @return the matching company, or <code>null</code> if a matching company could not be found
131            * @throws SystemException if a system exception occurred
132            */
133            public static com.liferay.portal.model.Company fetchByWebId(
134                    java.lang.String webId)
135                    throws com.liferay.portal.kernel.exception.SystemException {
136                    return getPersistence().fetchByWebId(webId);
137            }
138    
139            /**
140            * Returns the company where webId = &#63; or returns <code>null</code> if it could not be found, optionally using the finder cache.
141            *
142            * @param webId the web ID
143            * @param retrieveFromCache whether to use the finder cache
144            * @return the matching company, or <code>null</code> if a matching company could not be found
145            * @throws SystemException if a system exception occurred
146            */
147            public static com.liferay.portal.model.Company fetchByWebId(
148                    java.lang.String webId, boolean retrieveFromCache)
149                    throws com.liferay.portal.kernel.exception.SystemException {
150                    return getPersistence().fetchByWebId(webId, retrieveFromCache);
151            }
152    
153            /**
154            * Removes the company where webId = &#63; from the database.
155            *
156            * @param webId the web ID
157            * @return the company that was removed
158            * @throws SystemException if a system exception occurred
159            */
160            public static com.liferay.portal.model.Company removeByWebId(
161                    java.lang.String webId)
162                    throws com.liferay.portal.NoSuchCompanyException,
163                            com.liferay.portal.kernel.exception.SystemException {
164                    return getPersistence().removeByWebId(webId);
165            }
166    
167            /**
168            * Returns the number of companies where webId = &#63;.
169            *
170            * @param webId the web ID
171            * @return the number of matching companies
172            * @throws SystemException if a system exception occurred
173            */
174            public static int countByWebId(java.lang.String webId)
175                    throws com.liferay.portal.kernel.exception.SystemException {
176                    return getPersistence().countByWebId(webId);
177            }
178    
179            /**
180            * Returns the company where mx = &#63; or throws a {@link com.liferay.portal.NoSuchCompanyException} if it could not be found.
181            *
182            * @param mx the mx
183            * @return the matching company
184            * @throws com.liferay.portal.NoSuchCompanyException if a matching company could not be found
185            * @throws SystemException if a system exception occurred
186            */
187            public static com.liferay.portal.model.Company findByMx(java.lang.String mx)
188                    throws com.liferay.portal.NoSuchCompanyException,
189                            com.liferay.portal.kernel.exception.SystemException {
190                    return getPersistence().findByMx(mx);
191            }
192    
193            /**
194            * Returns the company where mx = &#63; or returns <code>null</code> if it could not be found. Uses the finder cache.
195            *
196            * @param mx the mx
197            * @return the matching company, or <code>null</code> if a matching company could not be found
198            * @throws SystemException if a system exception occurred
199            */
200            public static com.liferay.portal.model.Company fetchByMx(
201                    java.lang.String mx)
202                    throws com.liferay.portal.kernel.exception.SystemException {
203                    return getPersistence().fetchByMx(mx);
204            }
205    
206            /**
207            * Returns the company where mx = &#63; or returns <code>null</code> if it could not be found, optionally using the finder cache.
208            *
209            * @param mx the mx
210            * @param retrieveFromCache whether to use the finder cache
211            * @return the matching company, or <code>null</code> if a matching company could not be found
212            * @throws SystemException if a system exception occurred
213            */
214            public static com.liferay.portal.model.Company fetchByMx(
215                    java.lang.String mx, boolean retrieveFromCache)
216                    throws com.liferay.portal.kernel.exception.SystemException {
217                    return getPersistence().fetchByMx(mx, retrieveFromCache);
218            }
219    
220            /**
221            * Removes the company where mx = &#63; from the database.
222            *
223            * @param mx the mx
224            * @return the company that was removed
225            * @throws SystemException if a system exception occurred
226            */
227            public static com.liferay.portal.model.Company removeByMx(
228                    java.lang.String mx)
229                    throws com.liferay.portal.NoSuchCompanyException,
230                            com.liferay.portal.kernel.exception.SystemException {
231                    return getPersistence().removeByMx(mx);
232            }
233    
234            /**
235            * Returns the number of companies where mx = &#63;.
236            *
237            * @param mx the mx
238            * @return the number of matching companies
239            * @throws SystemException if a system exception occurred
240            */
241            public static int countByMx(java.lang.String mx)
242                    throws com.liferay.portal.kernel.exception.SystemException {
243                    return getPersistence().countByMx(mx);
244            }
245    
246            /**
247            * Returns the company where logoId = &#63; or throws a {@link com.liferay.portal.NoSuchCompanyException} if it could not be found.
248            *
249            * @param logoId the logo ID
250            * @return the matching company
251            * @throws com.liferay.portal.NoSuchCompanyException if a matching company could not be found
252            * @throws SystemException if a system exception occurred
253            */
254            public static com.liferay.portal.model.Company findByLogoId(long logoId)
255                    throws com.liferay.portal.NoSuchCompanyException,
256                            com.liferay.portal.kernel.exception.SystemException {
257                    return getPersistence().findByLogoId(logoId);
258            }
259    
260            /**
261            * Returns the company where logoId = &#63; or returns <code>null</code> if it could not be found. Uses the finder cache.
262            *
263            * @param logoId the logo ID
264            * @return the matching company, or <code>null</code> if a matching company could not be found
265            * @throws SystemException if a system exception occurred
266            */
267            public static com.liferay.portal.model.Company fetchByLogoId(long logoId)
268                    throws com.liferay.portal.kernel.exception.SystemException {
269                    return getPersistence().fetchByLogoId(logoId);
270            }
271    
272            /**
273            * Returns the company where logoId = &#63; or returns <code>null</code> if it could not be found, optionally using the finder cache.
274            *
275            * @param logoId the logo ID
276            * @param retrieveFromCache whether to use the finder cache
277            * @return the matching company, or <code>null</code> if a matching company could not be found
278            * @throws SystemException if a system exception occurred
279            */
280            public static com.liferay.portal.model.Company fetchByLogoId(long logoId,
281                    boolean retrieveFromCache)
282                    throws com.liferay.portal.kernel.exception.SystemException {
283                    return getPersistence().fetchByLogoId(logoId, retrieveFromCache);
284            }
285    
286            /**
287            * Removes the company where logoId = &#63; from the database.
288            *
289            * @param logoId the logo ID
290            * @return the company that was removed
291            * @throws SystemException if a system exception occurred
292            */
293            public static com.liferay.portal.model.Company removeByLogoId(long logoId)
294                    throws com.liferay.portal.NoSuchCompanyException,
295                            com.liferay.portal.kernel.exception.SystemException {
296                    return getPersistence().removeByLogoId(logoId);
297            }
298    
299            /**
300            * Returns the number of companies where logoId = &#63;.
301            *
302            * @param logoId the logo ID
303            * @return the number of matching companies
304            * @throws SystemException if a system exception occurred
305            */
306            public static int countByLogoId(long logoId)
307                    throws com.liferay.portal.kernel.exception.SystemException {
308                    return getPersistence().countByLogoId(logoId);
309            }
310    
311            /**
312            * Returns all the companies where system = &#63;.
313            *
314            * @param system the system
315            * @return the matching companies
316            * @throws SystemException if a system exception occurred
317            */
318            public static java.util.List<com.liferay.portal.model.Company> findBySystem(
319                    boolean system)
320                    throws com.liferay.portal.kernel.exception.SystemException {
321                    return getPersistence().findBySystem(system);
322            }
323    
324            /**
325            * Returns a range of all the companies where system = &#63;.
326            *
327            * <p>
328            * 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.
329            * </p>
330            *
331            * @param system the system
332            * @param start the lower bound of the range of companies
333            * @param end the upper bound of the range of companies (not inclusive)
334            * @return the range of matching companies
335            * @throws SystemException if a system exception occurred
336            */
337            public static java.util.List<com.liferay.portal.model.Company> findBySystem(
338                    boolean system, int start, int end)
339                    throws com.liferay.portal.kernel.exception.SystemException {
340                    return getPersistence().findBySystem(system, start, end);
341            }
342    
343            /**
344            * Returns an ordered range of all the companies where system = &#63;.
345            *
346            * <p>
347            * 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.
348            * </p>
349            *
350            * @param system the system
351            * @param start the lower bound of the range of companies
352            * @param end the upper bound of the range of companies (not inclusive)
353            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
354            * @return the ordered range of matching companies
355            * @throws SystemException if a system exception occurred
356            */
357            public static java.util.List<com.liferay.portal.model.Company> findBySystem(
358                    boolean system, int start, int end,
359                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
360                    throws com.liferay.portal.kernel.exception.SystemException {
361                    return getPersistence()
362                                       .findBySystem(system, start, end, orderByComparator);
363            }
364    
365            /**
366            * Returns the first company in the ordered set where system = &#63;.
367            *
368            * @param system the system
369            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
370            * @return the first matching company
371            * @throws com.liferay.portal.NoSuchCompanyException if a matching company could not be found
372            * @throws SystemException if a system exception occurred
373            */
374            public static com.liferay.portal.model.Company findBySystem_First(
375                    boolean system,
376                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
377                    throws com.liferay.portal.NoSuchCompanyException,
378                            com.liferay.portal.kernel.exception.SystemException {
379                    return getPersistence().findBySystem_First(system, orderByComparator);
380            }
381    
382            /**
383            * Returns the first company in the ordered set where system = &#63;.
384            *
385            * @param system the system
386            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
387            * @return the first matching company, or <code>null</code> if a matching company could not be found
388            * @throws SystemException if a system exception occurred
389            */
390            public static com.liferay.portal.model.Company fetchBySystem_First(
391                    boolean system,
392                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
393                    throws com.liferay.portal.kernel.exception.SystemException {
394                    return getPersistence().fetchBySystem_First(system, orderByComparator);
395            }
396    
397            /**
398            * Returns the last company in the ordered set where system = &#63;.
399            *
400            * @param system the system
401            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
402            * @return the last matching company
403            * @throws com.liferay.portal.NoSuchCompanyException if a matching company could not be found
404            * @throws SystemException if a system exception occurred
405            */
406            public static com.liferay.portal.model.Company findBySystem_Last(
407                    boolean system,
408                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
409                    throws com.liferay.portal.NoSuchCompanyException,
410                            com.liferay.portal.kernel.exception.SystemException {
411                    return getPersistence().findBySystem_Last(system, orderByComparator);
412            }
413    
414            /**
415            * Returns the last company in the ordered set where system = &#63;.
416            *
417            * @param system the system
418            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
419            * @return the last matching company, or <code>null</code> if a matching company could not be found
420            * @throws SystemException if a system exception occurred
421            */
422            public static com.liferay.portal.model.Company fetchBySystem_Last(
423                    boolean system,
424                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
425                    throws com.liferay.portal.kernel.exception.SystemException {
426                    return getPersistence().fetchBySystem_Last(system, orderByComparator);
427            }
428    
429            /**
430            * Returns the companies before and after the current company in the ordered set where system = &#63;.
431            *
432            * @param companyId the primary key of the current company
433            * @param system the system
434            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
435            * @return the previous, current, and next company
436            * @throws com.liferay.portal.NoSuchCompanyException if a company with the primary key could not be found
437            * @throws SystemException if a system exception occurred
438            */
439            public static com.liferay.portal.model.Company[] findBySystem_PrevAndNext(
440                    long companyId, boolean system,
441                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
442                    throws com.liferay.portal.NoSuchCompanyException,
443                            com.liferay.portal.kernel.exception.SystemException {
444                    return getPersistence()
445                                       .findBySystem_PrevAndNext(companyId, system,
446                            orderByComparator);
447            }
448    
449            /**
450            * Removes all the companies where system = &#63; from the database.
451            *
452            * @param system the system
453            * @throws SystemException if a system exception occurred
454            */
455            public static void removeBySystem(boolean system)
456                    throws com.liferay.portal.kernel.exception.SystemException {
457                    getPersistence().removeBySystem(system);
458            }
459    
460            /**
461            * Returns the number of companies where system = &#63;.
462            *
463            * @param system the system
464            * @return the number of matching companies
465            * @throws SystemException if a system exception occurred
466            */
467            public static int countBySystem(boolean system)
468                    throws com.liferay.portal.kernel.exception.SystemException {
469                    return getPersistence().countBySystem(system);
470            }
471    
472            /**
473            * Caches the company in the entity cache if it is enabled.
474            *
475            * @param company the company
476            */
477            public static void cacheResult(com.liferay.portal.model.Company company) {
478                    getPersistence().cacheResult(company);
479            }
480    
481            /**
482            * Caches the companies in the entity cache if it is enabled.
483            *
484            * @param companies the companies
485            */
486            public static void cacheResult(
487                    java.util.List<com.liferay.portal.model.Company> companies) {
488                    getPersistence().cacheResult(companies);
489            }
490    
491            /**
492            * Creates a new company with the primary key. Does not add the company to the database.
493            *
494            * @param companyId the primary key for the new company
495            * @return the new company
496            */
497            public static com.liferay.portal.model.Company create(long companyId) {
498                    return getPersistence().create(companyId);
499            }
500    
501            /**
502            * Removes the company with the primary key from the database. Also notifies the appropriate model listeners.
503            *
504            * @param companyId the primary key of the company
505            * @return the company that was removed
506            * @throws com.liferay.portal.NoSuchCompanyException if a company with the primary key could not be found
507            * @throws SystemException if a system exception occurred
508            */
509            public static com.liferay.portal.model.Company remove(long companyId)
510                    throws com.liferay.portal.NoSuchCompanyException,
511                            com.liferay.portal.kernel.exception.SystemException {
512                    return getPersistence().remove(companyId);
513            }
514    
515            public static com.liferay.portal.model.Company updateImpl(
516                    com.liferay.portal.model.Company company)
517                    throws com.liferay.portal.kernel.exception.SystemException {
518                    return getPersistence().updateImpl(company);
519            }
520    
521            /**
522            * Returns the company with the primary key or throws a {@link com.liferay.portal.NoSuchCompanyException} if it could not be found.
523            *
524            * @param companyId the primary key of the company
525            * @return the company
526            * @throws com.liferay.portal.NoSuchCompanyException if a company with the primary key could not be found
527            * @throws SystemException if a system exception occurred
528            */
529            public static com.liferay.portal.model.Company findByPrimaryKey(
530                    long companyId)
531                    throws com.liferay.portal.NoSuchCompanyException,
532                            com.liferay.portal.kernel.exception.SystemException {
533                    return getPersistence().findByPrimaryKey(companyId);
534            }
535    
536            /**
537            * Returns the company with the primary key or returns <code>null</code> if it could not be found.
538            *
539            * @param companyId the primary key of the company
540            * @return the company, or <code>null</code> if a company with the primary key could not be found
541            * @throws SystemException if a system exception occurred
542            */
543            public static com.liferay.portal.model.Company fetchByPrimaryKey(
544                    long companyId)
545                    throws com.liferay.portal.kernel.exception.SystemException {
546                    return getPersistence().fetchByPrimaryKey(companyId);
547            }
548    
549            /**
550            * Returns all the companies.
551            *
552            * @return the companies
553            * @throws SystemException if a system exception occurred
554            */
555            public static java.util.List<com.liferay.portal.model.Company> findAll()
556                    throws com.liferay.portal.kernel.exception.SystemException {
557                    return getPersistence().findAll();
558            }
559    
560            /**
561            * Returns a range of all the companies.
562            *
563            * <p>
564            * 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.
565            * </p>
566            *
567            * @param start the lower bound of the range of companies
568            * @param end the upper bound of the range of companies (not inclusive)
569            * @return the range of companies
570            * @throws SystemException if a system exception occurred
571            */
572            public static java.util.List<com.liferay.portal.model.Company> findAll(
573                    int start, int end)
574                    throws com.liferay.portal.kernel.exception.SystemException {
575                    return getPersistence().findAll(start, end);
576            }
577    
578            /**
579            * Returns an ordered range of all the companies.
580            *
581            * <p>
582            * 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.
583            * </p>
584            *
585            * @param start the lower bound of the range of companies
586            * @param end the upper bound of the range of companies (not inclusive)
587            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
588            * @return the ordered range of companies
589            * @throws SystemException if a system exception occurred
590            */
591            public static java.util.List<com.liferay.portal.model.Company> findAll(
592                    int start, int end,
593                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
594                    throws com.liferay.portal.kernel.exception.SystemException {
595                    return getPersistence().findAll(start, end, orderByComparator);
596            }
597    
598            /**
599            * Removes all the companies from the database.
600            *
601            * @throws SystemException if a system exception occurred
602            */
603            public static void removeAll()
604                    throws com.liferay.portal.kernel.exception.SystemException {
605                    getPersistence().removeAll();
606            }
607    
608            /**
609            * Returns the number of companies.
610            *
611            * @return the number of companies
612            * @throws SystemException if a system exception occurred
613            */
614            public static int countAll()
615                    throws com.liferay.portal.kernel.exception.SystemException {
616                    return getPersistence().countAll();
617            }
618    
619            public static CompanyPersistence getPersistence() {
620                    if (_persistence == null) {
621                            _persistence = (CompanyPersistence)PortalBeanLocatorUtil.locate(CompanyPersistence.class.getName());
622    
623                            ReferenceRegistry.registerReference(CompanyUtil.class,
624                                    "_persistence");
625                    }
626    
627                    return _persistence;
628            }
629    
630            /**
631             * @deprecated As of 6.2.0
632             */
633            public void setPersistence(CompanyPersistence persistence) {
634            }
635    
636            private static CompanyPersistence _persistence;
637    }