001    /**
002     * Copyright (c) 2000-2011 Liferay, Inc. All rights reserved.
003     *
004     * The contents of this file are subject to the terms of the Liferay Enterprise
005     * Subscription License ("License"). You may not use this file except in
006     * compliance with the License. You can obtain a copy of the License by
007     * contacting Liferay, Inc. See the License for the specific language governing
008     * permissions and limitations under the License, including but not limited to
009     * distribution rights of the Software.
010     *
011     *
012     *
013     */
014    
015    package com.liferay.portal.service.persistence;
016    
017    import com.liferay.portal.NoSuchModelException;
018    import com.liferay.portal.NoSuchOrgLaborException;
019    import com.liferay.portal.kernel.bean.BeanReference;
020    import com.liferay.portal.kernel.cache.CacheRegistryUtil;
021    import com.liferay.portal.kernel.dao.orm.EntityCacheUtil;
022    import com.liferay.portal.kernel.dao.orm.FinderCacheUtil;
023    import com.liferay.portal.kernel.dao.orm.FinderPath;
024    import com.liferay.portal.kernel.dao.orm.Query;
025    import com.liferay.portal.kernel.dao.orm.QueryPos;
026    import com.liferay.portal.kernel.dao.orm.QueryUtil;
027    import com.liferay.portal.kernel.dao.orm.Session;
028    import com.liferay.portal.kernel.exception.SystemException;
029    import com.liferay.portal.kernel.log.Log;
030    import com.liferay.portal.kernel.log.LogFactoryUtil;
031    import com.liferay.portal.kernel.util.GetterUtil;
032    import com.liferay.portal.kernel.util.InstanceFactory;
033    import com.liferay.portal.kernel.util.OrderByComparator;
034    import com.liferay.portal.kernel.util.StringBundler;
035    import com.liferay.portal.kernel.util.StringPool;
036    import com.liferay.portal.kernel.util.StringUtil;
037    import com.liferay.portal.model.CacheModel;
038    import com.liferay.portal.model.ModelListener;
039    import com.liferay.portal.model.OrgLabor;
040    import com.liferay.portal.model.impl.OrgLaborImpl;
041    import com.liferay.portal.model.impl.OrgLaborModelImpl;
042    import com.liferay.portal.service.persistence.impl.BasePersistenceImpl;
043    
044    import java.io.Serializable;
045    
046    import java.util.ArrayList;
047    import java.util.Collections;
048    import java.util.List;
049    
050    /**
051     * The persistence implementation for the org labor service.
052     *
053     * <p>
054     * Caching information and settings can be found in <code>portal.properties</code>
055     * </p>
056     *
057     * @author Brian Wing Shun Chan
058     * @see OrgLaborPersistence
059     * @see OrgLaborUtil
060     * @generated
061     */
062    public class OrgLaborPersistenceImpl extends BasePersistenceImpl<OrgLabor>
063            implements OrgLaborPersistence {
064            /*
065             * NOTE FOR DEVELOPERS:
066             *
067             * Never modify or reference this class directly. Always use {@link OrgLaborUtil} to access the org labor persistence. Modify <code>service.xml</code> and rerun ServiceBuilder to regenerate this class.
068             */
069            public static final String FINDER_CLASS_NAME_ENTITY = OrgLaborImpl.class.getName();
070            public static final String FINDER_CLASS_NAME_LIST_WITH_PAGINATION = FINDER_CLASS_NAME_ENTITY +
071                    ".List1";
072            public static final String FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION = FINDER_CLASS_NAME_ENTITY +
073                    ".List2";
074            public static final FinderPath FINDER_PATH_WITH_PAGINATION_FIND_BY_ORGANIZATIONID =
075                    new FinderPath(OrgLaborModelImpl.ENTITY_CACHE_ENABLED,
076                            OrgLaborModelImpl.FINDER_CACHE_ENABLED, OrgLaborImpl.class,
077                            FINDER_CLASS_NAME_LIST_WITH_PAGINATION, "findByOrganizationId",
078                            new String[] {
079                                    Long.class.getName(),
080                                    
081                            "java.lang.Integer", "java.lang.Integer",
082                                    "com.liferay.portal.kernel.util.OrderByComparator"
083                            });
084            public static final FinderPath FINDER_PATH_WITHOUT_PAGINATION_FIND_BY_ORGANIZATIONID =
085                    new FinderPath(OrgLaborModelImpl.ENTITY_CACHE_ENABLED,
086                            OrgLaborModelImpl.FINDER_CACHE_ENABLED, OrgLaborImpl.class,
087                            FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION, "findByOrganizationId",
088                            new String[] { Long.class.getName() },
089                            OrgLaborModelImpl.ORGANIZATIONID_COLUMN_BITMASK);
090            public static final FinderPath FINDER_PATH_COUNT_BY_ORGANIZATIONID = new FinderPath(OrgLaborModelImpl.ENTITY_CACHE_ENABLED,
091                            OrgLaborModelImpl.FINDER_CACHE_ENABLED, Long.class,
092                            FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION, "countByOrganizationId",
093                            new String[] { Long.class.getName() });
094            public static final FinderPath FINDER_PATH_WITH_PAGINATION_FIND_ALL = new FinderPath(OrgLaborModelImpl.ENTITY_CACHE_ENABLED,
095                            OrgLaborModelImpl.FINDER_CACHE_ENABLED, OrgLaborImpl.class,
096                            FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION, "findAll", new String[0]);
097            public static final FinderPath FINDER_PATH_WITHOUT_PAGINATION_FIND_ALL = new FinderPath(OrgLaborModelImpl.ENTITY_CACHE_ENABLED,
098                            OrgLaborModelImpl.FINDER_CACHE_ENABLED, OrgLaborImpl.class,
099                            FINDER_CLASS_NAME_LIST_WITH_PAGINATION, "findAll", new String[0]);
100            public static final FinderPath FINDER_PATH_COUNT_ALL = new FinderPath(OrgLaborModelImpl.ENTITY_CACHE_ENABLED,
101                            OrgLaborModelImpl.FINDER_CACHE_ENABLED, Long.class,
102                            FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION, "countAll", new String[0]);
103    
104            /**
105             * Caches the org labor in the entity cache if it is enabled.
106             *
107             * @param orgLabor the org labor
108             */
109            public void cacheResult(OrgLabor orgLabor) {
110                    EntityCacheUtil.putResult(OrgLaborModelImpl.ENTITY_CACHE_ENABLED,
111                            OrgLaborImpl.class, orgLabor.getPrimaryKey(), orgLabor);
112    
113                    orgLabor.resetOriginalValues();
114            }
115    
116            /**
117             * Caches the org labors in the entity cache if it is enabled.
118             *
119             * @param orgLabors the org labors
120             */
121            public void cacheResult(List<OrgLabor> orgLabors) {
122                    for (OrgLabor orgLabor : orgLabors) {
123                            if (EntityCacheUtil.getResult(
124                                                    OrgLaborModelImpl.ENTITY_CACHE_ENABLED,
125                                                    OrgLaborImpl.class, orgLabor.getPrimaryKey()) == null) {
126                                    cacheResult(orgLabor);
127                            }
128                            else {
129                                    orgLabor.resetOriginalValues();
130                            }
131                    }
132            }
133    
134            /**
135             * Clears the cache for all org labors.
136             *
137             * <p>
138             * The {@link com.liferay.portal.kernel.dao.orm.EntityCache} and {@link com.liferay.portal.kernel.dao.orm.FinderCache} are both cleared by this method.
139             * </p>
140             */
141            @Override
142            public void clearCache() {
143                    if (_HIBERNATE_CACHE_USE_SECOND_LEVEL_CACHE) {
144                            CacheRegistryUtil.clear(OrgLaborImpl.class.getName());
145                    }
146    
147                    EntityCacheUtil.clearCache(OrgLaborImpl.class.getName());
148    
149                    FinderCacheUtil.clearCache(FINDER_CLASS_NAME_ENTITY);
150                    FinderCacheUtil.clearCache(FINDER_CLASS_NAME_LIST_WITH_PAGINATION);
151                    FinderCacheUtil.clearCache(FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION);
152            }
153    
154            /**
155             * Clears the cache for the org labor.
156             *
157             * <p>
158             * The {@link com.liferay.portal.kernel.dao.orm.EntityCache} and {@link com.liferay.portal.kernel.dao.orm.FinderCache} are both cleared by this method.
159             * </p>
160             */
161            @Override
162            public void clearCache(OrgLabor orgLabor) {
163                    EntityCacheUtil.removeResult(OrgLaborModelImpl.ENTITY_CACHE_ENABLED,
164                            OrgLaborImpl.class, orgLabor.getPrimaryKey());
165    
166                    FinderCacheUtil.clearCache(FINDER_CLASS_NAME_LIST_WITH_PAGINATION);
167                    FinderCacheUtil.clearCache(FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION);
168            }
169    
170            /**
171             * Creates a new org labor with the primary key. Does not add the org labor to the database.
172             *
173             * @param orgLaborId the primary key for the new org labor
174             * @return the new org labor
175             */
176            public OrgLabor create(long orgLaborId) {
177                    OrgLabor orgLabor = new OrgLaborImpl();
178    
179                    orgLabor.setNew(true);
180                    orgLabor.setPrimaryKey(orgLaborId);
181    
182                    return orgLabor;
183            }
184    
185            /**
186             * Removes the org labor with the primary key from the database. Also notifies the appropriate model listeners.
187             *
188             * @param primaryKey the primary key of the org labor
189             * @return the org labor that was removed
190             * @throws com.liferay.portal.NoSuchModelException if a org labor with the primary key could not be found
191             * @throws SystemException if a system exception occurred
192             */
193            @Override
194            public OrgLabor remove(Serializable primaryKey)
195                    throws NoSuchModelException, SystemException {
196                    return remove(((Long)primaryKey).longValue());
197            }
198    
199            /**
200             * Removes the org labor with the primary key from the database. Also notifies the appropriate model listeners.
201             *
202             * @param orgLaborId the primary key of the org labor
203             * @return the org labor that was removed
204             * @throws com.liferay.portal.NoSuchOrgLaborException if a org labor with the primary key could not be found
205             * @throws SystemException if a system exception occurred
206             */
207            public OrgLabor remove(long orgLaborId)
208                    throws NoSuchOrgLaborException, SystemException {
209                    Session session = null;
210    
211                    try {
212                            session = openSession();
213    
214                            OrgLabor orgLabor = (OrgLabor)session.get(OrgLaborImpl.class,
215                                            Long.valueOf(orgLaborId));
216    
217                            if (orgLabor == null) {
218                                    if (_log.isWarnEnabled()) {
219                                            _log.warn(_NO_SUCH_ENTITY_WITH_PRIMARY_KEY + orgLaborId);
220                                    }
221    
222                                    throw new NoSuchOrgLaborException(_NO_SUCH_ENTITY_WITH_PRIMARY_KEY +
223                                            orgLaborId);
224                            }
225    
226                            return orgLaborPersistence.remove(orgLabor);
227                    }
228                    catch (NoSuchOrgLaborException nsee) {
229                            throw nsee;
230                    }
231                    catch (Exception e) {
232                            throw processException(e);
233                    }
234                    finally {
235                            closeSession(session);
236                    }
237            }
238    
239            /**
240             * Removes the org labor from the database. Also notifies the appropriate model listeners.
241             *
242             * @param orgLabor the org labor
243             * @return the org labor that was removed
244             * @throws SystemException if a system exception occurred
245             */
246            @Override
247            public OrgLabor remove(OrgLabor orgLabor) throws SystemException {
248                    return super.remove(orgLabor);
249            }
250    
251            @Override
252            protected OrgLabor removeImpl(OrgLabor orgLabor) throws SystemException {
253                    orgLabor = toUnwrappedModel(orgLabor);
254    
255                    Session session = null;
256    
257                    try {
258                            session = openSession();
259    
260                            BatchSessionUtil.delete(session, orgLabor);
261                    }
262                    catch (Exception e) {
263                            throw processException(e);
264                    }
265                    finally {
266                            closeSession(session);
267                    }
268    
269                    FinderCacheUtil.clearCache(FINDER_CLASS_NAME_LIST_WITH_PAGINATION);
270                    FinderCacheUtil.clearCache(FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION);
271    
272                    EntityCacheUtil.removeResult(OrgLaborModelImpl.ENTITY_CACHE_ENABLED,
273                            OrgLaborImpl.class, orgLabor.getPrimaryKey());
274    
275                    return orgLabor;
276            }
277    
278            @Override
279            public OrgLabor updateImpl(com.liferay.portal.model.OrgLabor orgLabor,
280                    boolean merge) throws SystemException {
281                    orgLabor = toUnwrappedModel(orgLabor);
282    
283                    boolean isNew = orgLabor.isNew();
284    
285                    OrgLaborModelImpl orgLaborModelImpl = (OrgLaborModelImpl)orgLabor;
286    
287                    Session session = null;
288    
289                    try {
290                            session = openSession();
291    
292                            BatchSessionUtil.update(session, orgLabor, merge);
293    
294                            orgLabor.setNew(false);
295                    }
296                    catch (Exception e) {
297                            throw processException(e);
298                    }
299                    finally {
300                            closeSession(session);
301                    }
302    
303                    FinderCacheUtil.clearCache(FINDER_CLASS_NAME_LIST_WITH_PAGINATION);
304    
305                    if (isNew || !OrgLaborModelImpl.COLUMN_BITMASK_ENABLED) {
306                            FinderCacheUtil.clearCache(FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION);
307                    }
308    
309                    else {
310                            if ((orgLaborModelImpl.getColumnBitmask() &
311                                            FINDER_PATH_WITHOUT_PAGINATION_FIND_BY_ORGANIZATIONID.getColumnBitmask()) != 0) {
312                                    Object[] args = new Object[] {
313                                                    Long.valueOf(orgLaborModelImpl.getOriginalOrganizationId())
314                                            };
315    
316                                    FinderCacheUtil.removeResult(FINDER_PATH_COUNT_BY_ORGANIZATIONID,
317                                            args);
318                                    FinderCacheUtil.removeResult(FINDER_PATH_WITHOUT_PAGINATION_FIND_BY_ORGANIZATIONID,
319                                            args);
320    
321                                    args = new Object[] {
322                                                    Long.valueOf(orgLaborModelImpl.getOrganizationId())
323                                            };
324    
325                                    FinderCacheUtil.removeResult(FINDER_PATH_COUNT_BY_ORGANIZATIONID,
326                                            args);
327                                    FinderCacheUtil.removeResult(FINDER_PATH_WITHOUT_PAGINATION_FIND_BY_ORGANIZATIONID,
328                                            args);
329                            }
330                    }
331    
332                    EntityCacheUtil.putResult(OrgLaborModelImpl.ENTITY_CACHE_ENABLED,
333                            OrgLaborImpl.class, orgLabor.getPrimaryKey(), orgLabor);
334    
335                    return orgLabor;
336            }
337    
338            protected OrgLabor toUnwrappedModel(OrgLabor orgLabor) {
339                    if (orgLabor instanceof OrgLaborImpl) {
340                            return orgLabor;
341                    }
342    
343                    OrgLaborImpl orgLaborImpl = new OrgLaborImpl();
344    
345                    orgLaborImpl.setNew(orgLabor.isNew());
346                    orgLaborImpl.setPrimaryKey(orgLabor.getPrimaryKey());
347    
348                    orgLaborImpl.setOrgLaborId(orgLabor.getOrgLaborId());
349                    orgLaborImpl.setOrganizationId(orgLabor.getOrganizationId());
350                    orgLaborImpl.setTypeId(orgLabor.getTypeId());
351                    orgLaborImpl.setSunOpen(orgLabor.getSunOpen());
352                    orgLaborImpl.setSunClose(orgLabor.getSunClose());
353                    orgLaborImpl.setMonOpen(orgLabor.getMonOpen());
354                    orgLaborImpl.setMonClose(orgLabor.getMonClose());
355                    orgLaborImpl.setTueOpen(orgLabor.getTueOpen());
356                    orgLaborImpl.setTueClose(orgLabor.getTueClose());
357                    orgLaborImpl.setWedOpen(orgLabor.getWedOpen());
358                    orgLaborImpl.setWedClose(orgLabor.getWedClose());
359                    orgLaborImpl.setThuOpen(orgLabor.getThuOpen());
360                    orgLaborImpl.setThuClose(orgLabor.getThuClose());
361                    orgLaborImpl.setFriOpen(orgLabor.getFriOpen());
362                    orgLaborImpl.setFriClose(orgLabor.getFriClose());
363                    orgLaborImpl.setSatOpen(orgLabor.getSatOpen());
364                    orgLaborImpl.setSatClose(orgLabor.getSatClose());
365    
366                    return orgLaborImpl;
367            }
368    
369            /**
370             * Returns the org labor with the primary key or throws a {@link com.liferay.portal.NoSuchModelException} if it could not be found.
371             *
372             * @param primaryKey the primary key of the org labor
373             * @return the org labor
374             * @throws com.liferay.portal.NoSuchModelException if a org labor with the primary key could not be found
375             * @throws SystemException if a system exception occurred
376             */
377            @Override
378            public OrgLabor findByPrimaryKey(Serializable primaryKey)
379                    throws NoSuchModelException, SystemException {
380                    return findByPrimaryKey(((Long)primaryKey).longValue());
381            }
382    
383            /**
384             * Returns the org labor with the primary key or throws a {@link com.liferay.portal.NoSuchOrgLaborException} if it could not be found.
385             *
386             * @param orgLaborId the primary key of the org labor
387             * @return the org labor
388             * @throws com.liferay.portal.NoSuchOrgLaborException if a org labor with the primary key could not be found
389             * @throws SystemException if a system exception occurred
390             */
391            public OrgLabor findByPrimaryKey(long orgLaborId)
392                    throws NoSuchOrgLaborException, SystemException {
393                    OrgLabor orgLabor = fetchByPrimaryKey(orgLaborId);
394    
395                    if (orgLabor == null) {
396                            if (_log.isWarnEnabled()) {
397                                    _log.warn(_NO_SUCH_ENTITY_WITH_PRIMARY_KEY + orgLaborId);
398                            }
399    
400                            throw new NoSuchOrgLaborException(_NO_SUCH_ENTITY_WITH_PRIMARY_KEY +
401                                    orgLaborId);
402                    }
403    
404                    return orgLabor;
405            }
406    
407            /**
408             * Returns the org labor with the primary key or returns <code>null</code> if it could not be found.
409             *
410             * @param primaryKey the primary key of the org labor
411             * @return the org labor, or <code>null</code> if a org labor with the primary key could not be found
412             * @throws SystemException if a system exception occurred
413             */
414            @Override
415            public OrgLabor fetchByPrimaryKey(Serializable primaryKey)
416                    throws SystemException {
417                    return fetchByPrimaryKey(((Long)primaryKey).longValue());
418            }
419    
420            /**
421             * Returns the org labor with the primary key or returns <code>null</code> if it could not be found.
422             *
423             * @param orgLaborId the primary key of the org labor
424             * @return the org labor, or <code>null</code> if a org labor with the primary key could not be found
425             * @throws SystemException if a system exception occurred
426             */
427            public OrgLabor fetchByPrimaryKey(long orgLaborId)
428                    throws SystemException {
429                    OrgLabor orgLabor = (OrgLabor)EntityCacheUtil.getResult(OrgLaborModelImpl.ENTITY_CACHE_ENABLED,
430                                    OrgLaborImpl.class, orgLaborId);
431    
432                    if (orgLabor == _nullOrgLabor) {
433                            return null;
434                    }
435    
436                    if (orgLabor == null) {
437                            Session session = null;
438    
439                            boolean hasException = false;
440    
441                            try {
442                                    session = openSession();
443    
444                                    orgLabor = (OrgLabor)session.get(OrgLaborImpl.class,
445                                                    Long.valueOf(orgLaborId));
446                            }
447                            catch (Exception e) {
448                                    hasException = true;
449    
450                                    throw processException(e);
451                            }
452                            finally {
453                                    if (orgLabor != null) {
454                                            cacheResult(orgLabor);
455                                    }
456                                    else if (!hasException) {
457                                            EntityCacheUtil.putResult(OrgLaborModelImpl.ENTITY_CACHE_ENABLED,
458                                                    OrgLaborImpl.class, orgLaborId, _nullOrgLabor);
459                                    }
460    
461                                    closeSession(session);
462                            }
463                    }
464    
465                    return orgLabor;
466            }
467    
468            /**
469             * Returns all the org labors where organizationId = &#63;.
470             *
471             * @param organizationId the organization ID
472             * @return the matching org labors
473             * @throws SystemException if a system exception occurred
474             */
475            public List<OrgLabor> findByOrganizationId(long organizationId)
476                    throws SystemException {
477                    return findByOrganizationId(organizationId, QueryUtil.ALL_POS,
478                            QueryUtil.ALL_POS, null);
479            }
480    
481            /**
482             * Returns a range of all the org labors where organizationId = &#63;.
483             *
484             * <p>
485             * 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.
486             * </p>
487             *
488             * @param organizationId the organization ID
489             * @param start the lower bound of the range of org labors
490             * @param end the upper bound of the range of org labors (not inclusive)
491             * @return the range of matching org labors
492             * @throws SystemException if a system exception occurred
493             */
494            public List<OrgLabor> findByOrganizationId(long organizationId, int start,
495                    int end) throws SystemException {
496                    return findByOrganizationId(organizationId, start, end, null);
497            }
498    
499            /**
500             * Returns an ordered range of all the org labors where organizationId = &#63;.
501             *
502             * <p>
503             * 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.
504             * </p>
505             *
506             * @param organizationId the organization ID
507             * @param start the lower bound of the range of org labors
508             * @param end the upper bound of the range of org labors (not inclusive)
509             * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
510             * @return the ordered range of matching org labors
511             * @throws SystemException if a system exception occurred
512             */
513            public List<OrgLabor> findByOrganizationId(long organizationId, int start,
514                    int end, OrderByComparator orderByComparator) throws SystemException {
515                    FinderPath finderPath = null;
516                    Object[] finderArgs = null;
517    
518                    if ((start == QueryUtil.ALL_POS) && (end == QueryUtil.ALL_POS) &&
519                                    (orderByComparator == null)) {
520                            finderPath = FINDER_PATH_WITHOUT_PAGINATION_FIND_BY_ORGANIZATIONID;
521                            finderArgs = new Object[] { organizationId };
522                    }
523                    else {
524                            finderPath = FINDER_PATH_WITH_PAGINATION_FIND_BY_ORGANIZATIONID;
525                            finderArgs = new Object[] {
526                                            organizationId,
527                                            
528                                            start, end, orderByComparator
529                                    };
530                    }
531    
532                    List<OrgLabor> list = (List<OrgLabor>)FinderCacheUtil.getResult(finderPath,
533                                    finderArgs, this);
534    
535                    if (list == null) {
536                            StringBundler query = null;
537    
538                            if (orderByComparator != null) {
539                                    query = new StringBundler(3 +
540                                                    (orderByComparator.getOrderByFields().length * 3));
541                            }
542                            else {
543                                    query = new StringBundler(3);
544                            }
545    
546                            query.append(_SQL_SELECT_ORGLABOR_WHERE);
547    
548                            query.append(_FINDER_COLUMN_ORGANIZATIONID_ORGANIZATIONID_2);
549    
550                            if (orderByComparator != null) {
551                                    appendOrderByComparator(query, _ORDER_BY_ENTITY_ALIAS,
552                                            orderByComparator);
553                            }
554    
555                            else {
556                                    query.append(OrgLaborModelImpl.ORDER_BY_JPQL);
557                            }
558    
559                            String sql = query.toString();
560    
561                            Session session = null;
562    
563                            try {
564                                    session = openSession();
565    
566                                    Query q = session.createQuery(sql);
567    
568                                    QueryPos qPos = QueryPos.getInstance(q);
569    
570                                    qPos.add(organizationId);
571    
572                                    list = (List<OrgLabor>)QueryUtil.list(q, getDialect(), start,
573                                                    end);
574                            }
575                            catch (Exception e) {
576                                    throw processException(e);
577                            }
578                            finally {
579                                    if (list == null) {
580                                            FinderCacheUtil.removeResult(finderPath, finderArgs);
581                                    }
582                                    else {
583                                            cacheResult(list);
584    
585                                            FinderCacheUtil.putResult(finderPath, finderArgs, list);
586                                    }
587    
588                                    closeSession(session);
589                            }
590                    }
591    
592                    return list;
593            }
594    
595            /**
596             * Returns the first org labor in the ordered set where organizationId = &#63;.
597             *
598             * <p>
599             * 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.
600             * </p>
601             *
602             * @param organizationId the organization ID
603             * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
604             * @return the first matching org labor
605             * @throws com.liferay.portal.NoSuchOrgLaborException if a matching org labor could not be found
606             * @throws SystemException if a system exception occurred
607             */
608            public OrgLabor findByOrganizationId_First(long organizationId,
609                    OrderByComparator orderByComparator)
610                    throws NoSuchOrgLaborException, SystemException {
611                    List<OrgLabor> list = findByOrganizationId(organizationId, 0, 1,
612                                    orderByComparator);
613    
614                    if (list.isEmpty()) {
615                            StringBundler msg = new StringBundler(4);
616    
617                            msg.append(_NO_SUCH_ENTITY_WITH_KEY);
618    
619                            msg.append("organizationId=");
620                            msg.append(organizationId);
621    
622                            msg.append(StringPool.CLOSE_CURLY_BRACE);
623    
624                            throw new NoSuchOrgLaborException(msg.toString());
625                    }
626                    else {
627                            return list.get(0);
628                    }
629            }
630    
631            /**
632             * Returns the last org labor in the ordered set where organizationId = &#63;.
633             *
634             * <p>
635             * 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.
636             * </p>
637             *
638             * @param organizationId the organization ID
639             * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
640             * @return the last matching org labor
641             * @throws com.liferay.portal.NoSuchOrgLaborException if a matching org labor could not be found
642             * @throws SystemException if a system exception occurred
643             */
644            public OrgLabor findByOrganizationId_Last(long organizationId,
645                    OrderByComparator orderByComparator)
646                    throws NoSuchOrgLaborException, SystemException {
647                    int count = countByOrganizationId(organizationId);
648    
649                    List<OrgLabor> list = findByOrganizationId(organizationId, count - 1,
650                                    count, orderByComparator);
651    
652                    if (list.isEmpty()) {
653                            StringBundler msg = new StringBundler(4);
654    
655                            msg.append(_NO_SUCH_ENTITY_WITH_KEY);
656    
657                            msg.append("organizationId=");
658                            msg.append(organizationId);
659    
660                            msg.append(StringPool.CLOSE_CURLY_BRACE);
661    
662                            throw new NoSuchOrgLaborException(msg.toString());
663                    }
664                    else {
665                            return list.get(0);
666                    }
667            }
668    
669            /**
670             * Returns the org labors before and after the current org labor in the ordered set where organizationId = &#63;.
671             *
672             * <p>
673             * 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.
674             * </p>
675             *
676             * @param orgLaborId the primary key of the current org labor
677             * @param organizationId the organization ID
678             * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
679             * @return the previous, current, and next org labor
680             * @throws com.liferay.portal.NoSuchOrgLaborException if a org labor with the primary key could not be found
681             * @throws SystemException if a system exception occurred
682             */
683            public OrgLabor[] findByOrganizationId_PrevAndNext(long orgLaborId,
684                    long organizationId, OrderByComparator orderByComparator)
685                    throws NoSuchOrgLaborException, SystemException {
686                    OrgLabor orgLabor = findByPrimaryKey(orgLaborId);
687    
688                    Session session = null;
689    
690                    try {
691                            session = openSession();
692    
693                            OrgLabor[] array = new OrgLaborImpl[3];
694    
695                            array[0] = getByOrganizationId_PrevAndNext(session, orgLabor,
696                                            organizationId, orderByComparator, true);
697    
698                            array[1] = orgLabor;
699    
700                            array[2] = getByOrganizationId_PrevAndNext(session, orgLabor,
701                                            organizationId, orderByComparator, false);
702    
703                            return array;
704                    }
705                    catch (Exception e) {
706                            throw processException(e);
707                    }
708                    finally {
709                            closeSession(session);
710                    }
711            }
712    
713            protected OrgLabor getByOrganizationId_PrevAndNext(Session session,
714                    OrgLabor orgLabor, long organizationId,
715                    OrderByComparator orderByComparator, boolean previous) {
716                    StringBundler query = null;
717    
718                    if (orderByComparator != null) {
719                            query = new StringBundler(6 +
720                                            (orderByComparator.getOrderByFields().length * 6));
721                    }
722                    else {
723                            query = new StringBundler(3);
724                    }
725    
726                    query.append(_SQL_SELECT_ORGLABOR_WHERE);
727    
728                    query.append(_FINDER_COLUMN_ORGANIZATIONID_ORGANIZATIONID_2);
729    
730                    if (orderByComparator != null) {
731                            String[] orderByConditionFields = orderByComparator.getOrderByConditionFields();
732    
733                            if (orderByConditionFields.length > 0) {
734                                    query.append(WHERE_AND);
735                            }
736    
737                            for (int i = 0; i < orderByConditionFields.length; i++) {
738                                    query.append(_ORDER_BY_ENTITY_ALIAS);
739                                    query.append(orderByConditionFields[i]);
740    
741                                    if ((i + 1) < orderByConditionFields.length) {
742                                            if (orderByComparator.isAscending() ^ previous) {
743                                                    query.append(WHERE_GREATER_THAN_HAS_NEXT);
744                                            }
745                                            else {
746                                                    query.append(WHERE_LESSER_THAN_HAS_NEXT);
747                                            }
748                                    }
749                                    else {
750                                            if (orderByComparator.isAscending() ^ previous) {
751                                                    query.append(WHERE_GREATER_THAN);
752                                            }
753                                            else {
754                                                    query.append(WHERE_LESSER_THAN);
755                                            }
756                                    }
757                            }
758    
759                            query.append(ORDER_BY_CLAUSE);
760    
761                            String[] orderByFields = orderByComparator.getOrderByFields();
762    
763                            for (int i = 0; i < orderByFields.length; i++) {
764                                    query.append(_ORDER_BY_ENTITY_ALIAS);
765                                    query.append(orderByFields[i]);
766    
767                                    if ((i + 1) < orderByFields.length) {
768                                            if (orderByComparator.isAscending() ^ previous) {
769                                                    query.append(ORDER_BY_ASC_HAS_NEXT);
770                                            }
771                                            else {
772                                                    query.append(ORDER_BY_DESC_HAS_NEXT);
773                                            }
774                                    }
775                                    else {
776                                            if (orderByComparator.isAscending() ^ previous) {
777                                                    query.append(ORDER_BY_ASC);
778                                            }
779                                            else {
780                                                    query.append(ORDER_BY_DESC);
781                                            }
782                                    }
783                            }
784                    }
785    
786                    else {
787                            query.append(OrgLaborModelImpl.ORDER_BY_JPQL);
788                    }
789    
790                    String sql = query.toString();
791    
792                    Query q = session.createQuery(sql);
793    
794                    q.setFirstResult(0);
795                    q.setMaxResults(2);
796    
797                    QueryPos qPos = QueryPos.getInstance(q);
798    
799                    qPos.add(organizationId);
800    
801                    if (orderByComparator != null) {
802                            Object[] values = orderByComparator.getOrderByConditionValues(orgLabor);
803    
804                            for (Object value : values) {
805                                    qPos.add(value);
806                            }
807                    }
808    
809                    List<OrgLabor> list = q.list();
810    
811                    if (list.size() == 2) {
812                            return list.get(1);
813                    }
814                    else {
815                            return null;
816                    }
817            }
818    
819            /**
820             * Returns all the org labors.
821             *
822             * @return the org labors
823             * @throws SystemException if a system exception occurred
824             */
825            public List<OrgLabor> findAll() throws SystemException {
826                    return findAll(QueryUtil.ALL_POS, QueryUtil.ALL_POS, null);
827            }
828    
829            /**
830             * Returns a range of all the org labors.
831             *
832             * <p>
833             * 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.
834             * </p>
835             *
836             * @param start the lower bound of the range of org labors
837             * @param end the upper bound of the range of org labors (not inclusive)
838             * @return the range of org labors
839             * @throws SystemException if a system exception occurred
840             */
841            public List<OrgLabor> findAll(int start, int end) throws SystemException {
842                    return findAll(start, end, null);
843            }
844    
845            /**
846             * Returns an ordered range of all the org labors.
847             *
848             * <p>
849             * 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.
850             * </p>
851             *
852             * @param start the lower bound of the range of org labors
853             * @param end the upper bound of the range of org labors (not inclusive)
854             * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
855             * @return the ordered range of org labors
856             * @throws SystemException if a system exception occurred
857             */
858            public List<OrgLabor> findAll(int start, int end,
859                    OrderByComparator orderByComparator) throws SystemException {
860                    FinderPath finderPath = null;
861                    Object[] finderArgs = new Object[] { start, end, orderByComparator };
862    
863                    if ((start == QueryUtil.ALL_POS) && (end == QueryUtil.ALL_POS) &&
864                                    (orderByComparator == null)) {
865                            finderPath = FINDER_PATH_WITH_PAGINATION_FIND_ALL;
866                            finderArgs = FINDER_ARGS_EMPTY;
867                    }
868                    else {
869                            finderPath = FINDER_PATH_WITHOUT_PAGINATION_FIND_ALL;
870                            finderArgs = new Object[] { start, end, orderByComparator };
871                    }
872    
873                    List<OrgLabor> list = (List<OrgLabor>)FinderCacheUtil.getResult(finderPath,
874                                    finderArgs, this);
875    
876                    if (list == null) {
877                            StringBundler query = null;
878                            String sql = null;
879    
880                            if (orderByComparator != null) {
881                                    query = new StringBundler(2 +
882                                                    (orderByComparator.getOrderByFields().length * 3));
883    
884                                    query.append(_SQL_SELECT_ORGLABOR);
885    
886                                    appendOrderByComparator(query, _ORDER_BY_ENTITY_ALIAS,
887                                            orderByComparator);
888    
889                                    sql = query.toString();
890                            }
891                            else {
892                                    sql = _SQL_SELECT_ORGLABOR.concat(OrgLaborModelImpl.ORDER_BY_JPQL);
893                            }
894    
895                            Session session = null;
896    
897                            try {
898                                    session = openSession();
899    
900                                    Query q = session.createQuery(sql);
901    
902                                    if (orderByComparator == null) {
903                                            list = (List<OrgLabor>)QueryUtil.list(q, getDialect(),
904                                                            start, end, false);
905    
906                                            Collections.sort(list);
907                                    }
908                                    else {
909                                            list = (List<OrgLabor>)QueryUtil.list(q, getDialect(),
910                                                            start, end);
911                                    }
912                            }
913                            catch (Exception e) {
914                                    throw processException(e);
915                            }
916                            finally {
917                                    if (list == null) {
918                                            FinderCacheUtil.removeResult(finderPath, finderArgs);
919                                    }
920                                    else {
921                                            cacheResult(list);
922    
923                                            FinderCacheUtil.putResult(finderPath, finderArgs, list);
924                                    }
925    
926                                    closeSession(session);
927                            }
928                    }
929    
930                    return list;
931            }
932    
933            /**
934             * Removes all the org labors where organizationId = &#63; from the database.
935             *
936             * @param organizationId the organization ID
937             * @throws SystemException if a system exception occurred
938             */
939            public void removeByOrganizationId(long organizationId)
940                    throws SystemException {
941                    for (OrgLabor orgLabor : findByOrganizationId(organizationId)) {
942                            orgLaborPersistence.remove(orgLabor);
943                    }
944            }
945    
946            /**
947             * Removes all the org labors from the database.
948             *
949             * @throws SystemException if a system exception occurred
950             */
951            public void removeAll() throws SystemException {
952                    for (OrgLabor orgLabor : findAll()) {
953                            orgLaborPersistence.remove(orgLabor);
954                    }
955            }
956    
957            /**
958             * Returns the number of org labors where organizationId = &#63;.
959             *
960             * @param organizationId the organization ID
961             * @return the number of matching org labors
962             * @throws SystemException if a system exception occurred
963             */
964            public int countByOrganizationId(long organizationId)
965                    throws SystemException {
966                    Object[] finderArgs = new Object[] { organizationId };
967    
968                    Long count = (Long)FinderCacheUtil.getResult(FINDER_PATH_COUNT_BY_ORGANIZATIONID,
969                                    finderArgs, this);
970    
971                    if (count == null) {
972                            StringBundler query = new StringBundler(2);
973    
974                            query.append(_SQL_COUNT_ORGLABOR_WHERE);
975    
976                            query.append(_FINDER_COLUMN_ORGANIZATIONID_ORGANIZATIONID_2);
977    
978                            String sql = query.toString();
979    
980                            Session session = null;
981    
982                            try {
983                                    session = openSession();
984    
985                                    Query q = session.createQuery(sql);
986    
987                                    QueryPos qPos = QueryPos.getInstance(q);
988    
989                                    qPos.add(organizationId);
990    
991                                    count = (Long)q.uniqueResult();
992                            }
993                            catch (Exception e) {
994                                    throw processException(e);
995                            }
996                            finally {
997                                    if (count == null) {
998                                            count = Long.valueOf(0);
999                                    }
1000    
1001                                    FinderCacheUtil.putResult(FINDER_PATH_COUNT_BY_ORGANIZATIONID,
1002                                            finderArgs, count);
1003    
1004                                    closeSession(session);
1005                            }
1006                    }
1007    
1008                    return count.intValue();
1009            }
1010    
1011            /**
1012             * Returns the number of org labors.
1013             *
1014             * @return the number of org labors
1015             * @throws SystemException if a system exception occurred
1016             */
1017            public int countAll() throws SystemException {
1018                    Long count = (Long)FinderCacheUtil.getResult(FINDER_PATH_COUNT_ALL,
1019                                    FINDER_ARGS_EMPTY, this);
1020    
1021                    if (count == null) {
1022                            Session session = null;
1023    
1024                            try {
1025                                    session = openSession();
1026    
1027                                    Query q = session.createQuery(_SQL_COUNT_ORGLABOR);
1028    
1029                                    count = (Long)q.uniqueResult();
1030                            }
1031                            catch (Exception e) {
1032                                    throw processException(e);
1033                            }
1034                            finally {
1035                                    if (count == null) {
1036                                            count = Long.valueOf(0);
1037                                    }
1038    
1039                                    FinderCacheUtil.putResult(FINDER_PATH_COUNT_ALL,
1040                                            FINDER_ARGS_EMPTY, count);
1041    
1042                                    closeSession(session);
1043                            }
1044                    }
1045    
1046                    return count.intValue();
1047            }
1048    
1049            /**
1050             * Initializes the org labor persistence.
1051             */
1052            public void afterPropertiesSet() {
1053                    String[] listenerClassNames = StringUtil.split(GetterUtil.getString(
1054                                            com.liferay.portal.util.PropsUtil.get(
1055                                                    "value.object.listener.com.liferay.portal.model.OrgLabor")));
1056    
1057                    if (listenerClassNames.length > 0) {
1058                            try {
1059                                    List<ModelListener<OrgLabor>> listenersList = new ArrayList<ModelListener<OrgLabor>>();
1060    
1061                                    for (String listenerClassName : listenerClassNames) {
1062                                            listenersList.add((ModelListener<OrgLabor>)InstanceFactory.newInstance(
1063                                                            listenerClassName));
1064                                    }
1065    
1066                                    listeners = listenersList.toArray(new ModelListener[listenersList.size()]);
1067                            }
1068                            catch (Exception e) {
1069                                    _log.error(e);
1070                            }
1071                    }
1072            }
1073    
1074            public void destroy() {
1075                    EntityCacheUtil.removeCache(OrgLaborImpl.class.getName());
1076                    FinderCacheUtil.removeCache(FINDER_CLASS_NAME_ENTITY);
1077                    FinderCacheUtil.removeCache(FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION);
1078            }
1079    
1080            @BeanReference(type = AccountPersistence.class)
1081            protected AccountPersistence accountPersistence;
1082            @BeanReference(type = AddressPersistence.class)
1083            protected AddressPersistence addressPersistence;
1084            @BeanReference(type = BrowserTrackerPersistence.class)
1085            protected BrowserTrackerPersistence browserTrackerPersistence;
1086            @BeanReference(type = ClassNamePersistence.class)
1087            protected ClassNamePersistence classNamePersistence;
1088            @BeanReference(type = ClusterGroupPersistence.class)
1089            protected ClusterGroupPersistence clusterGroupPersistence;
1090            @BeanReference(type = CompanyPersistence.class)
1091            protected CompanyPersistence companyPersistence;
1092            @BeanReference(type = ContactPersistence.class)
1093            protected ContactPersistence contactPersistence;
1094            @BeanReference(type = CountryPersistence.class)
1095            protected CountryPersistence countryPersistence;
1096            @BeanReference(type = EmailAddressPersistence.class)
1097            protected EmailAddressPersistence emailAddressPersistence;
1098            @BeanReference(type = GroupPersistence.class)
1099            protected GroupPersistence groupPersistence;
1100            @BeanReference(type = ImagePersistence.class)
1101            protected ImagePersistence imagePersistence;
1102            @BeanReference(type = LayoutPersistence.class)
1103            protected LayoutPersistence layoutPersistence;
1104            @BeanReference(type = LayoutBranchPersistence.class)
1105            protected LayoutBranchPersistence layoutBranchPersistence;
1106            @BeanReference(type = LayoutPrototypePersistence.class)
1107            protected LayoutPrototypePersistence layoutPrototypePersistence;
1108            @BeanReference(type = LayoutRevisionPersistence.class)
1109            protected LayoutRevisionPersistence layoutRevisionPersistence;
1110            @BeanReference(type = LayoutSetPersistence.class)
1111            protected LayoutSetPersistence layoutSetPersistence;
1112            @BeanReference(type = LayoutSetBranchPersistence.class)
1113            protected LayoutSetBranchPersistence layoutSetBranchPersistence;
1114            @BeanReference(type = LayoutSetPrototypePersistence.class)
1115            protected LayoutSetPrototypePersistence layoutSetPrototypePersistence;
1116            @BeanReference(type = ListTypePersistence.class)
1117            protected ListTypePersistence listTypePersistence;
1118            @BeanReference(type = LockPersistence.class)
1119            protected LockPersistence lockPersistence;
1120            @BeanReference(type = MembershipRequestPersistence.class)
1121            protected MembershipRequestPersistence membershipRequestPersistence;
1122            @BeanReference(type = OrganizationPersistence.class)
1123            protected OrganizationPersistence organizationPersistence;
1124            @BeanReference(type = OrgGroupPermissionPersistence.class)
1125            protected OrgGroupPermissionPersistence orgGroupPermissionPersistence;
1126            @BeanReference(type = OrgGroupRolePersistence.class)
1127            protected OrgGroupRolePersistence orgGroupRolePersistence;
1128            @BeanReference(type = OrgLaborPersistence.class)
1129            protected OrgLaborPersistence orgLaborPersistence;
1130            @BeanReference(type = PasswordPolicyPersistence.class)
1131            protected PasswordPolicyPersistence passwordPolicyPersistence;
1132            @BeanReference(type = PasswordPolicyRelPersistence.class)
1133            protected PasswordPolicyRelPersistence passwordPolicyRelPersistence;
1134            @BeanReference(type = PasswordTrackerPersistence.class)
1135            protected PasswordTrackerPersistence passwordTrackerPersistence;
1136            @BeanReference(type = PermissionPersistence.class)
1137            protected PermissionPersistence permissionPersistence;
1138            @BeanReference(type = PhonePersistence.class)
1139            protected PhonePersistence phonePersistence;
1140            @BeanReference(type = PluginSettingPersistence.class)
1141            protected PluginSettingPersistence pluginSettingPersistence;
1142            @BeanReference(type = PortalPreferencesPersistence.class)
1143            protected PortalPreferencesPersistence portalPreferencesPersistence;
1144            @BeanReference(type = PortletPersistence.class)
1145            protected PortletPersistence portletPersistence;
1146            @BeanReference(type = PortletItemPersistence.class)
1147            protected PortletItemPersistence portletItemPersistence;
1148            @BeanReference(type = PortletPreferencesPersistence.class)
1149            protected PortletPreferencesPersistence portletPreferencesPersistence;
1150            @BeanReference(type = RegionPersistence.class)
1151            protected RegionPersistence regionPersistence;
1152            @BeanReference(type = ReleasePersistence.class)
1153            protected ReleasePersistence releasePersistence;
1154            @BeanReference(type = RepositoryPersistence.class)
1155            protected RepositoryPersistence repositoryPersistence;
1156            @BeanReference(type = RepositoryEntryPersistence.class)
1157            protected RepositoryEntryPersistence repositoryEntryPersistence;
1158            @BeanReference(type = ResourcePersistence.class)
1159            protected ResourcePersistence resourcePersistence;
1160            @BeanReference(type = ResourceActionPersistence.class)
1161            protected ResourceActionPersistence resourceActionPersistence;
1162            @BeanReference(type = ResourceBlockPersistence.class)
1163            protected ResourceBlockPersistence resourceBlockPersistence;
1164            @BeanReference(type = ResourceBlockPermissionPersistence.class)
1165            protected ResourceBlockPermissionPersistence resourceBlockPermissionPersistence;
1166            @BeanReference(type = ResourceCodePersistence.class)
1167            protected ResourceCodePersistence resourceCodePersistence;
1168            @BeanReference(type = ResourcePermissionPersistence.class)
1169            protected ResourcePermissionPersistence resourcePermissionPersistence;
1170            @BeanReference(type = ResourceTypePermissionPersistence.class)
1171            protected ResourceTypePermissionPersistence resourceTypePermissionPersistence;
1172            @BeanReference(type = RolePersistence.class)
1173            protected RolePersistence rolePersistence;
1174            @BeanReference(type = ServiceComponentPersistence.class)
1175            protected ServiceComponentPersistence serviceComponentPersistence;
1176            @BeanReference(type = ShardPersistence.class)
1177            protected ShardPersistence shardPersistence;
1178            @BeanReference(type = SubscriptionPersistence.class)
1179            protected SubscriptionPersistence subscriptionPersistence;
1180            @BeanReference(type = TeamPersistence.class)
1181            protected TeamPersistence teamPersistence;
1182            @BeanReference(type = TicketPersistence.class)
1183            protected TicketPersistence ticketPersistence;
1184            @BeanReference(type = UserPersistence.class)
1185            protected UserPersistence userPersistence;
1186            @BeanReference(type = UserGroupPersistence.class)
1187            protected UserGroupPersistence userGroupPersistence;
1188            @BeanReference(type = UserGroupGroupRolePersistence.class)
1189            protected UserGroupGroupRolePersistence userGroupGroupRolePersistence;
1190            @BeanReference(type = UserGroupRolePersistence.class)
1191            protected UserGroupRolePersistence userGroupRolePersistence;
1192            @BeanReference(type = UserIdMapperPersistence.class)
1193            protected UserIdMapperPersistence userIdMapperPersistence;
1194            @BeanReference(type = UserNotificationEventPersistence.class)
1195            protected UserNotificationEventPersistence userNotificationEventPersistence;
1196            @BeanReference(type = UserTrackerPersistence.class)
1197            protected UserTrackerPersistence userTrackerPersistence;
1198            @BeanReference(type = UserTrackerPathPersistence.class)
1199            protected UserTrackerPathPersistence userTrackerPathPersistence;
1200            @BeanReference(type = VirtualHostPersistence.class)
1201            protected VirtualHostPersistence virtualHostPersistence;
1202            @BeanReference(type = WebDAVPropsPersistence.class)
1203            protected WebDAVPropsPersistence webDAVPropsPersistence;
1204            @BeanReference(type = WebsitePersistence.class)
1205            protected WebsitePersistence websitePersistence;
1206            @BeanReference(type = WorkflowDefinitionLinkPersistence.class)
1207            protected WorkflowDefinitionLinkPersistence workflowDefinitionLinkPersistence;
1208            @BeanReference(type = WorkflowInstanceLinkPersistence.class)
1209            protected WorkflowInstanceLinkPersistence workflowInstanceLinkPersistence;
1210            private static final String _SQL_SELECT_ORGLABOR = "SELECT orgLabor FROM OrgLabor orgLabor";
1211            private static final String _SQL_SELECT_ORGLABOR_WHERE = "SELECT orgLabor FROM OrgLabor orgLabor WHERE ";
1212            private static final String _SQL_COUNT_ORGLABOR = "SELECT COUNT(orgLabor) FROM OrgLabor orgLabor";
1213            private static final String _SQL_COUNT_ORGLABOR_WHERE = "SELECT COUNT(orgLabor) FROM OrgLabor orgLabor WHERE ";
1214            private static final String _FINDER_COLUMN_ORGANIZATIONID_ORGANIZATIONID_2 = "orgLabor.organizationId = ?";
1215            private static final String _ORDER_BY_ENTITY_ALIAS = "orgLabor.";
1216            private static final String _NO_SUCH_ENTITY_WITH_PRIMARY_KEY = "No OrgLabor exists with the primary key ";
1217            private static final String _NO_SUCH_ENTITY_WITH_KEY = "No OrgLabor exists with the key {";
1218            private static final boolean _HIBERNATE_CACHE_USE_SECOND_LEVEL_CACHE = com.liferay.portal.util.PropsValues.HIBERNATE_CACHE_USE_SECOND_LEVEL_CACHE;
1219            private static Log _log = LogFactoryUtil.getLog(OrgLaborPersistenceImpl.class);
1220            private static OrgLabor _nullOrgLabor = new OrgLaborImpl() {
1221                            @Override
1222                            public Object clone() {
1223                                    return this;
1224                            }
1225    
1226                            @Override
1227                            public CacheModel<OrgLabor> toCacheModel() {
1228                                    return _nullOrgLaborCacheModel;
1229                            }
1230                    };
1231    
1232            private static CacheModel<OrgLabor> _nullOrgLaborCacheModel = new CacheModel<OrgLabor>() {
1233                            public OrgLabor toEntityModel() {
1234                                    return _nullOrgLabor;
1235                            }
1236                    };
1237    }