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