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