Package com.arcusys.learn.persistence.liferay.model

Examples of com.arcusys.learn.persistence.liferay.model.LFPackageScopeRule


     */
    @Override
    public LFPackageScopeRule findByPackageIDAndScope(Integer packageID,
        String scope, String scopeID)
        throws NoSuchLFPackageScopeRuleException, SystemException {
        LFPackageScopeRule lfPackageScopeRule = fetchByPackageIDAndScope(packageID,
                scope, scopeID);

        if (lfPackageScopeRule == null) {
            StringBundler msg = new StringBundler(8);

View Full Code Here


            result = FinderCacheUtil.getResult(FINDER_PATH_FETCH_BY_PACKAGEIDANDSCOPE,
                    finderArgs, this);
        }

        if (result instanceof LFPackageScopeRule) {
            LFPackageScopeRule lfPackageScopeRule = (LFPackageScopeRule) result;

            if (!Validator.equals(packageID, lfPackageScopeRule.getPackageID()) ||
                    !Validator.equals(scope, lfPackageScopeRule.getScope()) ||
                    !Validator.equals(scopeID, lfPackageScopeRule.getScopeID())) {
                result = null;
            }
        }

        if (result == null) {
            StringBundler query = new StringBundler(5);

            query.append(_SQL_SELECT_LFPACKAGESCOPERULE_WHERE);

            if (packageID == null) {
                query.append(_FINDER_COLUMN_PACKAGEIDANDSCOPE_PACKAGEID_NULL_2);
            } else {
                query.append(_FINDER_COLUMN_PACKAGEIDANDSCOPE_PACKAGEID_2);
            }

            boolean bindScope = false;

            if (scope == null) {
                query.append(_FINDER_COLUMN_PACKAGEIDANDSCOPE_SCOPE_1);
            } else if (scope.equals(StringPool.BLANK)) {
                query.append(_FINDER_COLUMN_PACKAGEIDANDSCOPE_SCOPE_3);
            } else {
                bindScope = true;

                if (scope.equals(StringPool.BLANK)) {
                    query.append(_FINDER_COLUMN_PACKAGEIDANDSCOPE_SCOPE_3);
                } else {
                    query.append(_FINDER_COLUMN_PACKAGEIDANDSCOPE_SCOPE_2);
                }
            }

            boolean bindScopeID = false;

            if (scopeID == null) {
                query.append(_FINDER_COLUMN_PACKAGEIDANDSCOPE_SCOPEID_1);
            } else if (scopeID.equals(StringPool.BLANK)) {
                query.append(_FINDER_COLUMN_PACKAGEIDANDSCOPE_SCOPEID_3);
            } else {
                bindScopeID = true;

                if (scopeID.equals(StringPool.BLANK)) {
                    query.append(_FINDER_COLUMN_PACKAGEIDANDSCOPE_SCOPEID_3);
                } else {
                    query.append(_FINDER_COLUMN_PACKAGEIDANDSCOPE_SCOPEID_2);
                }
            }

            String sql = query.toString();

            Session session = null;

            try {
                session = openSession();

                Query q = session.createQuery(sql);

                QueryPos qPos = QueryPos.getInstance(q);

                if (packageID != null) {
                    qPos.add(packageID.intValue());
                }

                if (bindScope) {
                    if (scope != null) {
                        qPos.add(scope);
                    }
                }

                if (bindScopeID) {
                    if (scopeID != null) {
                        qPos.add(scopeID);
                    }
                }

                List<LFPackageScopeRule> list = q.list();

                if (list.isEmpty()) {
                    FinderCacheUtil.putResult(FINDER_PATH_FETCH_BY_PACKAGEIDANDSCOPE,
                        finderArgs, list);
                } else {
                    if ((list.size() > 1) && _log.isWarnEnabled()) {
                        _log.warn(
                            "LFPackageScopeRulePersistenceImpl.fetchByPackageIDAndScope(Integer, String, String, boolean) with parameters (" +
                            StringUtil.merge(finderArgs) +
                            ") yields a result set with more than 1 result. This violates the logical unique restriction. There is no order guarantee on which result is returned by this finder.");
                    }

                    LFPackageScopeRule lfPackageScopeRule = list.get(0);

                    result = lfPackageScopeRule;

                    cacheResult(lfPackageScopeRule);

                    if ((lfPackageScopeRule.getPackageID() != packageID) ||
                            (lfPackageScopeRule.getScope() == null) ||
                            !lfPackageScopeRule.getScope().equals(scope) ||
                            (lfPackageScopeRule.getScopeID() == null) ||
                            !lfPackageScopeRule.getScopeID().equals(scopeID)) {
                        FinderCacheUtil.putResult(FINDER_PATH_FETCH_BY_PACKAGEIDANDSCOPE,
                            finderArgs, lfPackageScopeRule);
                    }
                }
            } catch (Exception e) {
View Full Code Here

     */
    @Override
    public LFPackageScopeRule removeByPackageIDAndScope(Integer packageID,
        String scope, String scopeID)
        throws NoSuchLFPackageScopeRuleException, SystemException {
        LFPackageScopeRule lfPackageScopeRule = findByPackageIDAndScope(packageID,
                scope, scopeID);

        return remove(lfPackageScopeRule);
    }
View Full Code Here

    @Override
    public LFPackageScopeRule findByAllByPackageIDAndScope_First(
        Integer packageID, String scope, String scopeID,
        OrderByComparator orderByComparator)
        throws NoSuchLFPackageScopeRuleException, SystemException {
        LFPackageScopeRule lfPackageScopeRule = fetchByAllByPackageIDAndScope_First(packageID,
                scope, scopeID, orderByComparator);

        if (lfPackageScopeRule != null) {
            return lfPackageScopeRule;
        }
View Full Code Here

    @Override
    public LFPackageScopeRule findByAllByPackageIDAndScope_Last(
        Integer packageID, String scope, String scopeID,
        OrderByComparator orderByComparator)
        throws NoSuchLFPackageScopeRuleException, SystemException {
        LFPackageScopeRule lfPackageScopeRule = fetchByAllByPackageIDAndScope_Last(packageID,
                scope, scopeID, orderByComparator);

        if (lfPackageScopeRule != null) {
            return lfPackageScopeRule;
        }
View Full Code Here

    @Override
    public LFPackageScopeRule[] findByAllByPackageIDAndScope_PrevAndNext(
        long id, Integer packageID, String scope, String scopeID,
        OrderByComparator orderByComparator)
        throws NoSuchLFPackageScopeRuleException, SystemException {
        LFPackageScopeRule lfPackageScopeRule = findByPrimaryKey(id);

        Session session = null;

        try {
            session = openSession();
View Full Code Here

     */
    @Override
    public LFPackageScopeRule findByVisibility_First(String scope,
        String scopeID, Boolean visibility, OrderByComparator orderByComparator)
        throws NoSuchLFPackageScopeRuleException, SystemException {
        LFPackageScopeRule lfPackageScopeRule = fetchByVisibility_First(scope,
                scopeID, visibility, orderByComparator);

        if (lfPackageScopeRule != null) {
            return lfPackageScopeRule;
        }
View Full Code Here

     */
    @Override
    public LFPackageScopeRule findByVisibility_Last(String scope,
        String scopeID, Boolean visibility, OrderByComparator orderByComparator)
        throws NoSuchLFPackageScopeRuleException, SystemException {
        LFPackageScopeRule lfPackageScopeRule = fetchByVisibility_Last(scope,
                scopeID, visibility, orderByComparator);

        if (lfPackageScopeRule != null) {
            return lfPackageScopeRule;
        }
View Full Code Here

    @Override
    public LFPackageScopeRule[] findByVisibility_PrevAndNext(long id,
        String scope, String scopeID, Boolean visibility,
        OrderByComparator orderByComparator)
        throws NoSuchLFPackageScopeRuleException, SystemException {
        LFPackageScopeRule lfPackageScopeRule = findByPrimaryKey(id);

        Session session = null;

        try {
            session = openSession();
View Full Code Here

     * @param id the primary key for the new l f package scope rule
     * @return the new l f package scope rule
     */
    @Override
    public LFPackageScopeRule create(long id) {
        LFPackageScopeRule lfPackageScopeRule = new LFPackageScopeRuleImpl();

        lfPackageScopeRule.setNew(true);
        lfPackageScopeRule.setPrimaryKey(id);

        return lfPackageScopeRule;
    }
View Full Code Here

TOP

Related Classes of com.arcusys.learn.persistence.liferay.model.LFPackageScopeRule

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.