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