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.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.OrgLabor;
023    import com.liferay.portal.service.ServiceContext;
024    
025    import java.util.List;
026    
027    /**
028     * The persistence utility for the org labor service. This utility wraps {@link OrgLaborPersistenceImpl} 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 OrgLaborPersistence
036     * @see OrgLaborPersistenceImpl
037     * @generated
038     */
039    public class OrgLaborUtil {
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(OrgLabor orgLabor) {
057                    getPersistence().clearCache(orgLabor);
058            }
059    
060            /**
061             * @see com.liferay.portal.service.persistence.BasePersistence#countWithDynamicQuery(DynamicQuery)
062             */
063            public 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<OrgLabor> 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<OrgLabor> 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<OrgLabor> 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 OrgLabor update(OrgLabor orgLabor) throws SystemException {
100                    return getPersistence().update(orgLabor);
101            }
102    
103            /**
104             * @see com.liferay.portal.service.persistence.BasePersistence#update(com.liferay.portal.model.BaseModel, ServiceContext)
105             */
106            public static OrgLabor update(OrgLabor orgLabor,
107                    ServiceContext serviceContext) throws SystemException {
108                    return getPersistence().update(orgLabor, serviceContext);
109            }
110    
111            /**
112            * Returns all the org labors where organizationId = &#63;.
113            *
114            * @param organizationId the organization ID
115            * @return the matching org labors
116            * @throws SystemException if a system exception occurred
117            */
118            public static java.util.List<com.liferay.portal.model.OrgLabor> findByOrganizationId(
119                    long organizationId)
120                    throws com.liferay.portal.kernel.exception.SystemException {
121                    return getPersistence().findByOrganizationId(organizationId);
122            }
123    
124            /**
125            * Returns a range of all the org labors where organizationId = &#63;.
126            *
127            * <p>
128            * 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.OrgLaborModelImpl}. 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.
129            * </p>
130            *
131            * @param organizationId the organization ID
132            * @param start the lower bound of the range of org labors
133            * @param end the upper bound of the range of org labors (not inclusive)
134            * @return the range of matching org labors
135            * @throws SystemException if a system exception occurred
136            */
137            public static java.util.List<com.liferay.portal.model.OrgLabor> findByOrganizationId(
138                    long organizationId, int start, int end)
139                    throws com.liferay.portal.kernel.exception.SystemException {
140                    return getPersistence().findByOrganizationId(organizationId, start, end);
141            }
142    
143            /**
144            * Returns an ordered range of all the org labors where organizationId = &#63;.
145            *
146            * <p>
147            * 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.OrgLaborModelImpl}. 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.
148            * </p>
149            *
150            * @param organizationId the organization ID
151            * @param start the lower bound of the range of org labors
152            * @param end the upper bound of the range of org labors (not inclusive)
153            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
154            * @return the ordered range of matching org labors
155            * @throws SystemException if a system exception occurred
156            */
157            public static java.util.List<com.liferay.portal.model.OrgLabor> findByOrganizationId(
158                    long organizationId, int start, int end,
159                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
160                    throws com.liferay.portal.kernel.exception.SystemException {
161                    return getPersistence()
162                                       .findByOrganizationId(organizationId, start, end,
163                            orderByComparator);
164            }
165    
166            /**
167            * Returns the first org labor in the ordered set where organizationId = &#63;.
168            *
169            * @param organizationId the organization ID
170            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
171            * @return the first matching org labor
172            * @throws com.liferay.portal.NoSuchOrgLaborException if a matching org labor could not be found
173            * @throws SystemException if a system exception occurred
174            */
175            public static com.liferay.portal.model.OrgLabor findByOrganizationId_First(
176                    long organizationId,
177                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
178                    throws com.liferay.portal.NoSuchOrgLaborException,
179                            com.liferay.portal.kernel.exception.SystemException {
180                    return getPersistence()
181                                       .findByOrganizationId_First(organizationId, orderByComparator);
182            }
183    
184            /**
185            * Returns the first org labor in the ordered set where organizationId = &#63;.
186            *
187            * @param organizationId the organization ID
188            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
189            * @return the first matching org labor, or <code>null</code> if a matching org labor could not be found
190            * @throws SystemException if a system exception occurred
191            */
192            public static com.liferay.portal.model.OrgLabor fetchByOrganizationId_First(
193                    long organizationId,
194                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
195                    throws com.liferay.portal.kernel.exception.SystemException {
196                    return getPersistence()
197                                       .fetchByOrganizationId_First(organizationId,
198                            orderByComparator);
199            }
200    
201            /**
202            * Returns the last org labor in the ordered set where organizationId = &#63;.
203            *
204            * @param organizationId the organization ID
205            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
206            * @return the last matching org labor
207            * @throws com.liferay.portal.NoSuchOrgLaborException if a matching org labor could not be found
208            * @throws SystemException if a system exception occurred
209            */
210            public static com.liferay.portal.model.OrgLabor findByOrganizationId_Last(
211                    long organizationId,
212                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
213                    throws com.liferay.portal.NoSuchOrgLaborException,
214                            com.liferay.portal.kernel.exception.SystemException {
215                    return getPersistence()
216                                       .findByOrganizationId_Last(organizationId, orderByComparator);
217            }
218    
219            /**
220            * Returns the last org labor in the ordered set where organizationId = &#63;.
221            *
222            * @param organizationId the organization ID
223            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
224            * @return the last matching org labor, or <code>null</code> if a matching org labor could not be found
225            * @throws SystemException if a system exception occurred
226            */
227            public static com.liferay.portal.model.OrgLabor fetchByOrganizationId_Last(
228                    long organizationId,
229                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
230                    throws com.liferay.portal.kernel.exception.SystemException {
231                    return getPersistence()
232                                       .fetchByOrganizationId_Last(organizationId, orderByComparator);
233            }
234    
235            /**
236            * Returns the org labors before and after the current org labor in the ordered set where organizationId = &#63;.
237            *
238            * @param orgLaborId the primary key of the current org labor
239            * @param organizationId the organization ID
240            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
241            * @return the previous, current, and next org labor
242            * @throws com.liferay.portal.NoSuchOrgLaborException if a org labor with the primary key could not be found
243            * @throws SystemException if a system exception occurred
244            */
245            public static com.liferay.portal.model.OrgLabor[] findByOrganizationId_PrevAndNext(
246                    long orgLaborId, long organizationId,
247                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
248                    throws com.liferay.portal.NoSuchOrgLaborException,
249                            com.liferay.portal.kernel.exception.SystemException {
250                    return getPersistence()
251                                       .findByOrganizationId_PrevAndNext(orgLaborId,
252                            organizationId, orderByComparator);
253            }
254    
255            /**
256            * Removes all the org labors where organizationId = &#63; from the database.
257            *
258            * @param organizationId the organization ID
259            * @throws SystemException if a system exception occurred
260            */
261            public static void removeByOrganizationId(long organizationId)
262                    throws com.liferay.portal.kernel.exception.SystemException {
263                    getPersistence().removeByOrganizationId(organizationId);
264            }
265    
266            /**
267            * Returns the number of org labors where organizationId = &#63;.
268            *
269            * @param organizationId the organization ID
270            * @return the number of matching org labors
271            * @throws SystemException if a system exception occurred
272            */
273            public static int countByOrganizationId(long organizationId)
274                    throws com.liferay.portal.kernel.exception.SystemException {
275                    return getPersistence().countByOrganizationId(organizationId);
276            }
277    
278            /**
279            * Caches the org labor in the entity cache if it is enabled.
280            *
281            * @param orgLabor the org labor
282            */
283            public static void cacheResult(com.liferay.portal.model.OrgLabor orgLabor) {
284                    getPersistence().cacheResult(orgLabor);
285            }
286    
287            /**
288            * Caches the org labors in the entity cache if it is enabled.
289            *
290            * @param orgLabors the org labors
291            */
292            public static void cacheResult(
293                    java.util.List<com.liferay.portal.model.OrgLabor> orgLabors) {
294                    getPersistence().cacheResult(orgLabors);
295            }
296    
297            /**
298            * Creates a new org labor with the primary key. Does not add the org labor to the database.
299            *
300            * @param orgLaborId the primary key for the new org labor
301            * @return the new org labor
302            */
303            public static com.liferay.portal.model.OrgLabor create(long orgLaborId) {
304                    return getPersistence().create(orgLaborId);
305            }
306    
307            /**
308            * Removes the org labor with the primary key from the database. Also notifies the appropriate model listeners.
309            *
310            * @param orgLaborId the primary key of the org labor
311            * @return the org labor that was removed
312            * @throws com.liferay.portal.NoSuchOrgLaborException if a org labor with the primary key could not be found
313            * @throws SystemException if a system exception occurred
314            */
315            public static com.liferay.portal.model.OrgLabor remove(long orgLaborId)
316                    throws com.liferay.portal.NoSuchOrgLaborException,
317                            com.liferay.portal.kernel.exception.SystemException {
318                    return getPersistence().remove(orgLaborId);
319            }
320    
321            public static com.liferay.portal.model.OrgLabor updateImpl(
322                    com.liferay.portal.model.OrgLabor orgLabor)
323                    throws com.liferay.portal.kernel.exception.SystemException {
324                    return getPersistence().updateImpl(orgLabor);
325            }
326    
327            /**
328            * Returns the org labor with the primary key or throws a {@link com.liferay.portal.NoSuchOrgLaborException} if it could not be found.
329            *
330            * @param orgLaborId the primary key of the org labor
331            * @return the org labor
332            * @throws com.liferay.portal.NoSuchOrgLaborException if a org labor with the primary key could not be found
333            * @throws SystemException if a system exception occurred
334            */
335            public static com.liferay.portal.model.OrgLabor findByPrimaryKey(
336                    long orgLaborId)
337                    throws com.liferay.portal.NoSuchOrgLaborException,
338                            com.liferay.portal.kernel.exception.SystemException {
339                    return getPersistence().findByPrimaryKey(orgLaborId);
340            }
341    
342            /**
343            * Returns the org labor with the primary key or returns <code>null</code> if it could not be found.
344            *
345            * @param orgLaborId the primary key of the org labor
346            * @return the org labor, or <code>null</code> if a org labor with the primary key could not be found
347            * @throws SystemException if a system exception occurred
348            */
349            public static com.liferay.portal.model.OrgLabor fetchByPrimaryKey(
350                    long orgLaborId)
351                    throws com.liferay.portal.kernel.exception.SystemException {
352                    return getPersistence().fetchByPrimaryKey(orgLaborId);
353            }
354    
355            /**
356            * Returns all the org labors.
357            *
358            * @return the org labors
359            * @throws SystemException if a system exception occurred
360            */
361            public static java.util.List<com.liferay.portal.model.OrgLabor> findAll()
362                    throws com.liferay.portal.kernel.exception.SystemException {
363                    return getPersistence().findAll();
364            }
365    
366            /**
367            * Returns a range of all the org labors.
368            *
369            * <p>
370            * 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.OrgLaborModelImpl}. 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.
371            * </p>
372            *
373            * @param start the lower bound of the range of org labors
374            * @param end the upper bound of the range of org labors (not inclusive)
375            * @return the range of org labors
376            * @throws SystemException if a system exception occurred
377            */
378            public static java.util.List<com.liferay.portal.model.OrgLabor> findAll(
379                    int start, int end)
380                    throws com.liferay.portal.kernel.exception.SystemException {
381                    return getPersistence().findAll(start, end);
382            }
383    
384            /**
385            * Returns an ordered range of all the org labors.
386            *
387            * <p>
388            * 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.OrgLaborModelImpl}. 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.
389            * </p>
390            *
391            * @param start the lower bound of the range of org labors
392            * @param end the upper bound of the range of org labors (not inclusive)
393            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
394            * @return the ordered range of org labors
395            * @throws SystemException if a system exception occurred
396            */
397            public static java.util.List<com.liferay.portal.model.OrgLabor> findAll(
398                    int start, int end,
399                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
400                    throws com.liferay.portal.kernel.exception.SystemException {
401                    return getPersistence().findAll(start, end, orderByComparator);
402            }
403    
404            /**
405            * Removes all the org labors from the database.
406            *
407            * @throws SystemException if a system exception occurred
408            */
409            public static void removeAll()
410                    throws com.liferay.portal.kernel.exception.SystemException {
411                    getPersistence().removeAll();
412            }
413    
414            /**
415            * Returns the number of org labors.
416            *
417            * @return the number of org labors
418            * @throws SystemException if a system exception occurred
419            */
420            public static int countAll()
421                    throws com.liferay.portal.kernel.exception.SystemException {
422                    return getPersistence().countAll();
423            }
424    
425            public static OrgLaborPersistence getPersistence() {
426                    if (_persistence == null) {
427                            _persistence = (OrgLaborPersistence)PortalBeanLocatorUtil.locate(OrgLaborPersistence.class.getName());
428    
429                            ReferenceRegistry.registerReference(OrgLaborUtil.class,
430                                    "_persistence");
431                    }
432    
433                    return _persistence;
434            }
435    
436            /**
437             * @deprecated
438             */
439            public void setPersistence(OrgLaborPersistence persistence) {
440            }
441    
442            private static OrgLaborPersistence _persistence;
443    }