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