001    /**
002     * Copyright (c) 2000-2011 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.portlet.softwarecatalog.service.persistence;
016    
017    import com.liferay.portal.NoSuchModelException;
018    import com.liferay.portal.kernel.annotation.BeanReference;
019    import com.liferay.portal.kernel.cache.CacheRegistryUtil;
020    import com.liferay.portal.kernel.dao.jdbc.MappingSqlQuery;
021    import com.liferay.portal.kernel.dao.jdbc.MappingSqlQueryFactoryUtil;
022    import com.liferay.portal.kernel.dao.jdbc.RowMapper;
023    import com.liferay.portal.kernel.dao.jdbc.SqlUpdate;
024    import com.liferay.portal.kernel.dao.jdbc.SqlUpdateFactoryUtil;
025    import com.liferay.portal.kernel.dao.orm.EntityCacheUtil;
026    import com.liferay.portal.kernel.dao.orm.FinderCacheUtil;
027    import com.liferay.portal.kernel.dao.orm.FinderPath;
028    import com.liferay.portal.kernel.dao.orm.Query;
029    import com.liferay.portal.kernel.dao.orm.QueryPos;
030    import com.liferay.portal.kernel.dao.orm.QueryUtil;
031    import com.liferay.portal.kernel.dao.orm.SQLQuery;
032    import com.liferay.portal.kernel.dao.orm.Session;
033    import com.liferay.portal.kernel.exception.SystemException;
034    import com.liferay.portal.kernel.log.Log;
035    import com.liferay.portal.kernel.log.LogFactoryUtil;
036    import com.liferay.portal.kernel.util.GetterUtil;
037    import com.liferay.portal.kernel.util.InstanceFactory;
038    import com.liferay.portal.kernel.util.OrderByComparator;
039    import com.liferay.portal.kernel.util.SetUtil;
040    import com.liferay.portal.kernel.util.StringBundler;
041    import com.liferay.portal.kernel.util.StringPool;
042    import com.liferay.portal.kernel.util.StringUtil;
043    import com.liferay.portal.model.ModelListener;
044    import com.liferay.portal.security.permission.InlineSQLHelperUtil;
045    import com.liferay.portal.service.persistence.BatchSessionUtil;
046    import com.liferay.portal.service.persistence.ResourcePersistence;
047    import com.liferay.portal.service.persistence.UserPersistence;
048    import com.liferay.portal.service.persistence.impl.BasePersistenceImpl;
049    
050    import com.liferay.portlet.softwarecatalog.NoSuchFrameworkVersionException;
051    import com.liferay.portlet.softwarecatalog.model.SCFrameworkVersion;
052    import com.liferay.portlet.softwarecatalog.model.impl.SCFrameworkVersionImpl;
053    import com.liferay.portlet.softwarecatalog.model.impl.SCFrameworkVersionModelImpl;
054    
055    import java.io.Serializable;
056    
057    import java.util.ArrayList;
058    import java.util.Collections;
059    import java.util.List;
060    import java.util.Set;
061    
062    /**
063     * The persistence implementation for the s c framework version service.
064     *
065     * <p>
066     * Never modify or reference this class directly. Always use {@link SCFrameworkVersionUtil} to access the s c framework version persistence. Modify <code>service.xml</code> and rerun ServiceBuilder to regenerate this class.
067     * </p>
068     *
069     * <p>
070     * Caching information and settings can be found in <code>portal.properties</code>
071     * </p>
072     *
073     * @author Brian Wing Shun Chan
074     * @see SCFrameworkVersionPersistence
075     * @see SCFrameworkVersionUtil
076     * @generated
077     */
078    public class SCFrameworkVersionPersistenceImpl extends BasePersistenceImpl<SCFrameworkVersion>
079            implements SCFrameworkVersionPersistence {
080            public static final String FINDER_CLASS_NAME_ENTITY = SCFrameworkVersionImpl.class.getName();
081            public static final String FINDER_CLASS_NAME_LIST = FINDER_CLASS_NAME_ENTITY +
082                    ".List";
083            public static final FinderPath FINDER_PATH_FIND_BY_GROUPID = new FinderPath(SCFrameworkVersionModelImpl.ENTITY_CACHE_ENABLED,
084                            SCFrameworkVersionModelImpl.FINDER_CACHE_ENABLED,
085                            FINDER_CLASS_NAME_LIST, "findByGroupId",
086                            new String[] {
087                                    Long.class.getName(),
088                                    
089                            "java.lang.Integer", "java.lang.Integer",
090                                    "com.liferay.portal.kernel.util.OrderByComparator"
091                            });
092            public static final FinderPath FINDER_PATH_COUNT_BY_GROUPID = new FinderPath(SCFrameworkVersionModelImpl.ENTITY_CACHE_ENABLED,
093                            SCFrameworkVersionModelImpl.FINDER_CACHE_ENABLED,
094                            FINDER_CLASS_NAME_LIST, "countByGroupId",
095                            new String[] { Long.class.getName() });
096            public static final FinderPath FINDER_PATH_FIND_BY_COMPANYID = new FinderPath(SCFrameworkVersionModelImpl.ENTITY_CACHE_ENABLED,
097                            SCFrameworkVersionModelImpl.FINDER_CACHE_ENABLED,
098                            FINDER_CLASS_NAME_LIST, "findByCompanyId",
099                            new String[] {
100                                    Long.class.getName(),
101                                    
102                            "java.lang.Integer", "java.lang.Integer",
103                                    "com.liferay.portal.kernel.util.OrderByComparator"
104                            });
105            public static final FinderPath FINDER_PATH_COUNT_BY_COMPANYID = new FinderPath(SCFrameworkVersionModelImpl.ENTITY_CACHE_ENABLED,
106                            SCFrameworkVersionModelImpl.FINDER_CACHE_ENABLED,
107                            FINDER_CLASS_NAME_LIST, "countByCompanyId",
108                            new String[] { Long.class.getName() });
109            public static final FinderPath FINDER_PATH_FIND_BY_G_A = new FinderPath(SCFrameworkVersionModelImpl.ENTITY_CACHE_ENABLED,
110                            SCFrameworkVersionModelImpl.FINDER_CACHE_ENABLED,
111                            FINDER_CLASS_NAME_LIST, "findByG_A",
112                            new String[] {
113                                    Long.class.getName(), Boolean.class.getName(),
114                                    
115                            "java.lang.Integer", "java.lang.Integer",
116                                    "com.liferay.portal.kernel.util.OrderByComparator"
117                            });
118            public static final FinderPath FINDER_PATH_COUNT_BY_G_A = new FinderPath(SCFrameworkVersionModelImpl.ENTITY_CACHE_ENABLED,
119                            SCFrameworkVersionModelImpl.FINDER_CACHE_ENABLED,
120                            FINDER_CLASS_NAME_LIST, "countByG_A",
121                            new String[] { Long.class.getName(), Boolean.class.getName() });
122            public static final FinderPath FINDER_PATH_FIND_ALL = new FinderPath(SCFrameworkVersionModelImpl.ENTITY_CACHE_ENABLED,
123                            SCFrameworkVersionModelImpl.FINDER_CACHE_ENABLED,
124                            FINDER_CLASS_NAME_LIST, "findAll", new String[0]);
125            public static final FinderPath FINDER_PATH_COUNT_ALL = new FinderPath(SCFrameworkVersionModelImpl.ENTITY_CACHE_ENABLED,
126                            SCFrameworkVersionModelImpl.FINDER_CACHE_ENABLED,
127                            FINDER_CLASS_NAME_LIST, "countAll", new String[0]);
128    
129            /**
130             * Caches the s c framework version in the entity cache if it is enabled.
131             *
132             * @param scFrameworkVersion the s c framework version to cache
133             */
134            public void cacheResult(SCFrameworkVersion scFrameworkVersion) {
135                    EntityCacheUtil.putResult(SCFrameworkVersionModelImpl.ENTITY_CACHE_ENABLED,
136                            SCFrameworkVersionImpl.class, scFrameworkVersion.getPrimaryKey(),
137                            scFrameworkVersion);
138            }
139    
140            /**
141             * Caches the s c framework versions in the entity cache if it is enabled.
142             *
143             * @param scFrameworkVersions the s c framework versions to cache
144             */
145            public void cacheResult(List<SCFrameworkVersion> scFrameworkVersions) {
146                    for (SCFrameworkVersion scFrameworkVersion : scFrameworkVersions) {
147                            if (EntityCacheUtil.getResult(
148                                                    SCFrameworkVersionModelImpl.ENTITY_CACHE_ENABLED,
149                                                    SCFrameworkVersionImpl.class,
150                                                    scFrameworkVersion.getPrimaryKey(), this) == null) {
151                                    cacheResult(scFrameworkVersion);
152                            }
153                    }
154            }
155    
156            /**
157             * Clears the cache for all s c framework versions.
158             *
159             * <p>
160             * The {@link com.liferay.portal.kernel.dao.orm.EntityCache} and {@link com.liferay.portal.kernel.dao.orm.FinderCache} are both cleared by this method.
161             * </p>
162             */
163            public void clearCache() {
164                    CacheRegistryUtil.clear(SCFrameworkVersionImpl.class.getName());
165                    EntityCacheUtil.clearCache(SCFrameworkVersionImpl.class.getName());
166                    FinderCacheUtil.clearCache(FINDER_CLASS_NAME_ENTITY);
167                    FinderCacheUtil.clearCache(FINDER_CLASS_NAME_LIST);
168            }
169    
170            /**
171             * Clears the cache for the s c framework version.
172             *
173             * <p>
174             * The {@link com.liferay.portal.kernel.dao.orm.EntityCache} and {@link com.liferay.portal.kernel.dao.orm.FinderCache} are both cleared by this method.
175             * </p>
176             */
177            public void clearCache(SCFrameworkVersion scFrameworkVersion) {
178                    EntityCacheUtil.removeResult(SCFrameworkVersionModelImpl.ENTITY_CACHE_ENABLED,
179                            SCFrameworkVersionImpl.class, scFrameworkVersion.getPrimaryKey());
180            }
181    
182            /**
183             * Creates a new s c framework version with the primary key. Does not add the s c framework version to the database.
184             *
185             * @param frameworkVersionId the primary key for the new s c framework version
186             * @return the new s c framework version
187             */
188            public SCFrameworkVersion create(long frameworkVersionId) {
189                    SCFrameworkVersion scFrameworkVersion = new SCFrameworkVersionImpl();
190    
191                    scFrameworkVersion.setNew(true);
192                    scFrameworkVersion.setPrimaryKey(frameworkVersionId);
193    
194                    return scFrameworkVersion;
195            }
196    
197            /**
198             * Removes the s c framework version with the primary key from the database. Also notifies the appropriate model listeners.
199             *
200             * @param primaryKey the primary key of the s c framework version to remove
201             * @return the s c framework version that was removed
202             * @throws com.liferay.portal.NoSuchModelException if a s c framework version with the primary key could not be found
203             * @throws SystemException if a system exception occurred
204             */
205            public SCFrameworkVersion remove(Serializable primaryKey)
206                    throws NoSuchModelException, SystemException {
207                    return remove(((Long)primaryKey).longValue());
208            }
209    
210            /**
211             * Removes the s c framework version with the primary key from the database. Also notifies the appropriate model listeners.
212             *
213             * @param frameworkVersionId the primary key of the s c framework version to remove
214             * @return the s c framework version that was removed
215             * @throws com.liferay.portlet.softwarecatalog.NoSuchFrameworkVersionException if a s c framework version with the primary key could not be found
216             * @throws SystemException if a system exception occurred
217             */
218            public SCFrameworkVersion remove(long frameworkVersionId)
219                    throws NoSuchFrameworkVersionException, SystemException {
220                    Session session = null;
221    
222                    try {
223                            session = openSession();
224    
225                            SCFrameworkVersion scFrameworkVersion = (SCFrameworkVersion)session.get(SCFrameworkVersionImpl.class,
226                                            new Long(frameworkVersionId));
227    
228                            if (scFrameworkVersion == null) {
229                                    if (_log.isWarnEnabled()) {
230                                            _log.warn(_NO_SUCH_ENTITY_WITH_PRIMARY_KEY +
231                                                    frameworkVersionId);
232                                    }
233    
234                                    throw new NoSuchFrameworkVersionException(_NO_SUCH_ENTITY_WITH_PRIMARY_KEY +
235                                            frameworkVersionId);
236                            }
237    
238                            return remove(scFrameworkVersion);
239                    }
240                    catch (NoSuchFrameworkVersionException nsee) {
241                            throw nsee;
242                    }
243                    catch (Exception e) {
244                            throw processException(e);
245                    }
246                    finally {
247                            closeSession(session);
248                    }
249            }
250    
251            protected SCFrameworkVersion removeImpl(
252                    SCFrameworkVersion scFrameworkVersion) throws SystemException {
253                    scFrameworkVersion = toUnwrappedModel(scFrameworkVersion);
254    
255                    try {
256                            clearSCProductVersions.clear(scFrameworkVersion.getPrimaryKey());
257                    }
258                    catch (Exception e) {
259                            throw processException(e);
260                    }
261                    finally {
262                            FinderCacheUtil.clearCache(SCFrameworkVersionModelImpl.MAPPING_TABLE_SCFRAMEWORKVERSI_SCPRODUCTVERS_NAME);
263                    }
264    
265                    Session session = null;
266    
267                    try {
268                            session = openSession();
269    
270                            BatchSessionUtil.delete(session, scFrameworkVersion);
271                    }
272                    catch (Exception e) {
273                            throw processException(e);
274                    }
275                    finally {
276                            closeSession(session);
277                    }
278    
279                    FinderCacheUtil.clearCache(FINDER_CLASS_NAME_LIST);
280    
281                    EntityCacheUtil.removeResult(SCFrameworkVersionModelImpl.ENTITY_CACHE_ENABLED,
282                            SCFrameworkVersionImpl.class, scFrameworkVersion.getPrimaryKey());
283    
284                    return scFrameworkVersion;
285            }
286    
287            public SCFrameworkVersion updateImpl(
288                    com.liferay.portlet.softwarecatalog.model.SCFrameworkVersion scFrameworkVersion,
289                    boolean merge) throws SystemException {
290                    scFrameworkVersion = toUnwrappedModel(scFrameworkVersion);
291    
292                    Session session = null;
293    
294                    try {
295                            session = openSession();
296    
297                            BatchSessionUtil.update(session, scFrameworkVersion, merge);
298    
299                            scFrameworkVersion.setNew(false);
300                    }
301                    catch (Exception e) {
302                            throw processException(e);
303                    }
304                    finally {
305                            closeSession(session);
306                    }
307    
308                    FinderCacheUtil.clearCache(FINDER_CLASS_NAME_LIST);
309    
310                    EntityCacheUtil.putResult(SCFrameworkVersionModelImpl.ENTITY_CACHE_ENABLED,
311                            SCFrameworkVersionImpl.class, scFrameworkVersion.getPrimaryKey(),
312                            scFrameworkVersion);
313    
314                    return scFrameworkVersion;
315            }
316    
317            protected SCFrameworkVersion toUnwrappedModel(
318                    SCFrameworkVersion scFrameworkVersion) {
319                    if (scFrameworkVersion instanceof SCFrameworkVersionImpl) {
320                            return scFrameworkVersion;
321                    }
322    
323                    SCFrameworkVersionImpl scFrameworkVersionImpl = new SCFrameworkVersionImpl();
324    
325                    scFrameworkVersionImpl.setNew(scFrameworkVersion.isNew());
326                    scFrameworkVersionImpl.setPrimaryKey(scFrameworkVersion.getPrimaryKey());
327    
328                    scFrameworkVersionImpl.setFrameworkVersionId(scFrameworkVersion.getFrameworkVersionId());
329                    scFrameworkVersionImpl.setGroupId(scFrameworkVersion.getGroupId());
330                    scFrameworkVersionImpl.setCompanyId(scFrameworkVersion.getCompanyId());
331                    scFrameworkVersionImpl.setUserId(scFrameworkVersion.getUserId());
332                    scFrameworkVersionImpl.setUserName(scFrameworkVersion.getUserName());
333                    scFrameworkVersionImpl.setCreateDate(scFrameworkVersion.getCreateDate());
334                    scFrameworkVersionImpl.setModifiedDate(scFrameworkVersion.getModifiedDate());
335                    scFrameworkVersionImpl.setName(scFrameworkVersion.getName());
336                    scFrameworkVersionImpl.setUrl(scFrameworkVersion.getUrl());
337                    scFrameworkVersionImpl.setActive(scFrameworkVersion.isActive());
338                    scFrameworkVersionImpl.setPriority(scFrameworkVersion.getPriority());
339    
340                    return scFrameworkVersionImpl;
341            }
342    
343            /**
344             * Finds the s c framework version with the primary key or throws a {@link com.liferay.portal.NoSuchModelException} if it could not be found.
345             *
346             * @param primaryKey the primary key of the s c framework version to find
347             * @return the s c framework version
348             * @throws com.liferay.portal.NoSuchModelException if a s c framework version with the primary key could not be found
349             * @throws SystemException if a system exception occurred
350             */
351            public SCFrameworkVersion findByPrimaryKey(Serializable primaryKey)
352                    throws NoSuchModelException, SystemException {
353                    return findByPrimaryKey(((Long)primaryKey).longValue());
354            }
355    
356            /**
357             * Finds the s c framework version with the primary key or throws a {@link com.liferay.portlet.softwarecatalog.NoSuchFrameworkVersionException} if it could not be found.
358             *
359             * @param frameworkVersionId the primary key of the s c framework version to find
360             * @return the s c framework version
361             * @throws com.liferay.portlet.softwarecatalog.NoSuchFrameworkVersionException if a s c framework version with the primary key could not be found
362             * @throws SystemException if a system exception occurred
363             */
364            public SCFrameworkVersion findByPrimaryKey(long frameworkVersionId)
365                    throws NoSuchFrameworkVersionException, SystemException {
366                    SCFrameworkVersion scFrameworkVersion = fetchByPrimaryKey(frameworkVersionId);
367    
368                    if (scFrameworkVersion == null) {
369                            if (_log.isWarnEnabled()) {
370                                    _log.warn(_NO_SUCH_ENTITY_WITH_PRIMARY_KEY +
371                                            frameworkVersionId);
372                            }
373    
374                            throw new NoSuchFrameworkVersionException(_NO_SUCH_ENTITY_WITH_PRIMARY_KEY +
375                                    frameworkVersionId);
376                    }
377    
378                    return scFrameworkVersion;
379            }
380    
381            /**
382             * Finds the s c framework version with the primary key or returns <code>null</code> if it could not be found.
383             *
384             * @param primaryKey the primary key of the s c framework version to find
385             * @return the s c framework version, or <code>null</code> if a s c framework version with the primary key could not be found
386             * @throws SystemException if a system exception occurred
387             */
388            public SCFrameworkVersion fetchByPrimaryKey(Serializable primaryKey)
389                    throws SystemException {
390                    return fetchByPrimaryKey(((Long)primaryKey).longValue());
391            }
392    
393            /**
394             * Finds the s c framework version with the primary key or returns <code>null</code> if it could not be found.
395             *
396             * @param frameworkVersionId the primary key of the s c framework version to find
397             * @return the s c framework version, or <code>null</code> if a s c framework version with the primary key could not be found
398             * @throws SystemException if a system exception occurred
399             */
400            public SCFrameworkVersion fetchByPrimaryKey(long frameworkVersionId)
401                    throws SystemException {
402                    SCFrameworkVersion scFrameworkVersion = (SCFrameworkVersion)EntityCacheUtil.getResult(SCFrameworkVersionModelImpl.ENTITY_CACHE_ENABLED,
403                                    SCFrameworkVersionImpl.class, frameworkVersionId, this);
404    
405                    if (scFrameworkVersion == null) {
406                            Session session = null;
407    
408                            try {
409                                    session = openSession();
410    
411                                    scFrameworkVersion = (SCFrameworkVersion)session.get(SCFrameworkVersionImpl.class,
412                                                    new Long(frameworkVersionId));
413                            }
414                            catch (Exception e) {
415                                    throw processException(e);
416                            }
417                            finally {
418                                    if (scFrameworkVersion != null) {
419                                            cacheResult(scFrameworkVersion);
420                                    }
421    
422                                    closeSession(session);
423                            }
424                    }
425    
426                    return scFrameworkVersion;
427            }
428    
429            /**
430             * Finds all the s c framework versions where groupId = &#63;.
431             *
432             * @param groupId the group id to search with
433             * @return the matching s c framework versions
434             * @throws SystemException if a system exception occurred
435             */
436            public List<SCFrameworkVersion> findByGroupId(long groupId)
437                    throws SystemException {
438                    return findByGroupId(groupId, QueryUtil.ALL_POS, QueryUtil.ALL_POS, null);
439            }
440    
441            /**
442             * Finds a range of all the s c framework versions where groupId = &#63;.
443             *
444             * <p>
445             * 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.
446             * </p>
447             *
448             * @param groupId the group id to search with
449             * @param start the lower bound of the range of s c framework versions to return
450             * @param end the upper bound of the range of s c framework versions to return (not inclusive)
451             * @return the range of matching s c framework versions
452             * @throws SystemException if a system exception occurred
453             */
454            public List<SCFrameworkVersion> findByGroupId(long groupId, int start,
455                    int end) throws SystemException {
456                    return findByGroupId(groupId, start, end, null);
457            }
458    
459            /**
460             * Finds an ordered range of all the s c framework versions where groupId = &#63;.
461             *
462             * <p>
463             * 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.
464             * </p>
465             *
466             * @param groupId the group id to search with
467             * @param start the lower bound of the range of s c framework versions to return
468             * @param end the upper bound of the range of s c framework versions to return (not inclusive)
469             * @param orderByComparator the comparator to order the results by
470             * @return the ordered range of matching s c framework versions
471             * @throws SystemException if a system exception occurred
472             */
473            public List<SCFrameworkVersion> findByGroupId(long groupId, int start,
474                    int end, OrderByComparator orderByComparator) throws SystemException {
475                    Object[] finderArgs = new Object[] {
476                                    groupId,
477                                    
478                                    String.valueOf(start), String.valueOf(end),
479                                    String.valueOf(orderByComparator)
480                            };
481    
482                    List<SCFrameworkVersion> list = (List<SCFrameworkVersion>)FinderCacheUtil.getResult(FINDER_PATH_FIND_BY_GROUPID,
483                                    finderArgs, this);
484    
485                    if (list == null) {
486                            StringBundler query = null;
487    
488                            if (orderByComparator != null) {
489                                    query = new StringBundler(3 +
490                                                    (orderByComparator.getOrderByFields().length * 3));
491                            }
492                            else {
493                                    query = new StringBundler(3);
494                            }
495    
496                            query.append(_SQL_SELECT_SCFRAMEWORKVERSION_WHERE);
497    
498                            query.append(_FINDER_COLUMN_GROUPID_GROUPID_2);
499    
500                            if (orderByComparator != null) {
501                                    appendOrderByComparator(query, _ORDER_BY_ENTITY_ALIAS,
502                                            orderByComparator);
503                            }
504    
505                            else {
506                                    query.append(SCFrameworkVersionModelImpl.ORDER_BY_JPQL);
507                            }
508    
509                            String sql = query.toString();
510    
511                            Session session = null;
512    
513                            try {
514                                    session = openSession();
515    
516                                    Query q = session.createQuery(sql);
517    
518                                    QueryPos qPos = QueryPos.getInstance(q);
519    
520                                    qPos.add(groupId);
521    
522                                    list = (List<SCFrameworkVersion>)QueryUtil.list(q,
523                                                    getDialect(), start, end);
524                            }
525                            catch (Exception e) {
526                                    throw processException(e);
527                            }
528                            finally {
529                                    if (list == null) {
530                                            FinderCacheUtil.removeResult(FINDER_PATH_FIND_BY_GROUPID,
531                                                    finderArgs);
532                                    }
533                                    else {
534                                            cacheResult(list);
535    
536                                            FinderCacheUtil.putResult(FINDER_PATH_FIND_BY_GROUPID,
537                                                    finderArgs, list);
538                                    }
539    
540                                    closeSession(session);
541                            }
542                    }
543    
544                    return list;
545            }
546    
547            /**
548             * Finds the first s c framework version in the ordered set where groupId = &#63;.
549             *
550             * <p>
551             * 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.
552             * </p>
553             *
554             * @param groupId the group id to search with
555             * @param orderByComparator the comparator to order the set by
556             * @return the first matching s c framework version
557             * @throws com.liferay.portlet.softwarecatalog.NoSuchFrameworkVersionException if a matching s c framework version could not be found
558             * @throws SystemException if a system exception occurred
559             */
560            public SCFrameworkVersion findByGroupId_First(long groupId,
561                    OrderByComparator orderByComparator)
562                    throws NoSuchFrameworkVersionException, SystemException {
563                    List<SCFrameworkVersion> list = findByGroupId(groupId, 0, 1,
564                                    orderByComparator);
565    
566                    if (list.isEmpty()) {
567                            StringBundler msg = new StringBundler(4);
568    
569                            msg.append(_NO_SUCH_ENTITY_WITH_KEY);
570    
571                            msg.append("groupId=");
572                            msg.append(groupId);
573    
574                            msg.append(StringPool.CLOSE_CURLY_BRACE);
575    
576                            throw new NoSuchFrameworkVersionException(msg.toString());
577                    }
578                    else {
579                            return list.get(0);
580                    }
581            }
582    
583            /**
584             * Finds the last s c framework version in the ordered set where groupId = &#63;.
585             *
586             * <p>
587             * 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.
588             * </p>
589             *
590             * @param groupId the group id to search with
591             * @param orderByComparator the comparator to order the set by
592             * @return the last matching s c framework version
593             * @throws com.liferay.portlet.softwarecatalog.NoSuchFrameworkVersionException if a matching s c framework version could not be found
594             * @throws SystemException if a system exception occurred
595             */
596            public SCFrameworkVersion findByGroupId_Last(long groupId,
597                    OrderByComparator orderByComparator)
598                    throws NoSuchFrameworkVersionException, SystemException {
599                    int count = countByGroupId(groupId);
600    
601                    List<SCFrameworkVersion> list = findByGroupId(groupId, count - 1,
602                                    count, orderByComparator);
603    
604                    if (list.isEmpty()) {
605                            StringBundler msg = new StringBundler(4);
606    
607                            msg.append(_NO_SUCH_ENTITY_WITH_KEY);
608    
609                            msg.append("groupId=");
610                            msg.append(groupId);
611    
612                            msg.append(StringPool.CLOSE_CURLY_BRACE);
613    
614                            throw new NoSuchFrameworkVersionException(msg.toString());
615                    }
616                    else {
617                            return list.get(0);
618                    }
619            }
620    
621            /**
622             * Finds the s c framework versions before and after the current s c framework version in the ordered set where groupId = &#63;.
623             *
624             * <p>
625             * 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.
626             * </p>
627             *
628             * @param frameworkVersionId the primary key of the current s c framework version
629             * @param groupId the group id to search with
630             * @param orderByComparator the comparator to order the set by
631             * @return the previous, current, and next s c framework version
632             * @throws com.liferay.portlet.softwarecatalog.NoSuchFrameworkVersionException if a s c framework version with the primary key could not be found
633             * @throws SystemException if a system exception occurred
634             */
635            public SCFrameworkVersion[] findByGroupId_PrevAndNext(
636                    long frameworkVersionId, long groupId,
637                    OrderByComparator orderByComparator)
638                    throws NoSuchFrameworkVersionException, SystemException {
639                    SCFrameworkVersion scFrameworkVersion = findByPrimaryKey(frameworkVersionId);
640    
641                    Session session = null;
642    
643                    try {
644                            session = openSession();
645    
646                            SCFrameworkVersion[] array = new SCFrameworkVersionImpl[3];
647    
648                            array[0] = getByGroupId_PrevAndNext(session, scFrameworkVersion,
649                                            groupId, orderByComparator, true);
650    
651                            array[1] = scFrameworkVersion;
652    
653                            array[2] = getByGroupId_PrevAndNext(session, scFrameworkVersion,
654                                            groupId, orderByComparator, false);
655    
656                            return array;
657                    }
658                    catch (Exception e) {
659                            throw processException(e);
660                    }
661                    finally {
662                            closeSession(session);
663                    }
664            }
665    
666            protected SCFrameworkVersion getByGroupId_PrevAndNext(Session session,
667                    SCFrameworkVersion scFrameworkVersion, long groupId,
668                    OrderByComparator orderByComparator, boolean previous) {
669                    StringBundler query = null;
670    
671                    if (orderByComparator != null) {
672                            query = new StringBundler(6 +
673                                            (orderByComparator.getOrderByFields().length * 6));
674                    }
675                    else {
676                            query = new StringBundler(3);
677                    }
678    
679                    query.append(_SQL_SELECT_SCFRAMEWORKVERSION_WHERE);
680    
681                    query.append(_FINDER_COLUMN_GROUPID_GROUPID_2);
682    
683                    if (orderByComparator != null) {
684                            String[] orderByFields = orderByComparator.getOrderByFields();
685    
686                            if (orderByFields.length > 0) {
687                                    query.append(WHERE_AND);
688                            }
689    
690                            for (int i = 0; i < orderByFields.length; i++) {
691                                    query.append(_ORDER_BY_ENTITY_ALIAS);
692                                    query.append(orderByFields[i]);
693    
694                                    if ((i + 1) < orderByFields.length) {
695                                            if (orderByComparator.isAscending() ^ previous) {
696                                                    query.append(WHERE_GREATER_THAN_HAS_NEXT);
697                                            }
698                                            else {
699                                                    query.append(WHERE_LESSER_THAN_HAS_NEXT);
700                                            }
701                                    }
702                                    else {
703                                            if (orderByComparator.isAscending() ^ previous) {
704                                                    query.append(WHERE_GREATER_THAN);
705                                            }
706                                            else {
707                                                    query.append(WHERE_LESSER_THAN);
708                                            }
709                                    }
710                            }
711    
712                            query.append(ORDER_BY_CLAUSE);
713    
714                            for (int i = 0; i < orderByFields.length; i++) {
715                                    query.append(_ORDER_BY_ENTITY_ALIAS);
716                                    query.append(orderByFields[i]);
717    
718                                    if ((i + 1) < orderByFields.length) {
719                                            if (orderByComparator.isAscending() ^ previous) {
720                                                    query.append(ORDER_BY_ASC_HAS_NEXT);
721                                            }
722                                            else {
723                                                    query.append(ORDER_BY_DESC_HAS_NEXT);
724                                            }
725                                    }
726                                    else {
727                                            if (orderByComparator.isAscending() ^ previous) {
728                                                    query.append(ORDER_BY_ASC);
729                                            }
730                                            else {
731                                                    query.append(ORDER_BY_DESC);
732                                            }
733                                    }
734                            }
735                    }
736    
737                    else {
738                            query.append(SCFrameworkVersionModelImpl.ORDER_BY_JPQL);
739                    }
740    
741                    String sql = query.toString();
742    
743                    Query q = session.createQuery(sql);
744    
745                    q.setFirstResult(0);
746                    q.setMaxResults(2);
747    
748                    QueryPos qPos = QueryPos.getInstance(q);
749    
750                    qPos.add(groupId);
751    
752                    if (orderByComparator != null) {
753                            Object[] values = orderByComparator.getOrderByValues(scFrameworkVersion);
754    
755                            for (Object value : values) {
756                                    qPos.add(value);
757                            }
758                    }
759    
760                    List<SCFrameworkVersion> list = q.list();
761    
762                    if (list.size() == 2) {
763                            return list.get(1);
764                    }
765                    else {
766                            return null;
767                    }
768            }
769    
770            /**
771             * Filters by the user's permissions and finds all the s c framework versions where groupId = &#63;.
772             *
773             * @param groupId the group id to search with
774             * @return the matching s c framework versions that the user has permission to view
775             * @throws SystemException if a system exception occurred
776             */
777            public List<SCFrameworkVersion> filterFindByGroupId(long groupId)
778                    throws SystemException {
779                    return filterFindByGroupId(groupId, QueryUtil.ALL_POS,
780                            QueryUtil.ALL_POS, null);
781            }
782    
783            /**
784             * Filters by the user's permissions and finds a range of all the s c framework versions where groupId = &#63;.
785             *
786             * <p>
787             * 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.
788             * </p>
789             *
790             * @param groupId the group id to search with
791             * @param start the lower bound of the range of s c framework versions to return
792             * @param end the upper bound of the range of s c framework versions to return (not inclusive)
793             * @return the range of matching s c framework versions that the user has permission to view
794             * @throws SystemException if a system exception occurred
795             */
796            public List<SCFrameworkVersion> filterFindByGroupId(long groupId,
797                    int start, int end) throws SystemException {
798                    return filterFindByGroupId(groupId, start, end, null);
799            }
800    
801            /**
802             * Filters by the user's permissions and finds an ordered range of all the s c framework versions where groupId = &#63;.
803             *
804             * <p>
805             * 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.
806             * </p>
807             *
808             * @param groupId the group id to search with
809             * @param start the lower bound of the range of s c framework versions to return
810             * @param end the upper bound of the range of s c framework versions to return (not inclusive)
811             * @param orderByComparator the comparator to order the results by
812             * @return the ordered range of matching s c framework versions that the user has permission to view
813             * @throws SystemException if a system exception occurred
814             */
815            public List<SCFrameworkVersion> filterFindByGroupId(long groupId,
816                    int start, int end, OrderByComparator orderByComparator)
817                    throws SystemException {
818                    if (!InlineSQLHelperUtil.isEnabled(groupId)) {
819                            return findByGroupId(groupId, start, end, orderByComparator);
820                    }
821    
822                    StringBundler query = null;
823    
824                    if (orderByComparator != null) {
825                            query = new StringBundler(3 +
826                                            (orderByComparator.getOrderByFields().length * 3));
827                    }
828                    else {
829                            query = new StringBundler(3);
830                    }
831    
832                    if (getDB().isSupportsInlineDistinct()) {
833                            query.append(_FILTER_SQL_SELECT_SCFRAMEWORKVERSION_WHERE);
834                    }
835                    else {
836                            query.append(_FILTER_SQL_SELECT_SCFRAMEWORKVERSION_NO_INLINE_DISTINCT_WHERE_1);
837                    }
838    
839                    query.append(_FINDER_COLUMN_GROUPID_GROUPID_2);
840    
841                    if (!getDB().isSupportsInlineDistinct()) {
842                            query.append(_FILTER_SQL_SELECT_SCFRAMEWORKVERSION_NO_INLINE_DISTINCT_WHERE_2);
843                    }
844    
845                    if (orderByComparator != null) {
846                            if (getDB().isSupportsInlineDistinct()) {
847                                    appendOrderByComparator(query, _ORDER_BY_ENTITY_ALIAS,
848                                            orderByComparator);
849                            }
850                            else {
851                                    appendOrderByComparator(query, _ORDER_BY_ENTITY_TABLE,
852                                            orderByComparator);
853                            }
854                    }
855    
856                    else {
857                            if (getDB().isSupportsInlineDistinct()) {
858                                    query.append(SCFrameworkVersionModelImpl.ORDER_BY_JPQL);
859                            }
860                            else {
861                                    query.append(SCFrameworkVersionModelImpl.ORDER_BY_SQL);
862                            }
863                    }
864    
865                    String sql = InlineSQLHelperUtil.replacePermissionCheck(query.toString(),
866                                    SCFrameworkVersion.class.getName(), _FILTER_COLUMN_PK,
867                                    _FILTER_COLUMN_USERID, groupId);
868    
869                    Session session = null;
870    
871                    try {
872                            session = openSession();
873    
874                            SQLQuery q = session.createSQLQuery(sql);
875    
876                            if (getDB().isSupportsInlineDistinct()) {
877                                    q.addEntity(_FILTER_ENTITY_ALIAS, SCFrameworkVersionImpl.class);
878                            }
879                            else {
880                                    q.addEntity(_FILTER_ENTITY_TABLE, SCFrameworkVersionImpl.class);
881                            }
882    
883                            QueryPos qPos = QueryPos.getInstance(q);
884    
885                            qPos.add(groupId);
886    
887                            return (List<SCFrameworkVersion>)QueryUtil.list(q, getDialect(),
888                                    start, end);
889                    }
890                    catch (Exception e) {
891                            throw processException(e);
892                    }
893                    finally {
894                            closeSession(session);
895                    }
896            }
897    
898            /**
899             * Finds all the s c framework versions where companyId = &#63;.
900             *
901             * @param companyId the company id to search with
902             * @return the matching s c framework versions
903             * @throws SystemException if a system exception occurred
904             */
905            public List<SCFrameworkVersion> findByCompanyId(long companyId)
906                    throws SystemException {
907                    return findByCompanyId(companyId, QueryUtil.ALL_POS, QueryUtil.ALL_POS,
908                            null);
909            }
910    
911            /**
912             * Finds a range of all the s c framework versions where companyId = &#63;.
913             *
914             * <p>
915             * 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.
916             * </p>
917             *
918             * @param companyId the company id to search with
919             * @param start the lower bound of the range of s c framework versions to return
920             * @param end the upper bound of the range of s c framework versions to return (not inclusive)
921             * @return the range of matching s c framework versions
922             * @throws SystemException if a system exception occurred
923             */
924            public List<SCFrameworkVersion> findByCompanyId(long companyId, int start,
925                    int end) throws SystemException {
926                    return findByCompanyId(companyId, start, end, null);
927            }
928    
929            /**
930             * Finds an ordered range of all the s c framework versions where companyId = &#63;.
931             *
932             * <p>
933             * 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.
934             * </p>
935             *
936             * @param companyId the company id to search with
937             * @param start the lower bound of the range of s c framework versions to return
938             * @param end the upper bound of the range of s c framework versions to return (not inclusive)
939             * @param orderByComparator the comparator to order the results by
940             * @return the ordered range of matching s c framework versions
941             * @throws SystemException if a system exception occurred
942             */
943            public List<SCFrameworkVersion> findByCompanyId(long companyId, int start,
944                    int end, OrderByComparator orderByComparator) throws SystemException {
945                    Object[] finderArgs = new Object[] {
946                                    companyId,
947                                    
948                                    String.valueOf(start), String.valueOf(end),
949                                    String.valueOf(orderByComparator)
950                            };
951    
952                    List<SCFrameworkVersion> list = (List<SCFrameworkVersion>)FinderCacheUtil.getResult(FINDER_PATH_FIND_BY_COMPANYID,
953                                    finderArgs, this);
954    
955                    if (list == null) {
956                            StringBundler query = null;
957    
958                            if (orderByComparator != null) {
959                                    query = new StringBundler(3 +
960                                                    (orderByComparator.getOrderByFields().length * 3));
961                            }
962                            else {
963                                    query = new StringBundler(3);
964                            }
965    
966                            query.append(_SQL_SELECT_SCFRAMEWORKVERSION_WHERE);
967    
968                            query.append(_FINDER_COLUMN_COMPANYID_COMPANYID_2);
969    
970                            if (orderByComparator != null) {
971                                    appendOrderByComparator(query, _ORDER_BY_ENTITY_ALIAS,
972                                            orderByComparator);
973                            }
974    
975                            else {
976                                    query.append(SCFrameworkVersionModelImpl.ORDER_BY_JPQL);
977                            }
978    
979                            String sql = query.toString();
980    
981                            Session session = null;
982    
983                            try {
984                                    session = openSession();
985    
986                                    Query q = session.createQuery(sql);
987    
988                                    QueryPos qPos = QueryPos.getInstance(q);
989    
990                                    qPos.add(companyId);
991    
992                                    list = (List<SCFrameworkVersion>)QueryUtil.list(q,
993                                                    getDialect(), start, end);
994                            }
995                            catch (Exception e) {
996                                    throw processException(e);
997                            }
998                            finally {
999                                    if (list == null) {
1000                                            FinderCacheUtil.removeResult(FINDER_PATH_FIND_BY_COMPANYID,
1001                                                    finderArgs);
1002                                    }
1003                                    else {
1004                                            cacheResult(list);
1005    
1006                                            FinderCacheUtil.putResult(FINDER_PATH_FIND_BY_COMPANYID,
1007                                                    finderArgs, list);
1008                                    }
1009    
1010                                    closeSession(session);
1011                            }
1012                    }
1013    
1014                    return list;
1015            }
1016    
1017            /**
1018             * Finds the first s c framework version in the ordered set where companyId = &#63;.
1019             *
1020             * <p>
1021             * 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.
1022             * </p>
1023             *
1024             * @param companyId the company id to search with
1025             * @param orderByComparator the comparator to order the set by
1026             * @return the first matching s c framework version
1027             * @throws com.liferay.portlet.softwarecatalog.NoSuchFrameworkVersionException if a matching s c framework version could not be found
1028             * @throws SystemException if a system exception occurred
1029             */
1030            public SCFrameworkVersion findByCompanyId_First(long companyId,
1031                    OrderByComparator orderByComparator)
1032                    throws NoSuchFrameworkVersionException, SystemException {
1033                    List<SCFrameworkVersion> list = findByCompanyId(companyId, 0, 1,
1034                                    orderByComparator);
1035    
1036                    if (list.isEmpty()) {
1037                            StringBundler msg = new StringBundler(4);
1038    
1039                            msg.append(_NO_SUCH_ENTITY_WITH_KEY);
1040    
1041                            msg.append("companyId=");
1042                            msg.append(companyId);
1043    
1044                            msg.append(StringPool.CLOSE_CURLY_BRACE);
1045    
1046                            throw new NoSuchFrameworkVersionException(msg.toString());
1047                    }
1048                    else {
1049                            return list.get(0);
1050                    }
1051            }
1052    
1053            /**
1054             * Finds the last s c framework version in the ordered set where companyId = &#63;.
1055             *
1056             * <p>
1057             * 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.
1058             * </p>
1059             *
1060             * @param companyId the company id to search with
1061             * @param orderByComparator the comparator to order the set by
1062             * @return the last matching s c framework version
1063             * @throws com.liferay.portlet.softwarecatalog.NoSuchFrameworkVersionException if a matching s c framework version could not be found
1064             * @throws SystemException if a system exception occurred
1065             */
1066            public SCFrameworkVersion findByCompanyId_Last(long companyId,
1067                    OrderByComparator orderByComparator)
1068                    throws NoSuchFrameworkVersionException, SystemException {
1069                    int count = countByCompanyId(companyId);
1070    
1071                    List<SCFrameworkVersion> list = findByCompanyId(companyId, count - 1,
1072                                    count, orderByComparator);
1073    
1074                    if (list.isEmpty()) {
1075                            StringBundler msg = new StringBundler(4);
1076    
1077                            msg.append(_NO_SUCH_ENTITY_WITH_KEY);
1078    
1079                            msg.append("companyId=");
1080                            msg.append(companyId);
1081    
1082                            msg.append(StringPool.CLOSE_CURLY_BRACE);
1083    
1084                            throw new NoSuchFrameworkVersionException(msg.toString());
1085                    }
1086                    else {
1087                            return list.get(0);
1088                    }
1089            }
1090    
1091            /**
1092             * Finds the s c framework versions before and after the current s c framework version in the ordered set where companyId = &#63;.
1093             *
1094             * <p>
1095             * 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.
1096             * </p>
1097             *
1098             * @param frameworkVersionId the primary key of the current s c framework version
1099             * @param companyId the company id to search with
1100             * @param orderByComparator the comparator to order the set by
1101             * @return the previous, current, and next s c framework version
1102             * @throws com.liferay.portlet.softwarecatalog.NoSuchFrameworkVersionException if a s c framework version with the primary key could not be found
1103             * @throws SystemException if a system exception occurred
1104             */
1105            public SCFrameworkVersion[] findByCompanyId_PrevAndNext(
1106                    long frameworkVersionId, long companyId,
1107                    OrderByComparator orderByComparator)
1108                    throws NoSuchFrameworkVersionException, SystemException {
1109                    SCFrameworkVersion scFrameworkVersion = findByPrimaryKey(frameworkVersionId);
1110    
1111                    Session session = null;
1112    
1113                    try {
1114                            session = openSession();
1115    
1116                            SCFrameworkVersion[] array = new SCFrameworkVersionImpl[3];
1117    
1118                            array[0] = getByCompanyId_PrevAndNext(session, scFrameworkVersion,
1119                                            companyId, orderByComparator, true);
1120    
1121                            array[1] = scFrameworkVersion;
1122    
1123                            array[2] = getByCompanyId_PrevAndNext(session, scFrameworkVersion,
1124                                            companyId, orderByComparator, false);
1125    
1126                            return array;
1127                    }
1128                    catch (Exception e) {
1129                            throw processException(e);
1130                    }
1131                    finally {
1132                            closeSession(session);
1133                    }
1134            }
1135    
1136            protected SCFrameworkVersion getByCompanyId_PrevAndNext(Session session,
1137                    SCFrameworkVersion scFrameworkVersion, long companyId,
1138                    OrderByComparator orderByComparator, boolean previous) {
1139                    StringBundler query = null;
1140    
1141                    if (orderByComparator != null) {
1142                            query = new StringBundler(6 +
1143                                            (orderByComparator.getOrderByFields().length * 6));
1144                    }
1145                    else {
1146                            query = new StringBundler(3);
1147                    }
1148    
1149                    query.append(_SQL_SELECT_SCFRAMEWORKVERSION_WHERE);
1150    
1151                    query.append(_FINDER_COLUMN_COMPANYID_COMPANYID_2);
1152    
1153                    if (orderByComparator != null) {
1154                            String[] orderByFields = orderByComparator.getOrderByFields();
1155    
1156                            if (orderByFields.length > 0) {
1157                                    query.append(WHERE_AND);
1158                            }
1159    
1160                            for (int i = 0; i < orderByFields.length; i++) {
1161                                    query.append(_ORDER_BY_ENTITY_ALIAS);
1162                                    query.append(orderByFields[i]);
1163    
1164                                    if ((i + 1) < orderByFields.length) {
1165                                            if (orderByComparator.isAscending() ^ previous) {
1166                                                    query.append(WHERE_GREATER_THAN_HAS_NEXT);
1167                                            }
1168                                            else {
1169                                                    query.append(WHERE_LESSER_THAN_HAS_NEXT);
1170                                            }
1171                                    }
1172                                    else {
1173                                            if (orderByComparator.isAscending() ^ previous) {
1174                                                    query.append(WHERE_GREATER_THAN);
1175                                            }
1176                                            else {
1177                                                    query.append(WHERE_LESSER_THAN);
1178                                            }
1179                                    }
1180                            }
1181    
1182                            query.append(ORDER_BY_CLAUSE);
1183    
1184                            for (int i = 0; i < orderByFields.length; i++) {
1185                                    query.append(_ORDER_BY_ENTITY_ALIAS);
1186                                    query.append(orderByFields[i]);
1187    
1188                                    if ((i + 1) < orderByFields.length) {
1189                                            if (orderByComparator.isAscending() ^ previous) {
1190                                                    query.append(ORDER_BY_ASC_HAS_NEXT);
1191                                            }
1192                                            else {
1193                                                    query.append(ORDER_BY_DESC_HAS_NEXT);
1194                                            }
1195                                    }
1196                                    else {
1197                                            if (orderByComparator.isAscending() ^ previous) {
1198                                                    query.append(ORDER_BY_ASC);
1199                                            }
1200                                            else {
1201                                                    query.append(ORDER_BY_DESC);
1202                                            }
1203                                    }
1204                            }
1205                    }
1206    
1207                    else {
1208                            query.append(SCFrameworkVersionModelImpl.ORDER_BY_JPQL);
1209                    }
1210    
1211                    String sql = query.toString();
1212    
1213                    Query q = session.createQuery(sql);
1214    
1215                    q.setFirstResult(0);
1216                    q.setMaxResults(2);
1217    
1218                    QueryPos qPos = QueryPos.getInstance(q);
1219    
1220                    qPos.add(companyId);
1221    
1222                    if (orderByComparator != null) {
1223                            Object[] values = orderByComparator.getOrderByValues(scFrameworkVersion);
1224    
1225                            for (Object value : values) {
1226                                    qPos.add(value);
1227                            }
1228                    }
1229    
1230                    List<SCFrameworkVersion> list = q.list();
1231    
1232                    if (list.size() == 2) {
1233                            return list.get(1);
1234                    }
1235                    else {
1236                            return null;
1237                    }
1238            }
1239    
1240            /**
1241             * Finds all the s c framework versions where groupId = &#63; and active = &#63;.
1242             *
1243             * @param groupId the group id to search with
1244             * @param active the active to search with
1245             * @return the matching s c framework versions
1246             * @throws SystemException if a system exception occurred
1247             */
1248            public List<SCFrameworkVersion> findByG_A(long groupId, boolean active)
1249                    throws SystemException {
1250                    return findByG_A(groupId, active, QueryUtil.ALL_POS, QueryUtil.ALL_POS,
1251                            null);
1252            }
1253    
1254            /**
1255             * Finds a range of all the s c framework versions where groupId = &#63; and active = &#63;.
1256             *
1257             * <p>
1258             * 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.
1259             * </p>
1260             *
1261             * @param groupId the group id to search with
1262             * @param active the active to search with
1263             * @param start the lower bound of the range of s c framework versions to return
1264             * @param end the upper bound of the range of s c framework versions to return (not inclusive)
1265             * @return the range of matching s c framework versions
1266             * @throws SystemException if a system exception occurred
1267             */
1268            public List<SCFrameworkVersion> findByG_A(long groupId, boolean active,
1269                    int start, int end) throws SystemException {
1270                    return findByG_A(groupId, active, start, end, null);
1271            }
1272    
1273            /**
1274             * Finds an ordered range of all the s c framework versions where groupId = &#63; and active = &#63;.
1275             *
1276             * <p>
1277             * 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.
1278             * </p>
1279             *
1280             * @param groupId the group id to search with
1281             * @param active the active to search with
1282             * @param start the lower bound of the range of s c framework versions to return
1283             * @param end the upper bound of the range of s c framework versions to return (not inclusive)
1284             * @param orderByComparator the comparator to order the results by
1285             * @return the ordered range of matching s c framework versions
1286             * @throws SystemException if a system exception occurred
1287             */
1288            public List<SCFrameworkVersion> findByG_A(long groupId, boolean active,
1289                    int start, int end, OrderByComparator orderByComparator)
1290                    throws SystemException {
1291                    Object[] finderArgs = new Object[] {
1292                                    groupId, active,
1293                                    
1294                                    String.valueOf(start), String.valueOf(end),
1295                                    String.valueOf(orderByComparator)
1296                            };
1297    
1298                    List<SCFrameworkVersion> list = (List<SCFrameworkVersion>)FinderCacheUtil.getResult(FINDER_PATH_FIND_BY_G_A,
1299                                    finderArgs, this);
1300    
1301                    if (list == null) {
1302                            StringBundler query = null;
1303    
1304                            if (orderByComparator != null) {
1305                                    query = new StringBundler(4 +
1306                                                    (orderByComparator.getOrderByFields().length * 3));
1307                            }
1308                            else {
1309                                    query = new StringBundler(4);
1310                            }
1311    
1312                            query.append(_SQL_SELECT_SCFRAMEWORKVERSION_WHERE);
1313    
1314                            query.append(_FINDER_COLUMN_G_A_GROUPID_2);
1315    
1316                            query.append(_FINDER_COLUMN_G_A_ACTIVE_2);
1317    
1318                            if (orderByComparator != null) {
1319                                    appendOrderByComparator(query, _ORDER_BY_ENTITY_ALIAS,
1320                                            orderByComparator);
1321                            }
1322    
1323                            else {
1324                                    query.append(SCFrameworkVersionModelImpl.ORDER_BY_JPQL);
1325                            }
1326    
1327                            String sql = query.toString();
1328    
1329                            Session session = null;
1330    
1331                            try {
1332                                    session = openSession();
1333    
1334                                    Query q = session.createQuery(sql);
1335    
1336                                    QueryPos qPos = QueryPos.getInstance(q);
1337    
1338                                    qPos.add(groupId);
1339    
1340                                    qPos.add(active);
1341    
1342                                    list = (List<SCFrameworkVersion>)QueryUtil.list(q,
1343                                                    getDialect(), start, end);
1344                            }
1345                            catch (Exception e) {
1346                                    throw processException(e);
1347                            }
1348                            finally {
1349                                    if (list == null) {
1350                                            FinderCacheUtil.removeResult(FINDER_PATH_FIND_BY_G_A,
1351                                                    finderArgs);
1352                                    }
1353                                    else {
1354                                            cacheResult(list);
1355    
1356                                            FinderCacheUtil.putResult(FINDER_PATH_FIND_BY_G_A,
1357                                                    finderArgs, list);
1358                                    }
1359    
1360                                    closeSession(session);
1361                            }
1362                    }
1363    
1364                    return list;
1365            }
1366    
1367            /**
1368             * Finds the first s c framework version in the ordered set where groupId = &#63; and active = &#63;.
1369             *
1370             * <p>
1371             * 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.
1372             * </p>
1373             *
1374             * @param groupId the group id to search with
1375             * @param active the active to search with
1376             * @param orderByComparator the comparator to order the set by
1377             * @return the first matching s c framework version
1378             * @throws com.liferay.portlet.softwarecatalog.NoSuchFrameworkVersionException if a matching s c framework version could not be found
1379             * @throws SystemException if a system exception occurred
1380             */
1381            public SCFrameworkVersion findByG_A_First(long groupId, boolean active,
1382                    OrderByComparator orderByComparator)
1383                    throws NoSuchFrameworkVersionException, SystemException {
1384                    List<SCFrameworkVersion> list = findByG_A(groupId, active, 0, 1,
1385                                    orderByComparator);
1386    
1387                    if (list.isEmpty()) {
1388                            StringBundler msg = new StringBundler(6);
1389    
1390                            msg.append(_NO_SUCH_ENTITY_WITH_KEY);
1391    
1392                            msg.append("groupId=");
1393                            msg.append(groupId);
1394    
1395                            msg.append(", active=");
1396                            msg.append(active);
1397    
1398                            msg.append(StringPool.CLOSE_CURLY_BRACE);
1399    
1400                            throw new NoSuchFrameworkVersionException(msg.toString());
1401                    }
1402                    else {
1403                            return list.get(0);
1404                    }
1405            }
1406    
1407            /**
1408             * Finds the last s c framework version in the ordered set where groupId = &#63; and active = &#63;.
1409             *
1410             * <p>
1411             * 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.
1412             * </p>
1413             *
1414             * @param groupId the group id to search with
1415             * @param active the active to search with
1416             * @param orderByComparator the comparator to order the set by
1417             * @return the last matching s c framework version
1418             * @throws com.liferay.portlet.softwarecatalog.NoSuchFrameworkVersionException if a matching s c framework version could not be found
1419             * @throws SystemException if a system exception occurred
1420             */
1421            public SCFrameworkVersion findByG_A_Last(long groupId, boolean active,
1422                    OrderByComparator orderByComparator)
1423                    throws NoSuchFrameworkVersionException, SystemException {
1424                    int count = countByG_A(groupId, active);
1425    
1426                    List<SCFrameworkVersion> list = findByG_A(groupId, active, count - 1,
1427                                    count, orderByComparator);
1428    
1429                    if (list.isEmpty()) {
1430                            StringBundler msg = new StringBundler(6);
1431    
1432                            msg.append(_NO_SUCH_ENTITY_WITH_KEY);
1433    
1434                            msg.append("groupId=");
1435                            msg.append(groupId);
1436    
1437                            msg.append(", active=");
1438                            msg.append(active);
1439    
1440                            msg.append(StringPool.CLOSE_CURLY_BRACE);
1441    
1442                            throw new NoSuchFrameworkVersionException(msg.toString());
1443                    }
1444                    else {
1445                            return list.get(0);
1446                    }
1447            }
1448    
1449            /**
1450             * Finds the s c framework versions before and after the current s c framework version in the ordered set where groupId = &#63; and active = &#63;.
1451             *
1452             * <p>
1453             * 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.
1454             * </p>
1455             *
1456             * @param frameworkVersionId the primary key of the current s c framework version
1457             * @param groupId the group id to search with
1458             * @param active the active to search with
1459             * @param orderByComparator the comparator to order the set by
1460             * @return the previous, current, and next s c framework version
1461             * @throws com.liferay.portlet.softwarecatalog.NoSuchFrameworkVersionException if a s c framework version with the primary key could not be found
1462             * @throws SystemException if a system exception occurred
1463             */
1464            public SCFrameworkVersion[] findByG_A_PrevAndNext(long frameworkVersionId,
1465                    long groupId, boolean active, OrderByComparator orderByComparator)
1466                    throws NoSuchFrameworkVersionException, SystemException {
1467                    SCFrameworkVersion scFrameworkVersion = findByPrimaryKey(frameworkVersionId);
1468    
1469                    Session session = null;
1470    
1471                    try {
1472                            session = openSession();
1473    
1474                            SCFrameworkVersion[] array = new SCFrameworkVersionImpl[3];
1475    
1476                            array[0] = getByG_A_PrevAndNext(session, scFrameworkVersion,
1477                                            groupId, active, orderByComparator, true);
1478    
1479                            array[1] = scFrameworkVersion;
1480    
1481                            array[2] = getByG_A_PrevAndNext(session, scFrameworkVersion,
1482                                            groupId, active, orderByComparator, false);
1483    
1484                            return array;
1485                    }
1486                    catch (Exception e) {
1487                            throw processException(e);
1488                    }
1489                    finally {
1490                            closeSession(session);
1491                    }
1492            }
1493    
1494            protected SCFrameworkVersion getByG_A_PrevAndNext(Session session,
1495                    SCFrameworkVersion scFrameworkVersion, long groupId, boolean active,
1496                    OrderByComparator orderByComparator, boolean previous) {
1497                    StringBundler query = null;
1498    
1499                    if (orderByComparator != null) {
1500                            query = new StringBundler(6 +
1501                                            (orderByComparator.getOrderByFields().length * 6));
1502                    }
1503                    else {
1504                            query = new StringBundler(3);
1505                    }
1506    
1507                    query.append(_SQL_SELECT_SCFRAMEWORKVERSION_WHERE);
1508    
1509                    query.append(_FINDER_COLUMN_G_A_GROUPID_2);
1510    
1511                    query.append(_FINDER_COLUMN_G_A_ACTIVE_2);
1512    
1513                    if (orderByComparator != null) {
1514                            String[] orderByFields = orderByComparator.getOrderByFields();
1515    
1516                            if (orderByFields.length > 0) {
1517                                    query.append(WHERE_AND);
1518                            }
1519    
1520                            for (int i = 0; i < orderByFields.length; i++) {
1521                                    query.append(_ORDER_BY_ENTITY_ALIAS);
1522                                    query.append(orderByFields[i]);
1523    
1524                                    if ((i + 1) < orderByFields.length) {
1525                                            if (orderByComparator.isAscending() ^ previous) {
1526                                                    query.append(WHERE_GREATER_THAN_HAS_NEXT);
1527                                            }
1528                                            else {
1529                                                    query.append(WHERE_LESSER_THAN_HAS_NEXT);
1530                                            }
1531                                    }
1532                                    else {
1533                                            if (orderByComparator.isAscending() ^ previous) {
1534                                                    query.append(WHERE_GREATER_THAN);
1535                                            }
1536                                            else {
1537                                                    query.append(WHERE_LESSER_THAN);
1538                                            }
1539                                    }
1540                            }
1541    
1542                            query.append(ORDER_BY_CLAUSE);
1543    
1544                            for (int i = 0; i < orderByFields.length; i++) {
1545                                    query.append(_ORDER_BY_ENTITY_ALIAS);
1546                                    query.append(orderByFields[i]);
1547    
1548                                    if ((i + 1) < orderByFields.length) {
1549                                            if (orderByComparator.isAscending() ^ previous) {
1550                                                    query.append(ORDER_BY_ASC_HAS_NEXT);
1551                                            }
1552                                            else {
1553                                                    query.append(ORDER_BY_DESC_HAS_NEXT);
1554                                            }
1555                                    }
1556                                    else {
1557                                            if (orderByComparator.isAscending() ^ previous) {
1558                                                    query.append(ORDER_BY_ASC);
1559                                            }
1560                                            else {
1561                                                    query.append(ORDER_BY_DESC);
1562                                            }
1563                                    }
1564                            }
1565                    }
1566    
1567                    else {
1568                            query.append(SCFrameworkVersionModelImpl.ORDER_BY_JPQL);
1569                    }
1570    
1571                    String sql = query.toString();
1572    
1573                    Query q = session.createQuery(sql);
1574    
1575                    q.setFirstResult(0);
1576                    q.setMaxResults(2);
1577    
1578                    QueryPos qPos = QueryPos.getInstance(q);
1579    
1580                    qPos.add(groupId);
1581    
1582                    qPos.add(active);
1583    
1584                    if (orderByComparator != null) {
1585                            Object[] values = orderByComparator.getOrderByValues(scFrameworkVersion);
1586    
1587                            for (Object value : values) {
1588                                    qPos.add(value);
1589                            }
1590                    }
1591    
1592                    List<SCFrameworkVersion> list = q.list();
1593    
1594                    if (list.size() == 2) {
1595                            return list.get(1);
1596                    }
1597                    else {
1598                            return null;
1599                    }
1600            }
1601    
1602            /**
1603             * Filters by the user's permissions and finds all the s c framework versions where groupId = &#63; and active = &#63;.
1604             *
1605             * @param groupId the group id to search with
1606             * @param active the active to search with
1607             * @return the matching s c framework versions that the user has permission to view
1608             * @throws SystemException if a system exception occurred
1609             */
1610            public List<SCFrameworkVersion> filterFindByG_A(long groupId, boolean active)
1611                    throws SystemException {
1612                    return filterFindByG_A(groupId, active, QueryUtil.ALL_POS,
1613                            QueryUtil.ALL_POS, null);
1614            }
1615    
1616            /**
1617             * Filters by the user's permissions and finds a range of all the s c framework versions where groupId = &#63; and active = &#63;.
1618             *
1619             * <p>
1620             * 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.
1621             * </p>
1622             *
1623             * @param groupId the group id to search with
1624             * @param active the active to search with
1625             * @param start the lower bound of the range of s c framework versions to return
1626             * @param end the upper bound of the range of s c framework versions to return (not inclusive)
1627             * @return the range of matching s c framework versions that the user has permission to view
1628             * @throws SystemException if a system exception occurred
1629             */
1630            public List<SCFrameworkVersion> filterFindByG_A(long groupId,
1631                    boolean active, int start, int end) throws SystemException {
1632                    return filterFindByG_A(groupId, active, start, end, null);
1633            }
1634    
1635            /**
1636             * Filters by the user's permissions and finds an ordered range of all the s c framework versions where groupId = &#63; and active = &#63;.
1637             *
1638             * <p>
1639             * 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.
1640             * </p>
1641             *
1642             * @param groupId the group id to search with
1643             * @param active the active to search with
1644             * @param start the lower bound of the range of s c framework versions to return
1645             * @param end the upper bound of the range of s c framework versions to return (not inclusive)
1646             * @param orderByComparator the comparator to order the results by
1647             * @return the ordered range of matching s c framework versions that the user has permission to view
1648             * @throws SystemException if a system exception occurred
1649             */
1650            public List<SCFrameworkVersion> filterFindByG_A(long groupId,
1651                    boolean active, int start, int end, OrderByComparator orderByComparator)
1652                    throws SystemException {
1653                    if (!InlineSQLHelperUtil.isEnabled(groupId)) {
1654                            return findByG_A(groupId, active, start, end, orderByComparator);
1655                    }
1656    
1657                    StringBundler query = null;
1658    
1659                    if (orderByComparator != null) {
1660                            query = new StringBundler(4 +
1661                                            (orderByComparator.getOrderByFields().length * 3));
1662                    }
1663                    else {
1664                            query = new StringBundler(4);
1665                    }
1666    
1667                    if (getDB().isSupportsInlineDistinct()) {
1668                            query.append(_FILTER_SQL_SELECT_SCFRAMEWORKVERSION_WHERE);
1669                    }
1670                    else {
1671                            query.append(_FILTER_SQL_SELECT_SCFRAMEWORKVERSION_NO_INLINE_DISTINCT_WHERE_1);
1672                    }
1673    
1674                    query.append(_FINDER_COLUMN_G_A_GROUPID_2);
1675    
1676                    query.append(_FINDER_COLUMN_G_A_ACTIVE_2);
1677    
1678                    if (!getDB().isSupportsInlineDistinct()) {
1679                            query.append(_FILTER_SQL_SELECT_SCFRAMEWORKVERSION_NO_INLINE_DISTINCT_WHERE_2);
1680                    }
1681    
1682                    if (orderByComparator != null) {
1683                            if (getDB().isSupportsInlineDistinct()) {
1684                                    appendOrderByComparator(query, _ORDER_BY_ENTITY_ALIAS,
1685                                            orderByComparator);
1686                            }
1687                            else {
1688                                    appendOrderByComparator(query, _ORDER_BY_ENTITY_TABLE,
1689                                            orderByComparator);
1690                            }
1691                    }
1692    
1693                    else {
1694                            if (getDB().isSupportsInlineDistinct()) {
1695                                    query.append(SCFrameworkVersionModelImpl.ORDER_BY_JPQL);
1696                            }
1697                            else {
1698                                    query.append(SCFrameworkVersionModelImpl.ORDER_BY_SQL);
1699                            }
1700                    }
1701    
1702                    String sql = InlineSQLHelperUtil.replacePermissionCheck(query.toString(),
1703                                    SCFrameworkVersion.class.getName(), _FILTER_COLUMN_PK,
1704                                    _FILTER_COLUMN_USERID, groupId);
1705    
1706                    Session session = null;
1707    
1708                    try {
1709                            session = openSession();
1710    
1711                            SQLQuery q = session.createSQLQuery(sql);
1712    
1713                            if (getDB().isSupportsInlineDistinct()) {
1714                                    q.addEntity(_FILTER_ENTITY_ALIAS, SCFrameworkVersionImpl.class);
1715                            }
1716                            else {
1717                                    q.addEntity(_FILTER_ENTITY_TABLE, SCFrameworkVersionImpl.class);
1718                            }
1719    
1720                            QueryPos qPos = QueryPos.getInstance(q);
1721    
1722                            qPos.add(groupId);
1723    
1724                            qPos.add(active);
1725    
1726                            return (List<SCFrameworkVersion>)QueryUtil.list(q, getDialect(),
1727                                    start, end);
1728                    }
1729                    catch (Exception e) {
1730                            throw processException(e);
1731                    }
1732                    finally {
1733                            closeSession(session);
1734                    }
1735            }
1736    
1737            /**
1738             * Finds all the s c framework versions.
1739             *
1740             * @return the s c framework versions
1741             * @throws SystemException if a system exception occurred
1742             */
1743            public List<SCFrameworkVersion> findAll() throws SystemException {
1744                    return findAll(QueryUtil.ALL_POS, QueryUtil.ALL_POS, null);
1745            }
1746    
1747            /**
1748             * Finds a range of all the s c framework versions.
1749             *
1750             * <p>
1751             * 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.
1752             * </p>
1753             *
1754             * @param start the lower bound of the range of s c framework versions to return
1755             * @param end the upper bound of the range of s c framework versions to return (not inclusive)
1756             * @return the range of s c framework versions
1757             * @throws SystemException if a system exception occurred
1758             */
1759            public List<SCFrameworkVersion> findAll(int start, int end)
1760                    throws SystemException {
1761                    return findAll(start, end, null);
1762            }
1763    
1764            /**
1765             * Finds an ordered range of all the s c framework versions.
1766             *
1767             * <p>
1768             * 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.
1769             * </p>
1770             *
1771             * @param start the lower bound of the range of s c framework versions to return
1772             * @param end the upper bound of the range of s c framework versions to return (not inclusive)
1773             * @param orderByComparator the comparator to order the results by
1774             * @return the ordered range of s c framework versions
1775             * @throws SystemException if a system exception occurred
1776             */
1777            public List<SCFrameworkVersion> findAll(int start, int end,
1778                    OrderByComparator orderByComparator) throws SystemException {
1779                    Object[] finderArgs = new Object[] {
1780                                    String.valueOf(start), String.valueOf(end),
1781                                    String.valueOf(orderByComparator)
1782                            };
1783    
1784                    List<SCFrameworkVersion> list = (List<SCFrameworkVersion>)FinderCacheUtil.getResult(FINDER_PATH_FIND_ALL,
1785                                    finderArgs, this);
1786    
1787                    if (list == null) {
1788                            StringBundler query = null;
1789                            String sql = null;
1790    
1791                            if (orderByComparator != null) {
1792                                    query = new StringBundler(2 +
1793                                                    (orderByComparator.getOrderByFields().length * 3));
1794    
1795                                    query.append(_SQL_SELECT_SCFRAMEWORKVERSION);
1796    
1797                                    appendOrderByComparator(query, _ORDER_BY_ENTITY_ALIAS,
1798                                            orderByComparator);
1799    
1800                                    sql = query.toString();
1801                            }
1802                            else {
1803                                    sql = _SQL_SELECT_SCFRAMEWORKVERSION.concat(SCFrameworkVersionModelImpl.ORDER_BY_JPQL);
1804                            }
1805    
1806                            Session session = null;
1807    
1808                            try {
1809                                    session = openSession();
1810    
1811                                    Query q = session.createQuery(sql);
1812    
1813                                    if (orderByComparator == null) {
1814                                            list = (List<SCFrameworkVersion>)QueryUtil.list(q,
1815                                                            getDialect(), start, end, false);
1816    
1817                                            Collections.sort(list);
1818                                    }
1819                                    else {
1820                                            list = (List<SCFrameworkVersion>)QueryUtil.list(q,
1821                                                            getDialect(), start, end);
1822                                    }
1823                            }
1824                            catch (Exception e) {
1825                                    throw processException(e);
1826                            }
1827                            finally {
1828                                    if (list == null) {
1829                                            FinderCacheUtil.removeResult(FINDER_PATH_FIND_ALL,
1830                                                    finderArgs);
1831                                    }
1832                                    else {
1833                                            cacheResult(list);
1834    
1835                                            FinderCacheUtil.putResult(FINDER_PATH_FIND_ALL, finderArgs,
1836                                                    list);
1837                                    }
1838    
1839                                    closeSession(session);
1840                            }
1841                    }
1842    
1843                    return list;
1844            }
1845    
1846            /**
1847             * Removes all the s c framework versions where groupId = &#63; from the database.
1848             *
1849             * @param groupId the group id to search with
1850             * @throws SystemException if a system exception occurred
1851             */
1852            public void removeByGroupId(long groupId) throws SystemException {
1853                    for (SCFrameworkVersion scFrameworkVersion : findByGroupId(groupId)) {
1854                            remove(scFrameworkVersion);
1855                    }
1856            }
1857    
1858            /**
1859             * Removes all the s c framework versions where companyId = &#63; from the database.
1860             *
1861             * @param companyId the company id to search with
1862             * @throws SystemException if a system exception occurred
1863             */
1864            public void removeByCompanyId(long companyId) throws SystemException {
1865                    for (SCFrameworkVersion scFrameworkVersion : findByCompanyId(companyId)) {
1866                            remove(scFrameworkVersion);
1867                    }
1868            }
1869    
1870            /**
1871             * Removes all the s c framework versions where groupId = &#63; and active = &#63; from the database.
1872             *
1873             * @param groupId the group id to search with
1874             * @param active the active to search with
1875             * @throws SystemException if a system exception occurred
1876             */
1877            public void removeByG_A(long groupId, boolean active)
1878                    throws SystemException {
1879                    for (SCFrameworkVersion scFrameworkVersion : findByG_A(groupId, active)) {
1880                            remove(scFrameworkVersion);
1881                    }
1882            }
1883    
1884            /**
1885             * Removes all the s c framework versions from the database.
1886             *
1887             * @throws SystemException if a system exception occurred
1888             */
1889            public void removeAll() throws SystemException {
1890                    for (SCFrameworkVersion scFrameworkVersion : findAll()) {
1891                            remove(scFrameworkVersion);
1892                    }
1893            }
1894    
1895            /**
1896             * Counts all the s c framework versions where groupId = &#63;.
1897             *
1898             * @param groupId the group id to search with
1899             * @return the number of matching s c framework versions
1900             * @throws SystemException if a system exception occurred
1901             */
1902            public int countByGroupId(long groupId) throws SystemException {
1903                    Object[] finderArgs = new Object[] { groupId };
1904    
1905                    Long count = (Long)FinderCacheUtil.getResult(FINDER_PATH_COUNT_BY_GROUPID,
1906                                    finderArgs, this);
1907    
1908                    if (count == null) {
1909                            StringBundler query = new StringBundler(2);
1910    
1911                            query.append(_SQL_COUNT_SCFRAMEWORKVERSION_WHERE);
1912    
1913                            query.append(_FINDER_COLUMN_GROUPID_GROUPID_2);
1914    
1915                            String sql = query.toString();
1916    
1917                            Session session = null;
1918    
1919                            try {
1920                                    session = openSession();
1921    
1922                                    Query q = session.createQuery(sql);
1923    
1924                                    QueryPos qPos = QueryPos.getInstance(q);
1925    
1926                                    qPos.add(groupId);
1927    
1928                                    count = (Long)q.uniqueResult();
1929                            }
1930                            catch (Exception e) {
1931                                    throw processException(e);
1932                            }
1933                            finally {
1934                                    if (count == null) {
1935                                            count = Long.valueOf(0);
1936                                    }
1937    
1938                                    FinderCacheUtil.putResult(FINDER_PATH_COUNT_BY_GROUPID,
1939                                            finderArgs, count);
1940    
1941                                    closeSession(session);
1942                            }
1943                    }
1944    
1945                    return count.intValue();
1946            }
1947    
1948            /**
1949             * Filters by the user's permissions and counts all the s c framework versions where groupId = &#63;.
1950             *
1951             * @param groupId the group id to search with
1952             * @return the number of matching s c framework versions that the user has permission to view
1953             * @throws SystemException if a system exception occurred
1954             */
1955            public int filterCountByGroupId(long groupId) throws SystemException {
1956                    if (!InlineSQLHelperUtil.isEnabled(groupId)) {
1957                            return countByGroupId(groupId);
1958                    }
1959    
1960                    StringBundler query = new StringBundler(2);
1961    
1962                    query.append(_FILTER_SQL_COUNT_SCFRAMEWORKVERSION_WHERE);
1963    
1964                    query.append(_FINDER_COLUMN_GROUPID_GROUPID_2);
1965    
1966                    String sql = InlineSQLHelperUtil.replacePermissionCheck(query.toString(),
1967                                    SCFrameworkVersion.class.getName(), _FILTER_COLUMN_PK,
1968                                    _FILTER_COLUMN_USERID, groupId);
1969    
1970                    Session session = null;
1971    
1972                    try {
1973                            session = openSession();
1974    
1975                            SQLQuery q = session.createSQLQuery(sql);
1976    
1977                            q.addScalar(COUNT_COLUMN_NAME,
1978                                    com.liferay.portal.kernel.dao.orm.Type.LONG);
1979    
1980                            QueryPos qPos = QueryPos.getInstance(q);
1981    
1982                            qPos.add(groupId);
1983    
1984                            Long count = (Long)q.uniqueResult();
1985    
1986                            return count.intValue();
1987                    }
1988                    catch (Exception e) {
1989                            throw processException(e);
1990                    }
1991                    finally {
1992                            closeSession(session);
1993                    }
1994            }
1995    
1996            /**
1997             * Counts all the s c framework versions where companyId = &#63;.
1998             *
1999             * @param companyId the company id to search with
2000             * @return the number of matching s c framework versions
2001             * @throws SystemException if a system exception occurred
2002             */
2003            public int countByCompanyId(long companyId) throws SystemException {
2004                    Object[] finderArgs = new Object[] { companyId };
2005    
2006                    Long count = (Long)FinderCacheUtil.getResult(FINDER_PATH_COUNT_BY_COMPANYID,
2007                                    finderArgs, this);
2008    
2009                    if (count == null) {
2010                            StringBundler query = new StringBundler(2);
2011    
2012                            query.append(_SQL_COUNT_SCFRAMEWORKVERSION_WHERE);
2013    
2014                            query.append(_FINDER_COLUMN_COMPANYID_COMPANYID_2);
2015    
2016                            String sql = query.toString();
2017    
2018                            Session session = null;
2019    
2020                            try {
2021                                    session = openSession();
2022    
2023                                    Query q = session.createQuery(sql);
2024    
2025                                    QueryPos qPos = QueryPos.getInstance(q);
2026    
2027                                    qPos.add(companyId);
2028    
2029                                    count = (Long)q.uniqueResult();
2030                            }
2031                            catch (Exception e) {
2032                                    throw processException(e);
2033                            }
2034                            finally {
2035                                    if (count == null) {
2036                                            count = Long.valueOf(0);
2037                                    }
2038    
2039                                    FinderCacheUtil.putResult(FINDER_PATH_COUNT_BY_COMPANYID,
2040                                            finderArgs, count);
2041    
2042                                    closeSession(session);
2043                            }
2044                    }
2045    
2046                    return count.intValue();
2047            }
2048    
2049            /**
2050             * Counts all the s c framework versions where groupId = &#63; and active = &#63;.
2051             *
2052             * @param groupId the group id to search with
2053             * @param active the active to search with
2054             * @return the number of matching s c framework versions
2055             * @throws SystemException if a system exception occurred
2056             */
2057            public int countByG_A(long groupId, boolean active)
2058                    throws SystemException {
2059                    Object[] finderArgs = new Object[] { groupId, active };
2060    
2061                    Long count = (Long)FinderCacheUtil.getResult(FINDER_PATH_COUNT_BY_G_A,
2062                                    finderArgs, this);
2063    
2064                    if (count == null) {
2065                            StringBundler query = new StringBundler(3);
2066    
2067                            query.append(_SQL_COUNT_SCFRAMEWORKVERSION_WHERE);
2068    
2069                            query.append(_FINDER_COLUMN_G_A_GROUPID_2);
2070    
2071                            query.append(_FINDER_COLUMN_G_A_ACTIVE_2);
2072    
2073                            String sql = query.toString();
2074    
2075                            Session session = null;
2076    
2077                            try {
2078                                    session = openSession();
2079    
2080                                    Query q = session.createQuery(sql);
2081    
2082                                    QueryPos qPos = QueryPos.getInstance(q);
2083    
2084                                    qPos.add(groupId);
2085    
2086                                    qPos.add(active);
2087    
2088                                    count = (Long)q.uniqueResult();
2089                            }
2090                            catch (Exception e) {
2091                                    throw processException(e);
2092                            }
2093                            finally {
2094                                    if (count == null) {
2095                                            count = Long.valueOf(0);
2096                                    }
2097    
2098                                    FinderCacheUtil.putResult(FINDER_PATH_COUNT_BY_G_A, finderArgs,
2099                                            count);
2100    
2101                                    closeSession(session);
2102                            }
2103                    }
2104    
2105                    return count.intValue();
2106            }
2107    
2108            /**
2109             * Filters by the user's permissions and counts all the s c framework versions where groupId = &#63; and active = &#63;.
2110             *
2111             * @param groupId the group id to search with
2112             * @param active the active to search with
2113             * @return the number of matching s c framework versions that the user has permission to view
2114             * @throws SystemException if a system exception occurred
2115             */
2116            public int filterCountByG_A(long groupId, boolean active)
2117                    throws SystemException {
2118                    if (!InlineSQLHelperUtil.isEnabled(groupId)) {
2119                            return countByG_A(groupId, active);
2120                    }
2121    
2122                    StringBundler query = new StringBundler(3);
2123    
2124                    query.append(_FILTER_SQL_COUNT_SCFRAMEWORKVERSION_WHERE);
2125    
2126                    query.append(_FINDER_COLUMN_G_A_GROUPID_2);
2127    
2128                    query.append(_FINDER_COLUMN_G_A_ACTIVE_2);
2129    
2130                    String sql = InlineSQLHelperUtil.replacePermissionCheck(query.toString(),
2131                                    SCFrameworkVersion.class.getName(), _FILTER_COLUMN_PK,
2132                                    _FILTER_COLUMN_USERID, groupId);
2133    
2134                    Session session = null;
2135    
2136                    try {
2137                            session = openSession();
2138    
2139                            SQLQuery q = session.createSQLQuery(sql);
2140    
2141                            q.addScalar(COUNT_COLUMN_NAME,
2142                                    com.liferay.portal.kernel.dao.orm.Type.LONG);
2143    
2144                            QueryPos qPos = QueryPos.getInstance(q);
2145    
2146                            qPos.add(groupId);
2147    
2148                            qPos.add(active);
2149    
2150                            Long count = (Long)q.uniqueResult();
2151    
2152                            return count.intValue();
2153                    }
2154                    catch (Exception e) {
2155                            throw processException(e);
2156                    }
2157                    finally {
2158                            closeSession(session);
2159                    }
2160            }
2161    
2162            /**
2163             * Counts all the s c framework versions.
2164             *
2165             * @return the number of s c framework versions
2166             * @throws SystemException if a system exception occurred
2167             */
2168            public int countAll() throws SystemException {
2169                    Object[] finderArgs = new Object[0];
2170    
2171                    Long count = (Long)FinderCacheUtil.getResult(FINDER_PATH_COUNT_ALL,
2172                                    finderArgs, this);
2173    
2174                    if (count == null) {
2175                            Session session = null;
2176    
2177                            try {
2178                                    session = openSession();
2179    
2180                                    Query q = session.createQuery(_SQL_COUNT_SCFRAMEWORKVERSION);
2181    
2182                                    count = (Long)q.uniqueResult();
2183                            }
2184                            catch (Exception e) {
2185                                    throw processException(e);
2186                            }
2187                            finally {
2188                                    if (count == null) {
2189                                            count = Long.valueOf(0);
2190                                    }
2191    
2192                                    FinderCacheUtil.putResult(FINDER_PATH_COUNT_ALL, finderArgs,
2193                                            count);
2194    
2195                                    closeSession(session);
2196                            }
2197                    }
2198    
2199                    return count.intValue();
2200            }
2201    
2202            /**
2203             * Gets all the s c product versions associated with the s c framework version.
2204             *
2205             * @param pk the primary key of the s c framework version to get the associated s c product versions for
2206             * @return the s c product versions associated with the s c framework version
2207             * @throws SystemException if a system exception occurred
2208             */
2209            public List<com.liferay.portlet.softwarecatalog.model.SCProductVersion> getSCProductVersions(
2210                    long pk) throws SystemException {
2211                    return getSCProductVersions(pk, QueryUtil.ALL_POS, QueryUtil.ALL_POS);
2212            }
2213    
2214            /**
2215             * Gets a range of all the s c product versions associated with the s c framework version.
2216             *
2217             * <p>
2218             * 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.
2219             * </p>
2220             *
2221             * @param pk the primary key of the s c framework version to get the associated s c product versions for
2222             * @param start the lower bound of the range of s c framework versions to return
2223             * @param end the upper bound of the range of s c framework versions to return (not inclusive)
2224             * @return the range of s c product versions associated with the s c framework version
2225             * @throws SystemException if a system exception occurred
2226             */
2227            public List<com.liferay.portlet.softwarecatalog.model.SCProductVersion> getSCProductVersions(
2228                    long pk, int start, int end) throws SystemException {
2229                    return getSCProductVersions(pk, start, end, null);
2230            }
2231    
2232            public static final FinderPath FINDER_PATH_GET_SCPRODUCTVERSIONS = new FinderPath(com.liferay.portlet.softwarecatalog.model.impl.SCProductVersionModelImpl.ENTITY_CACHE_ENABLED,
2233                            SCFrameworkVersionModelImpl.FINDER_CACHE_ENABLED_SCFRAMEWORKVERSI_SCPRODUCTVERS,
2234                            SCFrameworkVersionModelImpl.MAPPING_TABLE_SCFRAMEWORKVERSI_SCPRODUCTVERS_NAME,
2235                            "getSCProductVersions",
2236                            new String[] {
2237                                    Long.class.getName(), "java.lang.Integer", "java.lang.Integer",
2238                                    "com.liferay.portal.kernel.util.OrderByComparator"
2239                            });
2240    
2241            /**
2242             * Gets an ordered range of all the s c product versions associated with the s c framework version.
2243             *
2244             * <p>
2245             * 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.
2246             * </p>
2247             *
2248             * @param pk the primary key of the s c framework version to get the associated s c product versions for
2249             * @param start the lower bound of the range of s c framework versions to return
2250             * @param end the upper bound of the range of s c framework versions to return (not inclusive)
2251             * @param orderByComparator the comparator to order the results by
2252             * @return the ordered range of s c product versions associated with the s c framework version
2253             * @throws SystemException if a system exception occurred
2254             */
2255            public List<com.liferay.portlet.softwarecatalog.model.SCProductVersion> getSCProductVersions(
2256                    long pk, int start, int end, OrderByComparator orderByComparator)
2257                    throws SystemException {
2258                    Object[] finderArgs = new Object[] {
2259                                    pk, String.valueOf(start), String.valueOf(end),
2260                                    String.valueOf(orderByComparator)
2261                            };
2262    
2263                    List<com.liferay.portlet.softwarecatalog.model.SCProductVersion> list = (List<com.liferay.portlet.softwarecatalog.model.SCProductVersion>)FinderCacheUtil.getResult(FINDER_PATH_GET_SCPRODUCTVERSIONS,
2264                                    finderArgs, this);
2265    
2266                    if (list == null) {
2267                            Session session = null;
2268    
2269                            try {
2270                                    session = openSession();
2271    
2272                                    String sql = null;
2273    
2274                                    if (orderByComparator != null) {
2275                                            sql = _SQL_GETSCPRODUCTVERSIONS.concat(ORDER_BY_CLAUSE)
2276                                                                                                       .concat(orderByComparator.getOrderBy());
2277                                    }
2278                                    else {
2279                                            sql = _SQL_GETSCPRODUCTVERSIONS.concat(com.liferay.portlet.softwarecatalog.model.impl.SCProductVersionModelImpl.ORDER_BY_SQL);
2280                                    }
2281    
2282                                    SQLQuery q = session.createSQLQuery(sql);
2283    
2284                                    q.addEntity("SCProductVersion",
2285                                            com.liferay.portlet.softwarecatalog.model.impl.SCProductVersionImpl.class);
2286    
2287                                    QueryPos qPos = QueryPos.getInstance(q);
2288    
2289                                    qPos.add(pk);
2290    
2291                                    list = (List<com.liferay.portlet.softwarecatalog.model.SCProductVersion>)QueryUtil.list(q,
2292                                                    getDialect(), start, end);
2293                            }
2294                            catch (Exception e) {
2295                                    throw processException(e);
2296                            }
2297                            finally {
2298                                    if (list == null) {
2299                                            FinderCacheUtil.removeResult(FINDER_PATH_GET_SCPRODUCTVERSIONS,
2300                                                    finderArgs);
2301                                    }
2302                                    else {
2303                                            scProductVersionPersistence.cacheResult(list);
2304    
2305                                            FinderCacheUtil.putResult(FINDER_PATH_GET_SCPRODUCTVERSIONS,
2306                                                    finderArgs, list);
2307                                    }
2308    
2309                                    closeSession(session);
2310                            }
2311                    }
2312    
2313                    return list;
2314            }
2315    
2316            public static final FinderPath FINDER_PATH_GET_SCPRODUCTVERSIONS_SIZE = new FinderPath(com.liferay.portlet.softwarecatalog.model.impl.SCProductVersionModelImpl.ENTITY_CACHE_ENABLED,
2317                            SCFrameworkVersionModelImpl.FINDER_CACHE_ENABLED_SCFRAMEWORKVERSI_SCPRODUCTVERS,
2318                            SCFrameworkVersionModelImpl.MAPPING_TABLE_SCFRAMEWORKVERSI_SCPRODUCTVERS_NAME,
2319                            "getSCProductVersionsSize", new String[] { Long.class.getName() });
2320    
2321            /**
2322             * Gets the number of s c product versions associated with the s c framework version.
2323             *
2324             * @param pk the primary key of the s c framework version to get the number of associated s c product versions for
2325             * @return the number of s c product versions associated with the s c framework version
2326             * @throws SystemException if a system exception occurred
2327             */
2328            public int getSCProductVersionsSize(long pk) throws SystemException {
2329                    Object[] finderArgs = new Object[] { pk };
2330    
2331                    Long count = (Long)FinderCacheUtil.getResult(FINDER_PATH_GET_SCPRODUCTVERSIONS_SIZE,
2332                                    finderArgs, this);
2333    
2334                    if (count == null) {
2335                            Session session = null;
2336    
2337                            try {
2338                                    session = openSession();
2339    
2340                                    SQLQuery q = session.createSQLQuery(_SQL_GETSCPRODUCTVERSIONSSIZE);
2341    
2342                                    q.addScalar(COUNT_COLUMN_NAME,
2343                                            com.liferay.portal.kernel.dao.orm.Type.LONG);
2344    
2345                                    QueryPos qPos = QueryPos.getInstance(q);
2346    
2347                                    qPos.add(pk);
2348    
2349                                    count = (Long)q.uniqueResult();
2350                            }
2351                            catch (Exception e) {
2352                                    throw processException(e);
2353                            }
2354                            finally {
2355                                    if (count == null) {
2356                                            count = Long.valueOf(0);
2357                                    }
2358    
2359                                    FinderCacheUtil.putResult(FINDER_PATH_GET_SCPRODUCTVERSIONS_SIZE,
2360                                            finderArgs, count);
2361    
2362                                    closeSession(session);
2363                            }
2364                    }
2365    
2366                    return count.intValue();
2367            }
2368    
2369            public static final FinderPath FINDER_PATH_CONTAINS_SCPRODUCTVERSION = new FinderPath(com.liferay.portlet.softwarecatalog.model.impl.SCProductVersionModelImpl.ENTITY_CACHE_ENABLED,
2370                            SCFrameworkVersionModelImpl.FINDER_CACHE_ENABLED_SCFRAMEWORKVERSI_SCPRODUCTVERS,
2371                            SCFrameworkVersionModelImpl.MAPPING_TABLE_SCFRAMEWORKVERSI_SCPRODUCTVERS_NAME,
2372                            "containsSCProductVersion",
2373                            new String[] { Long.class.getName(), Long.class.getName() });
2374    
2375            /**
2376             * Determines if the s c product version is associated with the s c framework version.
2377             *
2378             * @param pk the primary key of the s c framework version
2379             * @param scProductVersionPK the primary key of the s c product version
2380             * @return <code>true</code> if the s c product version is associated with the s c framework version; <code>false</code> otherwise
2381             * @throws SystemException if a system exception occurred
2382             */
2383            public boolean containsSCProductVersion(long pk, long scProductVersionPK)
2384                    throws SystemException {
2385                    Object[] finderArgs = new Object[] { pk, scProductVersionPK };
2386    
2387                    Boolean value = (Boolean)FinderCacheUtil.getResult(FINDER_PATH_CONTAINS_SCPRODUCTVERSION,
2388                                    finderArgs, this);
2389    
2390                    if (value == null) {
2391                            try {
2392                                    value = Boolean.valueOf(containsSCProductVersion.contains(pk,
2393                                                            scProductVersionPK));
2394                            }
2395                            catch (Exception e) {
2396                                    throw processException(e);
2397                            }
2398                            finally {
2399                                    if (value == null) {
2400                                            value = Boolean.FALSE;
2401                                    }
2402    
2403                                    FinderCacheUtil.putResult(FINDER_PATH_CONTAINS_SCPRODUCTVERSION,
2404                                            finderArgs, value);
2405                            }
2406                    }
2407    
2408                    return value.booleanValue();
2409            }
2410    
2411            /**
2412             * Determines if the s c framework version has any s c product versions associated with it.
2413             *
2414             * @param pk the primary key of the s c framework version to check for associations with s c product versions
2415             * @return <code>true</code> if the s c framework version has any s c product versions associated with it; <code>false</code> otherwise
2416             * @throws SystemException if a system exception occurred
2417             */
2418            public boolean containsSCProductVersions(long pk) throws SystemException {
2419                    if (getSCProductVersionsSize(pk) > 0) {
2420                            return true;
2421                    }
2422                    else {
2423                            return false;
2424                    }
2425            }
2426    
2427            /**
2428             * Adds an association between the s c framework version and the s c product version. Also notifies the appropriate model listeners and clears the mapping table finder cache.
2429             *
2430             * @param pk the primary key of the s c framework version
2431             * @param scProductVersionPK the primary key of the s c product version
2432             * @throws SystemException if a system exception occurred
2433             */
2434            public void addSCProductVersion(long pk, long scProductVersionPK)
2435                    throws SystemException {
2436                    try {
2437                            addSCProductVersion.add(pk, scProductVersionPK);
2438                    }
2439                    catch (Exception e) {
2440                            throw processException(e);
2441                    }
2442                    finally {
2443                            FinderCacheUtil.clearCache(SCFrameworkVersionModelImpl.MAPPING_TABLE_SCFRAMEWORKVERSI_SCPRODUCTVERS_NAME);
2444                    }
2445            }
2446    
2447            /**
2448             * Adds an association between the s c framework version and the s c product version. Also notifies the appropriate model listeners and clears the mapping table finder cache.
2449             *
2450             * @param pk the primary key of the s c framework version
2451             * @param scProductVersion the s c product version
2452             * @throws SystemException if a system exception occurred
2453             */
2454            public void addSCProductVersion(long pk,
2455                    com.liferay.portlet.softwarecatalog.model.SCProductVersion scProductVersion)
2456                    throws SystemException {
2457                    try {
2458                            addSCProductVersion.add(pk, scProductVersion.getPrimaryKey());
2459                    }
2460                    catch (Exception e) {
2461                            throw processException(e);
2462                    }
2463                    finally {
2464                            FinderCacheUtil.clearCache(SCFrameworkVersionModelImpl.MAPPING_TABLE_SCFRAMEWORKVERSI_SCPRODUCTVERS_NAME);
2465                    }
2466            }
2467    
2468            /**
2469             * Adds an association between the s c framework version and the s c product versions. Also notifies the appropriate model listeners and clears the mapping table finder cache.
2470             *
2471             * @param pk the primary key of the s c framework version
2472             * @param scProductVersionPKs the primary keys of the s c product versions
2473             * @throws SystemException if a system exception occurred
2474             */
2475            public void addSCProductVersions(long pk, long[] scProductVersionPKs)
2476                    throws SystemException {
2477                    try {
2478                            for (long scProductVersionPK : scProductVersionPKs) {
2479                                    addSCProductVersion.add(pk, scProductVersionPK);
2480                            }
2481                    }
2482                    catch (Exception e) {
2483                            throw processException(e);
2484                    }
2485                    finally {
2486                            FinderCacheUtil.clearCache(SCFrameworkVersionModelImpl.MAPPING_TABLE_SCFRAMEWORKVERSI_SCPRODUCTVERS_NAME);
2487                    }
2488            }
2489    
2490            /**
2491             * Adds an association between the s c framework version and the s c product versions. Also notifies the appropriate model listeners and clears the mapping table finder cache.
2492             *
2493             * @param pk the primary key of the s c framework version
2494             * @param scProductVersions the s c product versions
2495             * @throws SystemException if a system exception occurred
2496             */
2497            public void addSCProductVersions(long pk,
2498                    List<com.liferay.portlet.softwarecatalog.model.SCProductVersion> scProductVersions)
2499                    throws SystemException {
2500                    try {
2501                            for (com.liferay.portlet.softwarecatalog.model.SCProductVersion scProductVersion : scProductVersions) {
2502                                    addSCProductVersion.add(pk, scProductVersion.getPrimaryKey());
2503                            }
2504                    }
2505                    catch (Exception e) {
2506                            throw processException(e);
2507                    }
2508                    finally {
2509                            FinderCacheUtil.clearCache(SCFrameworkVersionModelImpl.MAPPING_TABLE_SCFRAMEWORKVERSI_SCPRODUCTVERS_NAME);
2510                    }
2511            }
2512    
2513            /**
2514             * Clears all associations between the s c framework version and its s c product versions. Also notifies the appropriate model listeners and clears the mapping table finder cache.
2515             *
2516             * @param pk the primary key of the s c framework version to clear the associated s c product versions from
2517             * @throws SystemException if a system exception occurred
2518             */
2519            public void clearSCProductVersions(long pk) throws SystemException {
2520                    try {
2521                            clearSCProductVersions.clear(pk);
2522                    }
2523                    catch (Exception e) {
2524                            throw processException(e);
2525                    }
2526                    finally {
2527                            FinderCacheUtil.clearCache(SCFrameworkVersionModelImpl.MAPPING_TABLE_SCFRAMEWORKVERSI_SCPRODUCTVERS_NAME);
2528                    }
2529            }
2530    
2531            /**
2532             * Removes the association between the s c framework version and the s c product version. Also notifies the appropriate model listeners and clears the mapping table finder cache.
2533             *
2534             * @param pk the primary key of the s c framework version
2535             * @param scProductVersionPK the primary key of the s c product version
2536             * @throws SystemException if a system exception occurred
2537             */
2538            public void removeSCProductVersion(long pk, long scProductVersionPK)
2539                    throws SystemException {
2540                    try {
2541                            removeSCProductVersion.remove(pk, scProductVersionPK);
2542                    }
2543                    catch (Exception e) {
2544                            throw processException(e);
2545                    }
2546                    finally {
2547                            FinderCacheUtil.clearCache(SCFrameworkVersionModelImpl.MAPPING_TABLE_SCFRAMEWORKVERSI_SCPRODUCTVERS_NAME);
2548                    }
2549            }
2550    
2551            /**
2552             * Removes the association between the s c framework version and the s c product version. Also notifies the appropriate model listeners and clears the mapping table finder cache.
2553             *
2554             * @param pk the primary key of the s c framework version
2555             * @param scProductVersion the s c product version
2556             * @throws SystemException if a system exception occurred
2557             */
2558            public void removeSCProductVersion(long pk,
2559                    com.liferay.portlet.softwarecatalog.model.SCProductVersion scProductVersion)
2560                    throws SystemException {
2561                    try {
2562                            removeSCProductVersion.remove(pk, scProductVersion.getPrimaryKey());
2563                    }
2564                    catch (Exception e) {
2565                            throw processException(e);
2566                    }
2567                    finally {
2568                            FinderCacheUtil.clearCache(SCFrameworkVersionModelImpl.MAPPING_TABLE_SCFRAMEWORKVERSI_SCPRODUCTVERS_NAME);
2569                    }
2570            }
2571    
2572            /**
2573             * Removes the association between the s c framework version and the s c product versions. Also notifies the appropriate model listeners and clears the mapping table finder cache.
2574             *
2575             * @param pk the primary key of the s c framework version
2576             * @param scProductVersionPKs the primary keys of the s c product versions
2577             * @throws SystemException if a system exception occurred
2578             */
2579            public void removeSCProductVersions(long pk, long[] scProductVersionPKs)
2580                    throws SystemException {
2581                    try {
2582                            for (long scProductVersionPK : scProductVersionPKs) {
2583                                    removeSCProductVersion.remove(pk, scProductVersionPK);
2584                            }
2585                    }
2586                    catch (Exception e) {
2587                            throw processException(e);
2588                    }
2589                    finally {
2590                            FinderCacheUtil.clearCache(SCFrameworkVersionModelImpl.MAPPING_TABLE_SCFRAMEWORKVERSI_SCPRODUCTVERS_NAME);
2591                    }
2592            }
2593    
2594            /**
2595             * Removes the association between the s c framework version and the s c product versions. Also notifies the appropriate model listeners and clears the mapping table finder cache.
2596             *
2597             * @param pk the primary key of the s c framework version
2598             * @param scProductVersions the s c product versions
2599             * @throws SystemException if a system exception occurred
2600             */
2601            public void removeSCProductVersions(long pk,
2602                    List<com.liferay.portlet.softwarecatalog.model.SCProductVersion> scProductVersions)
2603                    throws SystemException {
2604                    try {
2605                            for (com.liferay.portlet.softwarecatalog.model.SCProductVersion scProductVersion : scProductVersions) {
2606                                    removeSCProductVersion.remove(pk,
2607                                            scProductVersion.getPrimaryKey());
2608                            }
2609                    }
2610                    catch (Exception e) {
2611                            throw processException(e);
2612                    }
2613                    finally {
2614                            FinderCacheUtil.clearCache(SCFrameworkVersionModelImpl.MAPPING_TABLE_SCFRAMEWORKVERSI_SCPRODUCTVERS_NAME);
2615                    }
2616            }
2617    
2618            /**
2619             * Sets the s c product versions associated with the s c framework version, removing and adding associations as necessary. Also notifies the appropriate model listeners and clears the mapping table finder cache.
2620             *
2621             * @param pk the primary key of the s c framework version to set the associations for
2622             * @param scProductVersionPKs the primary keys of the s c product versions to be associated with the s c framework version
2623             * @throws SystemException if a system exception occurred
2624             */
2625            public void setSCProductVersions(long pk, long[] scProductVersionPKs)
2626                    throws SystemException {
2627                    try {
2628                            Set<Long> scProductVersionPKSet = SetUtil.fromArray(scProductVersionPKs);
2629    
2630                            List<com.liferay.portlet.softwarecatalog.model.SCProductVersion> scProductVersions =
2631                                    getSCProductVersions(pk);
2632    
2633                            for (com.liferay.portlet.softwarecatalog.model.SCProductVersion scProductVersion : scProductVersions) {
2634                                    if (!scProductVersionPKSet.remove(
2635                                                            scProductVersion.getPrimaryKey())) {
2636                                            removeSCProductVersion.remove(pk,
2637                                                    scProductVersion.getPrimaryKey());
2638                                    }
2639                            }
2640    
2641                            for (Long scProductVersionPK : scProductVersionPKSet) {
2642                                    addSCProductVersion.add(pk, scProductVersionPK);
2643                            }
2644                    }
2645                    catch (Exception e) {
2646                            throw processException(e);
2647                    }
2648                    finally {
2649                            FinderCacheUtil.clearCache(SCFrameworkVersionModelImpl.MAPPING_TABLE_SCFRAMEWORKVERSI_SCPRODUCTVERS_NAME);
2650                    }
2651            }
2652    
2653            /**
2654             * Sets the s c product versions associated with the s c framework version, removing and adding associations as necessary. Also notifies the appropriate model listeners and clears the mapping table finder cache.
2655             *
2656             * @param pk the primary key of the s c framework version to set the associations for
2657             * @param scProductVersions the s c product versions to be associated with the s c framework version
2658             * @throws SystemException if a system exception occurred
2659             */
2660            public void setSCProductVersions(long pk,
2661                    List<com.liferay.portlet.softwarecatalog.model.SCProductVersion> scProductVersions)
2662                    throws SystemException {
2663                    try {
2664                            long[] scProductVersionPKs = new long[scProductVersions.size()];
2665    
2666                            for (int i = 0; i < scProductVersions.size(); i++) {
2667                                    com.liferay.portlet.softwarecatalog.model.SCProductVersion scProductVersion =
2668                                            scProductVersions.get(i);
2669    
2670                                    scProductVersionPKs[i] = scProductVersion.getPrimaryKey();
2671                            }
2672    
2673                            setSCProductVersions(pk, scProductVersionPKs);
2674                    }
2675                    catch (Exception e) {
2676                            throw processException(e);
2677                    }
2678                    finally {
2679                            FinderCacheUtil.clearCache(SCFrameworkVersionModelImpl.MAPPING_TABLE_SCFRAMEWORKVERSI_SCPRODUCTVERS_NAME);
2680                    }
2681            }
2682    
2683            /**
2684             * Initializes the s c framework version persistence.
2685             */
2686            public void afterPropertiesSet() {
2687                    String[] listenerClassNames = StringUtil.split(GetterUtil.getString(
2688                                            com.liferay.portal.util.PropsUtil.get(
2689                                                    "value.object.listener.com.liferay.portlet.softwarecatalog.model.SCFrameworkVersion")));
2690    
2691                    if (listenerClassNames.length > 0) {
2692                            try {
2693                                    List<ModelListener<SCFrameworkVersion>> listenersList = new ArrayList<ModelListener<SCFrameworkVersion>>();
2694    
2695                                    for (String listenerClassName : listenerClassNames) {
2696                                            listenersList.add((ModelListener<SCFrameworkVersion>)InstanceFactory.newInstance(
2697                                                            listenerClassName));
2698                                    }
2699    
2700                                    listeners = listenersList.toArray(new ModelListener[listenersList.size()]);
2701                            }
2702                            catch (Exception e) {
2703                                    _log.error(e);
2704                            }
2705                    }
2706    
2707                    containsSCProductVersion = new ContainsSCProductVersion(this);
2708    
2709                    addSCProductVersion = new AddSCProductVersion(this);
2710                    clearSCProductVersions = new ClearSCProductVersions(this);
2711                    removeSCProductVersion = new RemoveSCProductVersion(this);
2712            }
2713    
2714            public void destroy() {
2715                    EntityCacheUtil.removeCache(SCFrameworkVersionImpl.class.getName());
2716                    FinderCacheUtil.removeCache(FINDER_CLASS_NAME_ENTITY);
2717                    FinderCacheUtil.removeCache(FINDER_CLASS_NAME_LIST);
2718            }
2719    
2720            @BeanReference(type = SCLicensePersistence.class)
2721            protected SCLicensePersistence scLicensePersistence;
2722            @BeanReference(type = SCFrameworkVersionPersistence.class)
2723            protected SCFrameworkVersionPersistence scFrameworkVersionPersistence;
2724            @BeanReference(type = SCProductEntryPersistence.class)
2725            protected SCProductEntryPersistence scProductEntryPersistence;
2726            @BeanReference(type = SCProductScreenshotPersistence.class)
2727            protected SCProductScreenshotPersistence scProductScreenshotPersistence;
2728            @BeanReference(type = SCProductVersionPersistence.class)
2729            protected SCProductVersionPersistence scProductVersionPersistence;
2730            @BeanReference(type = ResourcePersistence.class)
2731            protected ResourcePersistence resourcePersistence;
2732            @BeanReference(type = UserPersistence.class)
2733            protected UserPersistence userPersistence;
2734            protected ContainsSCProductVersion containsSCProductVersion;
2735            protected AddSCProductVersion addSCProductVersion;
2736            protected ClearSCProductVersions clearSCProductVersions;
2737            protected RemoveSCProductVersion removeSCProductVersion;
2738    
2739            protected class ContainsSCProductVersion {
2740                    protected ContainsSCProductVersion(
2741                            SCFrameworkVersionPersistenceImpl persistenceImpl) {
2742                            super();
2743    
2744                            _mappingSqlQuery = MappingSqlQueryFactoryUtil.getMappingSqlQuery(getDataSource(),
2745                                            _SQL_CONTAINSSCPRODUCTVERSION,
2746                                            new int[] { java.sql.Types.BIGINT, java.sql.Types.BIGINT },
2747                                            RowMapper.COUNT);
2748                    }
2749    
2750                    protected boolean contains(long frameworkVersionId,
2751                            long productVersionId) {
2752                            List<Integer> results = _mappingSqlQuery.execute(new Object[] {
2753                                                    new Long(frameworkVersionId), new Long(productVersionId)
2754                                            });
2755    
2756                            if (results.size() > 0) {
2757                                    Integer count = results.get(0);
2758    
2759                                    if (count.intValue() > 0) {
2760                                            return true;
2761                                    }
2762                            }
2763    
2764                            return false;
2765                    }
2766    
2767                    private MappingSqlQuery<Integer> _mappingSqlQuery;
2768            }
2769    
2770            protected class AddSCProductVersion {
2771                    protected AddSCProductVersion(
2772                            SCFrameworkVersionPersistenceImpl persistenceImpl) {
2773                            _sqlUpdate = SqlUpdateFactoryUtil.getSqlUpdate(getDataSource(),
2774                                            "INSERT INTO SCFrameworkVersi_SCProductVers (frameworkVersionId, productVersionId) VALUES (?, ?)",
2775                                            new int[] { java.sql.Types.BIGINT, java.sql.Types.BIGINT });
2776                            _persistenceImpl = persistenceImpl;
2777                    }
2778    
2779                    protected void add(long frameworkVersionId, long productVersionId)
2780                            throws SystemException {
2781                            if (!_persistenceImpl.containsSCProductVersion.contains(
2782                                                    frameworkVersionId, productVersionId)) {
2783                                    ModelListener<com.liferay.portlet.softwarecatalog.model.SCProductVersion>[] scProductVersionListeners =
2784                                            scProductVersionPersistence.getListeners();
2785    
2786                                    for (ModelListener<SCFrameworkVersion> listener : listeners) {
2787                                            listener.onBeforeAddAssociation(frameworkVersionId,
2788                                                    com.liferay.portlet.softwarecatalog.model.SCProductVersion.class.getName(),
2789                                                    productVersionId);
2790                                    }
2791    
2792                                    for (ModelListener<com.liferay.portlet.softwarecatalog.model.SCProductVersion> listener : scProductVersionListeners) {
2793                                            listener.onBeforeAddAssociation(productVersionId,
2794                                                    SCFrameworkVersion.class.getName(), frameworkVersionId);
2795                                    }
2796    
2797                                    _sqlUpdate.update(new Object[] {
2798                                                    new Long(frameworkVersionId), new Long(productVersionId)
2799                                            });
2800    
2801                                    for (ModelListener<SCFrameworkVersion> listener : listeners) {
2802                                            listener.onAfterAddAssociation(frameworkVersionId,
2803                                                    com.liferay.portlet.softwarecatalog.model.SCProductVersion.class.getName(),
2804                                                    productVersionId);
2805                                    }
2806    
2807                                    for (ModelListener<com.liferay.portlet.softwarecatalog.model.SCProductVersion> listener : scProductVersionListeners) {
2808                                            listener.onAfterAddAssociation(productVersionId,
2809                                                    SCFrameworkVersion.class.getName(), frameworkVersionId);
2810                                    }
2811                            }
2812                    }
2813    
2814                    private SqlUpdate _sqlUpdate;
2815                    private SCFrameworkVersionPersistenceImpl _persistenceImpl;
2816            }
2817    
2818            protected class ClearSCProductVersions {
2819                    protected ClearSCProductVersions(
2820                            SCFrameworkVersionPersistenceImpl persistenceImpl) {
2821                            _sqlUpdate = SqlUpdateFactoryUtil.getSqlUpdate(getDataSource(),
2822                                            "DELETE FROM SCFrameworkVersi_SCProductVers WHERE frameworkVersionId = ?",
2823                                            new int[] { java.sql.Types.BIGINT });
2824                    }
2825    
2826                    protected void clear(long frameworkVersionId) throws SystemException {
2827                            ModelListener<com.liferay.portlet.softwarecatalog.model.SCProductVersion>[] scProductVersionListeners =
2828                                    scProductVersionPersistence.getListeners();
2829    
2830                            List<com.liferay.portlet.softwarecatalog.model.SCProductVersion> scProductVersions =
2831                                    null;
2832    
2833                            if ((listeners.length > 0) ||
2834                                            (scProductVersionListeners.length > 0)) {
2835                                    scProductVersions = getSCProductVersions(frameworkVersionId);
2836    
2837                                    for (com.liferay.portlet.softwarecatalog.model.SCProductVersion scProductVersion : scProductVersions) {
2838                                            for (ModelListener<SCFrameworkVersion> listener : listeners) {
2839                                                    listener.onBeforeRemoveAssociation(frameworkVersionId,
2840                                                            com.liferay.portlet.softwarecatalog.model.SCProductVersion.class.getName(),
2841                                                            scProductVersion.getPrimaryKey());
2842                                            }
2843    
2844                                            for (ModelListener<com.liferay.portlet.softwarecatalog.model.SCProductVersion> listener : scProductVersionListeners) {
2845                                                    listener.onBeforeRemoveAssociation(scProductVersion.getPrimaryKey(),
2846                                                            SCFrameworkVersion.class.getName(),
2847                                                            frameworkVersionId);
2848                                            }
2849                                    }
2850                            }
2851    
2852                            _sqlUpdate.update(new Object[] { new Long(frameworkVersionId) });
2853    
2854                            if ((listeners.length > 0) ||
2855                                            (scProductVersionListeners.length > 0)) {
2856                                    for (com.liferay.portlet.softwarecatalog.model.SCProductVersion scProductVersion : scProductVersions) {
2857                                            for (ModelListener<SCFrameworkVersion> listener : listeners) {
2858                                                    listener.onAfterRemoveAssociation(frameworkVersionId,
2859                                                            com.liferay.portlet.softwarecatalog.model.SCProductVersion.class.getName(),
2860                                                            scProductVersion.getPrimaryKey());
2861                                            }
2862    
2863                                            for (ModelListener<com.liferay.portlet.softwarecatalog.model.SCProductVersion> listener : scProductVersionListeners) {
2864                                                    listener.onAfterRemoveAssociation(scProductVersion.getPrimaryKey(),
2865                                                            SCFrameworkVersion.class.getName(),
2866                                                            frameworkVersionId);
2867                                            }
2868                                    }
2869                            }
2870                    }
2871    
2872                    private SqlUpdate _sqlUpdate;
2873            }
2874    
2875            protected class RemoveSCProductVersion {
2876                    protected RemoveSCProductVersion(
2877                            SCFrameworkVersionPersistenceImpl persistenceImpl) {
2878                            _sqlUpdate = SqlUpdateFactoryUtil.getSqlUpdate(getDataSource(),
2879                                            "DELETE FROM SCFrameworkVersi_SCProductVers WHERE frameworkVersionId = ? AND productVersionId = ?",
2880                                            new int[] { java.sql.Types.BIGINT, java.sql.Types.BIGINT });
2881                            _persistenceImpl = persistenceImpl;
2882                    }
2883    
2884                    protected void remove(long frameworkVersionId, long productVersionId)
2885                            throws SystemException {
2886                            if (_persistenceImpl.containsSCProductVersion.contains(
2887                                                    frameworkVersionId, productVersionId)) {
2888                                    ModelListener<com.liferay.portlet.softwarecatalog.model.SCProductVersion>[] scProductVersionListeners =
2889                                            scProductVersionPersistence.getListeners();
2890    
2891                                    for (ModelListener<SCFrameworkVersion> listener : listeners) {
2892                                            listener.onBeforeRemoveAssociation(frameworkVersionId,
2893                                                    com.liferay.portlet.softwarecatalog.model.SCProductVersion.class.getName(),
2894                                                    productVersionId);
2895                                    }
2896    
2897                                    for (ModelListener<com.liferay.portlet.softwarecatalog.model.SCProductVersion> listener : scProductVersionListeners) {
2898                                            listener.onBeforeRemoveAssociation(productVersionId,
2899                                                    SCFrameworkVersion.class.getName(), frameworkVersionId);
2900                                    }
2901    
2902                                    _sqlUpdate.update(new Object[] {
2903                                                    new Long(frameworkVersionId), new Long(productVersionId)
2904                                            });
2905    
2906                                    for (ModelListener<SCFrameworkVersion> listener : listeners) {
2907                                            listener.onAfterRemoveAssociation(frameworkVersionId,
2908                                                    com.liferay.portlet.softwarecatalog.model.SCProductVersion.class.getName(),
2909                                                    productVersionId);
2910                                    }
2911    
2912                                    for (ModelListener<com.liferay.portlet.softwarecatalog.model.SCProductVersion> listener : scProductVersionListeners) {
2913                                            listener.onAfterRemoveAssociation(productVersionId,
2914                                                    SCFrameworkVersion.class.getName(), frameworkVersionId);
2915                                    }
2916                            }
2917                    }
2918    
2919                    private SqlUpdate _sqlUpdate;
2920                    private SCFrameworkVersionPersistenceImpl _persistenceImpl;
2921            }
2922    
2923            private static final String _SQL_SELECT_SCFRAMEWORKVERSION = "SELECT scFrameworkVersion FROM SCFrameworkVersion scFrameworkVersion";
2924            private static final String _SQL_SELECT_SCFRAMEWORKVERSION_WHERE = "SELECT scFrameworkVersion FROM SCFrameworkVersion scFrameworkVersion WHERE ";
2925            private static final String _SQL_COUNT_SCFRAMEWORKVERSION = "SELECT COUNT(scFrameworkVersion) FROM SCFrameworkVersion scFrameworkVersion";
2926            private static final String _SQL_COUNT_SCFRAMEWORKVERSION_WHERE = "SELECT COUNT(scFrameworkVersion) FROM SCFrameworkVersion scFrameworkVersion WHERE ";
2927            private static final String _SQL_GETSCPRODUCTVERSIONS = "SELECT {SCProductVersion.*} FROM SCProductVersion INNER JOIN SCFrameworkVersi_SCProductVers ON (SCFrameworkVersi_SCProductVers.productVersionId = SCProductVersion.productVersionId) WHERE (SCFrameworkVersi_SCProductVers.frameworkVersionId = ?)";
2928            private static final String _SQL_GETSCPRODUCTVERSIONSSIZE = "SELECT COUNT(*) AS COUNT_VALUE FROM SCFrameworkVersi_SCProductVers WHERE frameworkVersionId = ?";
2929            private static final String _SQL_CONTAINSSCPRODUCTVERSION = "SELECT COUNT(*) AS COUNT_VALUE FROM SCFrameworkVersi_SCProductVers WHERE frameworkVersionId = ? AND productVersionId = ?";
2930            private static final String _FINDER_COLUMN_GROUPID_GROUPID_2 = "scFrameworkVersion.groupId = ?";
2931            private static final String _FINDER_COLUMN_COMPANYID_COMPANYID_2 = "scFrameworkVersion.companyId = ?";
2932            private static final String _FINDER_COLUMN_G_A_GROUPID_2 = "scFrameworkVersion.groupId = ? AND ";
2933            private static final String _FINDER_COLUMN_G_A_ACTIVE_2 = "scFrameworkVersion.active = ?";
2934            private static final String _FILTER_SQL_SELECT_SCFRAMEWORKVERSION_WHERE = "SELECT DISTINCT {scFrameworkVersion.*} FROM SCFrameworkVersion scFrameworkVersion WHERE ";
2935            private static final String _FILTER_SQL_SELECT_SCFRAMEWORKVERSION_NO_INLINE_DISTINCT_WHERE_1 =
2936                    "SELECT {SCFrameworkVersion.*} FROM (SELECT DISTINCT scFrameworkVersion.frameworkVersionId FROM SCFrameworkVersion scFrameworkVersion WHERE ";
2937            private static final String _FILTER_SQL_SELECT_SCFRAMEWORKVERSION_NO_INLINE_DISTINCT_WHERE_2 =
2938                    ") TEMP_TABLE INNER JOIN SCFrameworkVersion ON TEMP_TABLE.frameworkVersionId = SCFrameworkVersion.frameworkVersionId";
2939            private static final String _FILTER_SQL_COUNT_SCFRAMEWORKVERSION_WHERE = "SELECT COUNT(DISTINCT scFrameworkVersion.frameworkVersionId) AS COUNT_VALUE FROM SCFrameworkVersion scFrameworkVersion WHERE ";
2940            private static final String _FILTER_COLUMN_PK = "scFrameworkVersion.frameworkVersionId";
2941            private static final String _FILTER_COLUMN_USERID = "scFrameworkVersion.userId";
2942            private static final String _FILTER_ENTITY_ALIAS = "scFrameworkVersion";
2943            private static final String _FILTER_ENTITY_TABLE = "SCFrameworkVersion";
2944            private static final String _ORDER_BY_ENTITY_ALIAS = "scFrameworkVersion.";
2945            private static final String _ORDER_BY_ENTITY_TABLE = "SCFrameworkVersion.";
2946            private static final String _NO_SUCH_ENTITY_WITH_PRIMARY_KEY = "No SCFrameworkVersion exists with the primary key ";
2947            private static final String _NO_SUCH_ENTITY_WITH_KEY = "No SCFrameworkVersion exists with the key {";
2948            private static Log _log = LogFactoryUtil.getLog(SCFrameworkVersionPersistenceImpl.class);
2949    }