001    /**
002     * Copyright (c) 2000-2012 Liferay, Inc. All rights reserved.
003     *
004     * This library is free software; you can redistribute it and/or modify it under
005     * the terms of the GNU Lesser General Public License as published by the Free
006     * Software Foundation; either version 2.1 of the License, or (at your option)
007     * any later version.
008     *
009     * This library is distributed in the hope that it will be useful, but WITHOUT
010     * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
011     * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
012     * details.
013     */
014    
015    package com.liferay.portal.service.persistence;
016    
017    import com.liferay.portal.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                            if (orgLabor.isCachedModel()) {
260                                    orgLabor = (OrgLabor)session.get(OrgLaborImpl.class,
261                                                    orgLabor.getPrimaryKeyObj());
262                            }
263    
264                            session.delete(orgLabor);
265                    }
266                    catch (Exception e) {
267                            throw processException(e);
268                    }
269                    finally {
270                            closeSession(session);
271                    }
272    
273                    clearCache(orgLabor);
274    
275                    return orgLabor;
276            }
277    
278            @Override
279            public OrgLabor updateImpl(com.liferay.portal.model.OrgLabor orgLabor)
280                    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                            if (orgLabor.isNew()) {
293                                    session.save(orgLabor);
294    
295                                    orgLabor.setNew(false);
296                            }
297                            else {
298                                    session.merge(orgLabor);
299                            }
300                    }
301                    catch (Exception e) {
302                            throw processException(e);
303                    }
304                    finally {
305                            closeSession(session);
306                    }
307    
308                    FinderCacheUtil.clearCache(FINDER_CLASS_NAME_LIST_WITH_PAGINATION);
309    
310                    if (isNew || !OrgLaborModelImpl.COLUMN_BITMASK_ENABLED) {
311                            FinderCacheUtil.clearCache(FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION);
312                    }
313    
314                    else {
315                            if ((orgLaborModelImpl.getColumnBitmask() &
316                                            FINDER_PATH_WITHOUT_PAGINATION_FIND_BY_ORGANIZATIONID.getColumnBitmask()) != 0) {
317                                    Object[] args = new Object[] {
318                                                    Long.valueOf(orgLaborModelImpl.getOriginalOrganizationId())
319                                            };
320    
321                                    FinderCacheUtil.removeResult(FINDER_PATH_COUNT_BY_ORGANIZATIONID,
322                                            args);
323                                    FinderCacheUtil.removeResult(FINDER_PATH_WITHOUT_PAGINATION_FIND_BY_ORGANIZATIONID,
324                                            args);
325    
326                                    args = new Object[] {
327                                                    Long.valueOf(orgLaborModelImpl.getOrganizationId())
328                                            };
329    
330                                    FinderCacheUtil.removeResult(FINDER_PATH_COUNT_BY_ORGANIZATIONID,
331                                            args);
332                                    FinderCacheUtil.removeResult(FINDER_PATH_WITHOUT_PAGINATION_FIND_BY_ORGANIZATIONID,
333                                            args);
334                            }
335                    }
336    
337                    EntityCacheUtil.putResult(OrgLaborModelImpl.ENTITY_CACHE_ENABLED,
338                            OrgLaborImpl.class, orgLabor.getPrimaryKey(), orgLabor);
339    
340                    return orgLabor;
341            }
342    
343            protected OrgLabor toUnwrappedModel(OrgLabor orgLabor) {
344                    if (orgLabor instanceof OrgLaborImpl) {
345                            return orgLabor;
346                    }
347    
348                    OrgLaborImpl orgLaborImpl = new OrgLaborImpl();
349    
350                    orgLaborImpl.setNew(orgLabor.isNew());
351                    orgLaborImpl.setPrimaryKey(orgLabor.getPrimaryKey());
352    
353                    orgLaborImpl.setOrgLaborId(orgLabor.getOrgLaborId());
354                    orgLaborImpl.setOrganizationId(orgLabor.getOrganizationId());
355                    orgLaborImpl.setTypeId(orgLabor.getTypeId());
356                    orgLaborImpl.setSunOpen(orgLabor.getSunOpen());
357                    orgLaborImpl.setSunClose(orgLabor.getSunClose());
358                    orgLaborImpl.setMonOpen(orgLabor.getMonOpen());
359                    orgLaborImpl.setMonClose(orgLabor.getMonClose());
360                    orgLaborImpl.setTueOpen(orgLabor.getTueOpen());
361                    orgLaborImpl.setTueClose(orgLabor.getTueClose());
362                    orgLaborImpl.setWedOpen(orgLabor.getWedOpen());
363                    orgLaborImpl.setWedClose(orgLabor.getWedClose());
364                    orgLaborImpl.setThuOpen(orgLabor.getThuOpen());
365                    orgLaborImpl.setThuClose(orgLabor.getThuClose());
366                    orgLaborImpl.setFriOpen(orgLabor.getFriOpen());
367                    orgLaborImpl.setFriClose(orgLabor.getFriClose());
368                    orgLaborImpl.setSatOpen(orgLabor.getSatOpen());
369                    orgLaborImpl.setSatClose(orgLabor.getSatClose());
370    
371                    return orgLaborImpl;
372            }
373    
374            /**
375             * Returns the org labor with the primary key or throws a {@link com.liferay.portal.NoSuchModelException} if it could not be found.
376             *
377             * @param primaryKey the primary key of the org labor
378             * @return the org labor
379             * @throws com.liferay.portal.NoSuchModelException if a org labor with the primary key could not be found
380             * @throws SystemException if a system exception occurred
381             */
382            @Override
383            public OrgLabor findByPrimaryKey(Serializable primaryKey)
384                    throws NoSuchModelException, SystemException {
385                    return findByPrimaryKey(((Long)primaryKey).longValue());
386            }
387    
388            /**
389             * Returns the org labor with the primary key or throws a {@link com.liferay.portal.NoSuchOrgLaborException} if it could not be found.
390             *
391             * @param orgLaborId the primary key of the org labor
392             * @return the org labor
393             * @throws com.liferay.portal.NoSuchOrgLaborException if a org labor with the primary key could not be found
394             * @throws SystemException if a system exception occurred
395             */
396            public OrgLabor findByPrimaryKey(long orgLaborId)
397                    throws NoSuchOrgLaborException, SystemException {
398                    OrgLabor orgLabor = fetchByPrimaryKey(orgLaborId);
399    
400                    if (orgLabor == null) {
401                            if (_log.isWarnEnabled()) {
402                                    _log.warn(_NO_SUCH_ENTITY_WITH_PRIMARY_KEY + orgLaborId);
403                            }
404    
405                            throw new NoSuchOrgLaborException(_NO_SUCH_ENTITY_WITH_PRIMARY_KEY +
406                                    orgLaborId);
407                    }
408    
409                    return orgLabor;
410            }
411    
412            /**
413             * Returns the org labor with the primary key or returns <code>null</code> if it could not be found.
414             *
415             * @param primaryKey the primary key of the org labor
416             * @return the org labor, or <code>null</code> if a org labor with the primary key could not be found
417             * @throws SystemException if a system exception occurred
418             */
419            @Override
420            public OrgLabor fetchByPrimaryKey(Serializable primaryKey)
421                    throws SystemException {
422                    return fetchByPrimaryKey(((Long)primaryKey).longValue());
423            }
424    
425            /**
426             * Returns the org labor with the primary key or returns <code>null</code> if it could not be found.
427             *
428             * @param orgLaborId the primary key of the org labor
429             * @return the org labor, or <code>null</code> if a org labor with the primary key could not be found
430             * @throws SystemException if a system exception occurred
431             */
432            public OrgLabor fetchByPrimaryKey(long orgLaborId)
433                    throws SystemException {
434                    OrgLabor orgLabor = (OrgLabor)EntityCacheUtil.getResult(OrgLaborModelImpl.ENTITY_CACHE_ENABLED,
435                                    OrgLaborImpl.class, orgLaborId);
436    
437                    if (orgLabor == _nullOrgLabor) {
438                            return null;
439                    }
440    
441                    if (orgLabor == null) {
442                            Session session = null;
443    
444                            boolean hasException = false;
445    
446                            try {
447                                    session = openSession();
448    
449                                    orgLabor = (OrgLabor)session.get(OrgLaborImpl.class,
450                                                    Long.valueOf(orgLaborId));
451                            }
452                            catch (Exception e) {
453                                    hasException = true;
454    
455                                    throw processException(e);
456                            }
457                            finally {
458                                    if (orgLabor != null) {
459                                            cacheResult(orgLabor);
460                                    }
461                                    else if (!hasException) {
462                                            EntityCacheUtil.putResult(OrgLaborModelImpl.ENTITY_CACHE_ENABLED,
463                                                    OrgLaborImpl.class, orgLaborId, _nullOrgLabor);
464                                    }
465    
466                                    closeSession(session);
467                            }
468                    }
469    
470                    return orgLabor;
471            }
472    
473            /**
474             * Returns all the org labors where organizationId = &#63;.
475             *
476             * @param organizationId the organization ID
477             * @return the matching org labors
478             * @throws SystemException if a system exception occurred
479             */
480            public List<OrgLabor> findByOrganizationId(long organizationId)
481                    throws SystemException {
482                    return findByOrganizationId(organizationId, QueryUtil.ALL_POS,
483                            QueryUtil.ALL_POS, null);
484            }
485    
486            /**
487             * Returns a range of all the org labors where organizationId = &#63;.
488             *
489             * <p>
490             * 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.
491             * </p>
492             *
493             * @param organizationId the organization ID
494             * @param start the lower bound of the range of org labors
495             * @param end the upper bound of the range of org labors (not inclusive)
496             * @return the range of matching org labors
497             * @throws SystemException if a system exception occurred
498             */
499            public List<OrgLabor> findByOrganizationId(long organizationId, int start,
500                    int end) throws SystemException {
501                    return findByOrganizationId(organizationId, start, end, null);
502            }
503    
504            /**
505             * Returns an ordered range of all the org labors where organizationId = &#63;.
506             *
507             * <p>
508             * 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.
509             * </p>
510             *
511             * @param organizationId the organization ID
512             * @param start the lower bound of the range of org labors
513             * @param end the upper bound of the range of org labors (not inclusive)
514             * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
515             * @return the ordered range of matching org labors
516             * @throws SystemException if a system exception occurred
517             */
518            public List<OrgLabor> findByOrganizationId(long organizationId, int start,
519                    int end, OrderByComparator orderByComparator) throws SystemException {
520                    FinderPath finderPath = null;
521                    Object[] finderArgs = null;
522    
523                    if ((start == QueryUtil.ALL_POS) && (end == QueryUtil.ALL_POS) &&
524                                    (orderByComparator == null)) {
525                            finderPath = FINDER_PATH_WITHOUT_PAGINATION_FIND_BY_ORGANIZATIONID;
526                            finderArgs = new Object[] { organizationId };
527                    }
528                    else {
529                            finderPath = FINDER_PATH_WITH_PAGINATION_FIND_BY_ORGANIZATIONID;
530                            finderArgs = new Object[] {
531                                            organizationId,
532                                            
533                                            start, end, orderByComparator
534                                    };
535                    }
536    
537                    List<OrgLabor> list = (List<OrgLabor>)FinderCacheUtil.getResult(finderPath,
538                                    finderArgs, this);
539    
540                    if ((list != null) && !list.isEmpty()) {
541                            for (OrgLabor orgLabor : list) {
542                                    if ((organizationId != orgLabor.getOrganizationId())) {
543                                            list = null;
544    
545                                            break;
546                                    }
547                            }
548                    }
549    
550                    if (list == null) {
551                            StringBundler query = null;
552    
553                            if (orderByComparator != null) {
554                                    query = new StringBundler(3 +
555                                                    (orderByComparator.getOrderByFields().length * 3));
556                            }
557                            else {
558                                    query = new StringBundler(3);
559                            }
560    
561                            query.append(_SQL_SELECT_ORGLABOR_WHERE);
562    
563                            query.append(_FINDER_COLUMN_ORGANIZATIONID_ORGANIZATIONID_2);
564    
565                            if (orderByComparator != null) {
566                                    appendOrderByComparator(query, _ORDER_BY_ENTITY_ALIAS,
567                                            orderByComparator);
568                            }
569    
570                            else {
571                                    query.append(OrgLaborModelImpl.ORDER_BY_JPQL);
572                            }
573    
574                            String sql = query.toString();
575    
576                            Session session = null;
577    
578                            try {
579                                    session = openSession();
580    
581                                    Query q = session.createQuery(sql);
582    
583                                    QueryPos qPos = QueryPos.getInstance(q);
584    
585                                    qPos.add(organizationId);
586    
587                                    list = (List<OrgLabor>)QueryUtil.list(q, getDialect(), start,
588                                                    end);
589                            }
590                            catch (Exception e) {
591                                    throw processException(e);
592                            }
593                            finally {
594                                    if (list == null) {
595                                            FinderCacheUtil.removeResult(finderPath, finderArgs);
596                                    }
597                                    else {
598                                            cacheResult(list);
599    
600                                            FinderCacheUtil.putResult(finderPath, finderArgs, list);
601                                    }
602    
603                                    closeSession(session);
604                            }
605                    }
606    
607                    return list;
608            }
609    
610            /**
611             * Returns the first org labor in the ordered set where organizationId = &#63;.
612             *
613             * @param organizationId the organization ID
614             * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
615             * @return the first matching org labor
616             * @throws com.liferay.portal.NoSuchOrgLaborException if a matching org labor could not be found
617             * @throws SystemException if a system exception occurred
618             */
619            public OrgLabor findByOrganizationId_First(long organizationId,
620                    OrderByComparator orderByComparator)
621                    throws NoSuchOrgLaborException, SystemException {
622                    OrgLabor orgLabor = fetchByOrganizationId_First(organizationId,
623                                    orderByComparator);
624    
625                    if (orgLabor != null) {
626                            return orgLabor;
627                    }
628    
629                    StringBundler msg = new StringBundler(4);
630    
631                    msg.append(_NO_SUCH_ENTITY_WITH_KEY);
632    
633                    msg.append("organizationId=");
634                    msg.append(organizationId);
635    
636                    msg.append(StringPool.CLOSE_CURLY_BRACE);
637    
638                    throw new NoSuchOrgLaborException(msg.toString());
639            }
640    
641            /**
642             * Returns the first org labor in the ordered set where organizationId = &#63;.
643             *
644             * @param organizationId the organization ID
645             * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
646             * @return the first matching org labor, or <code>null</code> if a matching org labor could not be found
647             * @throws SystemException if a system exception occurred
648             */
649            public OrgLabor fetchByOrganizationId_First(long organizationId,
650                    OrderByComparator orderByComparator) throws SystemException {
651                    List<OrgLabor> list = findByOrganizationId(organizationId, 0, 1,
652                                    orderByComparator);
653    
654                    if (!list.isEmpty()) {
655                            return list.get(0);
656                    }
657    
658                    return null;
659            }
660    
661            /**
662             * Returns the last org labor in the ordered set where organizationId = &#63;.
663             *
664             * @param organizationId the organization ID
665             * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
666             * @return the last matching org labor
667             * @throws com.liferay.portal.NoSuchOrgLaborException if a matching org labor could not be found
668             * @throws SystemException if a system exception occurred
669             */
670            public OrgLabor findByOrganizationId_Last(long organizationId,
671                    OrderByComparator orderByComparator)
672                    throws NoSuchOrgLaborException, SystemException {
673                    OrgLabor orgLabor = fetchByOrganizationId_Last(organizationId,
674                                    orderByComparator);
675    
676                    if (orgLabor != null) {
677                            return orgLabor;
678                    }
679    
680                    StringBundler msg = new StringBundler(4);
681    
682                    msg.append(_NO_SUCH_ENTITY_WITH_KEY);
683    
684                    msg.append("organizationId=");
685                    msg.append(organizationId);
686    
687                    msg.append(StringPool.CLOSE_CURLY_BRACE);
688    
689                    throw new NoSuchOrgLaborException(msg.toString());
690            }
691    
692            /**
693             * Returns the last org labor in the ordered set where organizationId = &#63;.
694             *
695             * @param organizationId the organization ID
696             * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
697             * @return the last matching org labor, or <code>null</code> if a matching org labor could not be found
698             * @throws SystemException if a system exception occurred
699             */
700            public OrgLabor fetchByOrganizationId_Last(long organizationId,
701                    OrderByComparator orderByComparator) throws SystemException {
702                    int count = countByOrganizationId(organizationId);
703    
704                    List<OrgLabor> list = findByOrganizationId(organizationId, count - 1,
705                                    count, orderByComparator);
706    
707                    if (!list.isEmpty()) {
708                            return list.get(0);
709                    }
710    
711                    return null;
712            }
713    
714            /**
715             * Returns the org labors before and after the current org labor in the ordered set where organizationId = &#63;.
716             *
717             * @param orgLaborId the primary key of the current org labor
718             * @param organizationId the organization ID
719             * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
720             * @return the previous, current, and next org labor
721             * @throws com.liferay.portal.NoSuchOrgLaborException if a org labor with the primary key could not be found
722             * @throws SystemException if a system exception occurred
723             */
724            public OrgLabor[] findByOrganizationId_PrevAndNext(long orgLaborId,
725                    long organizationId, OrderByComparator orderByComparator)
726                    throws NoSuchOrgLaborException, SystemException {
727                    OrgLabor orgLabor = findByPrimaryKey(orgLaborId);
728    
729                    Session session = null;
730    
731                    try {
732                            session = openSession();
733    
734                            OrgLabor[] array = new OrgLaborImpl[3];
735    
736                            array[0] = getByOrganizationId_PrevAndNext(session, orgLabor,
737                                            organizationId, orderByComparator, true);
738    
739                            array[1] = orgLabor;
740    
741                            array[2] = getByOrganizationId_PrevAndNext(session, orgLabor,
742                                            organizationId, orderByComparator, false);
743    
744                            return array;
745                    }
746                    catch (Exception e) {
747                            throw processException(e);
748                    }
749                    finally {
750                            closeSession(session);
751                    }
752            }
753    
754            protected OrgLabor getByOrganizationId_PrevAndNext(Session session,
755                    OrgLabor orgLabor, long organizationId,
756                    OrderByComparator orderByComparator, boolean previous) {
757                    StringBundler query = null;
758    
759                    if (orderByComparator != null) {
760                            query = new StringBundler(6 +
761                                            (orderByComparator.getOrderByFields().length * 6));
762                    }
763                    else {
764                            query = new StringBundler(3);
765                    }
766    
767                    query.append(_SQL_SELECT_ORGLABOR_WHERE);
768    
769                    query.append(_FINDER_COLUMN_ORGANIZATIONID_ORGANIZATIONID_2);
770    
771                    if (orderByComparator != null) {
772                            String[] orderByConditionFields = orderByComparator.getOrderByConditionFields();
773    
774                            if (orderByConditionFields.length > 0) {
775                                    query.append(WHERE_AND);
776                            }
777    
778                            for (int i = 0; i < orderByConditionFields.length; i++) {
779                                    query.append(_ORDER_BY_ENTITY_ALIAS);
780                                    query.append(orderByConditionFields[i]);
781    
782                                    if ((i + 1) < orderByConditionFields.length) {
783                                            if (orderByComparator.isAscending() ^ previous) {
784                                                    query.append(WHERE_GREATER_THAN_HAS_NEXT);
785                                            }
786                                            else {
787                                                    query.append(WHERE_LESSER_THAN_HAS_NEXT);
788                                            }
789                                    }
790                                    else {
791                                            if (orderByComparator.isAscending() ^ previous) {
792                                                    query.append(WHERE_GREATER_THAN);
793                                            }
794                                            else {
795                                                    query.append(WHERE_LESSER_THAN);
796                                            }
797                                    }
798                            }
799    
800                            query.append(ORDER_BY_CLAUSE);
801    
802                            String[] orderByFields = orderByComparator.getOrderByFields();
803    
804                            for (int i = 0; i < orderByFields.length; i++) {
805                                    query.append(_ORDER_BY_ENTITY_ALIAS);
806                                    query.append(orderByFields[i]);
807    
808                                    if ((i + 1) < orderByFields.length) {
809                                            if (orderByComparator.isAscending() ^ previous) {
810                                                    query.append(ORDER_BY_ASC_HAS_NEXT);
811                                            }
812                                            else {
813                                                    query.append(ORDER_BY_DESC_HAS_NEXT);
814                                            }
815                                    }
816                                    else {
817                                            if (orderByComparator.isAscending() ^ previous) {
818                                                    query.append(ORDER_BY_ASC);
819                                            }
820                                            else {
821                                                    query.append(ORDER_BY_DESC);
822                                            }
823                                    }
824                            }
825                    }
826    
827                    else {
828                            query.append(OrgLaborModelImpl.ORDER_BY_JPQL);
829                    }
830    
831                    String sql = query.toString();
832    
833                    Query q = session.createQuery(sql);
834    
835                    q.setFirstResult(0);
836                    q.setMaxResults(2);
837    
838                    QueryPos qPos = QueryPos.getInstance(q);
839    
840                    qPos.add(organizationId);
841    
842                    if (orderByComparator != null) {
843                            Object[] values = orderByComparator.getOrderByConditionValues(orgLabor);
844    
845                            for (Object value : values) {
846                                    qPos.add(value);
847                            }
848                    }
849    
850                    List<OrgLabor> list = q.list();
851    
852                    if (list.size() == 2) {
853                            return list.get(1);
854                    }
855                    else {
856                            return null;
857                    }
858            }
859    
860            /**
861             * Returns all the org labors.
862             *
863             * @return the org labors
864             * @throws SystemException if a system exception occurred
865             */
866            public List<OrgLabor> findAll() throws SystemException {
867                    return findAll(QueryUtil.ALL_POS, QueryUtil.ALL_POS, null);
868            }
869    
870            /**
871             * Returns a range of all the org labors.
872             *
873             * <p>
874             * 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.
875             * </p>
876             *
877             * @param start the lower bound of the range of org labors
878             * @param end the upper bound of the range of org labors (not inclusive)
879             * @return the range of org labors
880             * @throws SystemException if a system exception occurred
881             */
882            public List<OrgLabor> findAll(int start, int end) throws SystemException {
883                    return findAll(start, end, null);
884            }
885    
886            /**
887             * Returns an ordered range of all the org labors.
888             *
889             * <p>
890             * 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.
891             * </p>
892             *
893             * @param start the lower bound of the range of org labors
894             * @param end the upper bound of the range of org labors (not inclusive)
895             * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
896             * @return the ordered range of org labors
897             * @throws SystemException if a system exception occurred
898             */
899            public List<OrgLabor> findAll(int start, int end,
900                    OrderByComparator orderByComparator) throws SystemException {
901                    FinderPath finderPath = null;
902                    Object[] finderArgs = new Object[] { start, end, orderByComparator };
903    
904                    if ((start == QueryUtil.ALL_POS) && (end == QueryUtil.ALL_POS) &&
905                                    (orderByComparator == null)) {
906                            finderPath = FINDER_PATH_WITHOUT_PAGINATION_FIND_ALL;
907                            finderArgs = FINDER_ARGS_EMPTY;
908                    }
909                    else {
910                            finderPath = FINDER_PATH_WITH_PAGINATION_FIND_ALL;
911                            finderArgs = new Object[] { start, end, orderByComparator };
912                    }
913    
914                    List<OrgLabor> list = (List<OrgLabor>)FinderCacheUtil.getResult(finderPath,
915                                    finderArgs, this);
916    
917                    if (list == null) {
918                            StringBundler query = null;
919                            String sql = null;
920    
921                            if (orderByComparator != null) {
922                                    query = new StringBundler(2 +
923                                                    (orderByComparator.getOrderByFields().length * 3));
924    
925                                    query.append(_SQL_SELECT_ORGLABOR);
926    
927                                    appendOrderByComparator(query, _ORDER_BY_ENTITY_ALIAS,
928                                            orderByComparator);
929    
930                                    sql = query.toString();
931                            }
932                            else {
933                                    sql = _SQL_SELECT_ORGLABOR.concat(OrgLaborModelImpl.ORDER_BY_JPQL);
934                            }
935    
936                            Session session = null;
937    
938                            try {
939                                    session = openSession();
940    
941                                    Query q = session.createQuery(sql);
942    
943                                    if (orderByComparator == null) {
944                                            list = (List<OrgLabor>)QueryUtil.list(q, getDialect(),
945                                                            start, end, false);
946    
947                                            Collections.sort(list);
948                                    }
949                                    else {
950                                            list = (List<OrgLabor>)QueryUtil.list(q, getDialect(),
951                                                            start, end);
952                                    }
953                            }
954                            catch (Exception e) {
955                                    throw processException(e);
956                            }
957                            finally {
958                                    if (list == null) {
959                                            FinderCacheUtil.removeResult(finderPath, finderArgs);
960                                    }
961                                    else {
962                                            cacheResult(list);
963    
964                                            FinderCacheUtil.putResult(finderPath, finderArgs, list);
965                                    }
966    
967                                    closeSession(session);
968                            }
969                    }
970    
971                    return list;
972            }
973    
974            /**
975             * Removes all the org labors where organizationId = &#63; from the database.
976             *
977             * @param organizationId the organization ID
978             * @throws SystemException if a system exception occurred
979             */
980            public void removeByOrganizationId(long organizationId)
981                    throws SystemException {
982                    for (OrgLabor orgLabor : findByOrganizationId(organizationId)) {
983                            remove(orgLabor);
984                    }
985            }
986    
987            /**
988             * Removes all the org labors from the database.
989             *
990             * @throws SystemException if a system exception occurred
991             */
992            public void removeAll() throws SystemException {
993                    for (OrgLabor orgLabor : findAll()) {
994                            remove(orgLabor);
995                    }
996            }
997    
998            /**
999             * Returns the number of org labors where organizationId = &#63;.
1000             *
1001             * @param organizationId the organization ID
1002             * @return the number of matching org labors
1003             * @throws SystemException if a system exception occurred
1004             */
1005            public int countByOrganizationId(long organizationId)
1006                    throws SystemException {
1007                    Object[] finderArgs = new Object[] { organizationId };
1008    
1009                    Long count = (Long)FinderCacheUtil.getResult(FINDER_PATH_COUNT_BY_ORGANIZATIONID,
1010                                    finderArgs, this);
1011    
1012                    if (count == null) {
1013                            StringBundler query = new StringBundler(2);
1014    
1015                            query.append(_SQL_COUNT_ORGLABOR_WHERE);
1016    
1017                            query.append(_FINDER_COLUMN_ORGANIZATIONID_ORGANIZATIONID_2);
1018    
1019                            String sql = query.toString();
1020    
1021                            Session session = null;
1022    
1023                            try {
1024                                    session = openSession();
1025    
1026                                    Query q = session.createQuery(sql);
1027    
1028                                    QueryPos qPos = QueryPos.getInstance(q);
1029    
1030                                    qPos.add(organizationId);
1031    
1032                                    count = (Long)q.uniqueResult();
1033                            }
1034                            catch (Exception e) {
1035                                    throw processException(e);
1036                            }
1037                            finally {
1038                                    if (count == null) {
1039                                            count = Long.valueOf(0);
1040                                    }
1041    
1042                                    FinderCacheUtil.putResult(FINDER_PATH_COUNT_BY_ORGANIZATIONID,
1043                                            finderArgs, count);
1044    
1045                                    closeSession(session);
1046                            }
1047                    }
1048    
1049                    return count.intValue();
1050            }
1051    
1052            /**
1053             * Returns the number of org labors.
1054             *
1055             * @return the number of org labors
1056             * @throws SystemException if a system exception occurred
1057             */
1058            public int countAll() throws SystemException {
1059                    Long count = (Long)FinderCacheUtil.getResult(FINDER_PATH_COUNT_ALL,
1060                                    FINDER_ARGS_EMPTY, this);
1061    
1062                    if (count == null) {
1063                            Session session = null;
1064    
1065                            try {
1066                                    session = openSession();
1067    
1068                                    Query q = session.createQuery(_SQL_COUNT_ORGLABOR);
1069    
1070                                    count = (Long)q.uniqueResult();
1071                            }
1072                            catch (Exception e) {
1073                                    throw processException(e);
1074                            }
1075                            finally {
1076                                    if (count == null) {
1077                                            count = Long.valueOf(0);
1078                                    }
1079    
1080                                    FinderCacheUtil.putResult(FINDER_PATH_COUNT_ALL,
1081                                            FINDER_ARGS_EMPTY, count);
1082    
1083                                    closeSession(session);
1084                            }
1085                    }
1086    
1087                    return count.intValue();
1088            }
1089    
1090            /**
1091             * Initializes the org labor persistence.
1092             */
1093            public void afterPropertiesSet() {
1094                    String[] listenerClassNames = StringUtil.split(GetterUtil.getString(
1095                                            com.liferay.portal.util.PropsUtil.get(
1096                                                    "value.object.listener.com.liferay.portal.model.OrgLabor")));
1097    
1098                    if (listenerClassNames.length > 0) {
1099                            try {
1100                                    List<ModelListener<OrgLabor>> listenersList = new ArrayList<ModelListener<OrgLabor>>();
1101    
1102                                    for (String listenerClassName : listenerClassNames) {
1103                                            listenersList.add((ModelListener<OrgLabor>)InstanceFactory.newInstance(
1104                                                            listenerClassName));
1105                                    }
1106    
1107                                    listeners = listenersList.toArray(new ModelListener[listenersList.size()]);
1108                            }
1109                            catch (Exception e) {
1110                                    _log.error(e);
1111                            }
1112                    }
1113            }
1114    
1115            public void destroy() {
1116                    EntityCacheUtil.removeCache(OrgLaborImpl.class.getName());
1117                    FinderCacheUtil.removeCache(FINDER_CLASS_NAME_ENTITY);
1118                    FinderCacheUtil.removeCache(FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION);
1119            }
1120    
1121            @BeanReference(type = AccountPersistence.class)
1122            protected AccountPersistence accountPersistence;
1123            @BeanReference(type = AddressPersistence.class)
1124            protected AddressPersistence addressPersistence;
1125            @BeanReference(type = BrowserTrackerPersistence.class)
1126            protected BrowserTrackerPersistence browserTrackerPersistence;
1127            @BeanReference(type = ClassNamePersistence.class)
1128            protected ClassNamePersistence classNamePersistence;
1129            @BeanReference(type = ClusterGroupPersistence.class)
1130            protected ClusterGroupPersistence clusterGroupPersistence;
1131            @BeanReference(type = CompanyPersistence.class)
1132            protected CompanyPersistence companyPersistence;
1133            @BeanReference(type = ContactPersistence.class)
1134            protected ContactPersistence contactPersistence;
1135            @BeanReference(type = CountryPersistence.class)
1136            protected CountryPersistence countryPersistence;
1137            @BeanReference(type = EmailAddressPersistence.class)
1138            protected EmailAddressPersistence emailAddressPersistence;
1139            @BeanReference(type = GroupPersistence.class)
1140            protected GroupPersistence groupPersistence;
1141            @BeanReference(type = ImagePersistence.class)
1142            protected ImagePersistence imagePersistence;
1143            @BeanReference(type = LayoutPersistence.class)
1144            protected LayoutPersistence layoutPersistence;
1145            @BeanReference(type = LayoutBranchPersistence.class)
1146            protected LayoutBranchPersistence layoutBranchPersistence;
1147            @BeanReference(type = LayoutPrototypePersistence.class)
1148            protected LayoutPrototypePersistence layoutPrototypePersistence;
1149            @BeanReference(type = LayoutRevisionPersistence.class)
1150            protected LayoutRevisionPersistence layoutRevisionPersistence;
1151            @BeanReference(type = LayoutSetPersistence.class)
1152            protected LayoutSetPersistence layoutSetPersistence;
1153            @BeanReference(type = LayoutSetBranchPersistence.class)
1154            protected LayoutSetBranchPersistence layoutSetBranchPersistence;
1155            @BeanReference(type = LayoutSetPrototypePersistence.class)
1156            protected LayoutSetPrototypePersistence layoutSetPrototypePersistence;
1157            @BeanReference(type = ListTypePersistence.class)
1158            protected ListTypePersistence listTypePersistence;
1159            @BeanReference(type = LockPersistence.class)
1160            protected LockPersistence lockPersistence;
1161            @BeanReference(type = MembershipRequestPersistence.class)
1162            protected MembershipRequestPersistence membershipRequestPersistence;
1163            @BeanReference(type = OrganizationPersistence.class)
1164            protected OrganizationPersistence organizationPersistence;
1165            @BeanReference(type = OrgGroupRolePersistence.class)
1166            protected OrgGroupRolePersistence orgGroupRolePersistence;
1167            @BeanReference(type = OrgLaborPersistence.class)
1168            protected OrgLaborPersistence orgLaborPersistence;
1169            @BeanReference(type = PasswordPolicyPersistence.class)
1170            protected PasswordPolicyPersistence passwordPolicyPersistence;
1171            @BeanReference(type = PasswordPolicyRelPersistence.class)
1172            protected PasswordPolicyRelPersistence passwordPolicyRelPersistence;
1173            @BeanReference(type = PasswordTrackerPersistence.class)
1174            protected PasswordTrackerPersistence passwordTrackerPersistence;
1175            @BeanReference(type = PhonePersistence.class)
1176            protected PhonePersistence phonePersistence;
1177            @BeanReference(type = PluginSettingPersistence.class)
1178            protected PluginSettingPersistence pluginSettingPersistence;
1179            @BeanReference(type = PortalPreferencesPersistence.class)
1180            protected PortalPreferencesPersistence portalPreferencesPersistence;
1181            @BeanReference(type = PortletPersistence.class)
1182            protected PortletPersistence portletPersistence;
1183            @BeanReference(type = PortletItemPersistence.class)
1184            protected PortletItemPersistence portletItemPersistence;
1185            @BeanReference(type = PortletPreferencesPersistence.class)
1186            protected PortletPreferencesPersistence portletPreferencesPersistence;
1187            @BeanReference(type = RegionPersistence.class)
1188            protected RegionPersistence regionPersistence;
1189            @BeanReference(type = ReleasePersistence.class)
1190            protected ReleasePersistence releasePersistence;
1191            @BeanReference(type = RepositoryPersistence.class)
1192            protected RepositoryPersistence repositoryPersistence;
1193            @BeanReference(type = RepositoryEntryPersistence.class)
1194            protected RepositoryEntryPersistence repositoryEntryPersistence;
1195            @BeanReference(type = ResourceActionPersistence.class)
1196            protected ResourceActionPersistence resourceActionPersistence;
1197            @BeanReference(type = ResourceBlockPersistence.class)
1198            protected ResourceBlockPersistence resourceBlockPersistence;
1199            @BeanReference(type = ResourceBlockPermissionPersistence.class)
1200            protected ResourceBlockPermissionPersistence resourceBlockPermissionPersistence;
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    }