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

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


        if (!(obj instanceof LFPackageScopeRule)) {
            return false;
        }

        LFPackageScopeRule lfPackageScopeRule = (LFPackageScopeRule) obj;

        long primaryKey = lfPackageScopeRule.getPrimaryKey();

        if (getPrimaryKey() == primaryKey) {
            return true;
        } else {
            return false;
View Full Code Here


     */
    @Override
    public LFPackageScopeRule findByPackageID_First(Integer packageID,
        OrderByComparator orderByComparator)
        throws NoSuchLFPackageScopeRuleException, SystemException {
        LFPackageScopeRule lfPackageScopeRule = fetchByPackageID_First(packageID,
                orderByComparator);

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

     */
    @Override
    public LFPackageScopeRule findByPackageID_Last(Integer packageID,
        OrderByComparator orderByComparator)
        throws NoSuchLFPackageScopeRuleException, SystemException {
        LFPackageScopeRule lfPackageScopeRule = fetchByPackageID_Last(packageID,
                orderByComparator);

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

     */
    @Override
    public LFPackageScopeRule[] findByPackageID_PrevAndNext(long id,
        Integer packageID, OrderByComparator orderByComparator)
        throws NoSuchLFPackageScopeRuleException, SystemException {
        LFPackageScopeRule lfPackageScopeRule = findByPrimaryKey(id);

        Session session = null;

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

     */
    @Override
    public LFPackageScopeRule findByScopeAndIsDefault(String scope,
        String scopeID, Boolean isDefault)
        throws NoSuchLFPackageScopeRuleException, SystemException {
        LFPackageScopeRule lfPackageScopeRule = fetchByScopeAndIsDefault(scope,
                scopeID, isDefault);

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

View Full Code Here

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

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

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

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

            query.append(_SQL_SELECT_LFPACKAGESCOPERULE_WHERE);

            boolean bindScope = false;

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

                if (scope.equals(StringPool.BLANK)) {
                    query.append(_FINDER_COLUMN_SCOPEANDISDEFAULT_SCOPE_3);
                } else {
                    query.append(_FINDER_COLUMN_SCOPEANDISDEFAULT_SCOPE_2);
                }
            }

            boolean bindScopeID = false;

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

                if (scopeID.equals(StringPool.BLANK)) {
                    query.append(_FINDER_COLUMN_SCOPEANDISDEFAULT_SCOPEID_3);
                } else {
                    query.append(_FINDER_COLUMN_SCOPEANDISDEFAULT_SCOPEID_2);
                }
            }

            if (isDefault == null) {
                query.append(_FINDER_COLUMN_SCOPEANDISDEFAULT_ISDEFAULT_NULL_2);
            } else {
                query.append(_FINDER_COLUMN_SCOPEANDISDEFAULT_ISDEFAULT_2);
            }

            String sql = query.toString();

            Session session = null;

            try {
                session = openSession();

                Query q = session.createQuery(sql);

                QueryPos qPos = QueryPos.getInstance(q);

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

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

                if (isDefault != null) {
                    qPos.add(isDefault.booleanValue());
                }

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

                if (list.isEmpty()) {
                    FinderCacheUtil.putResult(FINDER_PATH_FETCH_BY_SCOPEANDISDEFAULT,
                        finderArgs, list);
                } else {
                    if ((list.size() > 1) && _log.isWarnEnabled()) {
                        _log.warn(
                            "LFPackageScopeRulePersistenceImpl.fetchByScopeAndIsDefault(String, String, Boolean, 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.getScope() == null) ||
                            !lfPackageScopeRule.getScope().equals(scope) ||
                            (lfPackageScopeRule.getScopeID() == null) ||
                            !lfPackageScopeRule.getScopeID().equals(scopeID) ||
                            (lfPackageScopeRule.getIsDefault() != isDefault)) {
                        FinderCacheUtil.putResult(FINDER_PATH_FETCH_BY_SCOPEANDISDEFAULT,
                            finderArgs, lfPackageScopeRule);
                    }
                }
            } catch (Exception e) {
View Full Code Here

     */
    @Override
    public LFPackageScopeRule removeByScopeAndIsDefault(String scope,
        String scopeID, Boolean isDefault)
        throws NoSuchLFPackageScopeRuleException, SystemException {
        LFPackageScopeRule lfPackageScopeRule = findByScopeAndIsDefault(scope,
                scopeID, isDefault);

        return remove(lfPackageScopeRule);
    }
View Full Code Here

     */
    @Override
    public LFPackageScopeRule findByScope_First(String scope, String scopeID,
        OrderByComparator orderByComparator)
        throws NoSuchLFPackageScopeRuleException, SystemException {
        LFPackageScopeRule lfPackageScopeRule = fetchByScope_First(scope,
                scopeID, orderByComparator);

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

     */
    @Override
    public LFPackageScopeRule findByScope_Last(String scope, String scopeID,
        OrderByComparator orderByComparator)
        throws NoSuchLFPackageScopeRuleException, SystemException {
        LFPackageScopeRule lfPackageScopeRule = fetchByScope_Last(scope,
                scopeID, orderByComparator);

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

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

        Session session = null;

        try {
            session = openSession();
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.