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

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


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

        LFPackageGradeStorage lfPackageGradeStorage = (LFPackageGradeStorage) obj;

        LFPackageGradeStoragePK primaryKey = lfPackageGradeStorage.getPrimaryKey();

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


     * @throws SystemException if a system exception occurred
     */
    @Override
    public LFPackageGradeStorage findByGrade(Long userId, Long packageId)
        throws NoSuchLFPackageGradeStorageException, SystemException {
        LFPackageGradeStorage lfPackageGradeStorage = fetchByGrade(userId,
                packageId);

        if (lfPackageGradeStorage == null) {
            StringBundler msg = new StringBundler(6);

View Full Code Here

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

        if (result instanceof LFPackageGradeStorage) {
            LFPackageGradeStorage lfPackageGradeStorage = (LFPackageGradeStorage) result;

            if (!Validator.equals(userId, lfPackageGradeStorage.getUserId()) ||
                    !Validator.equals(packageId,
                        lfPackageGradeStorage.getPackageId())) {
                result = null;
            }
        }

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

            query.append(_SQL_SELECT_LFPACKAGEGRADESTORAGE_WHERE);

            if (userId == null) {
                query.append(_FINDER_COLUMN_GRADE_USERID_NULL_2);
            } else {
                query.append(_FINDER_COLUMN_GRADE_USERID_2);
            }

            if (packageId == null) {
                query.append(_FINDER_COLUMN_GRADE_PACKAGEID_NULL_2);
            } else {
                query.append(_FINDER_COLUMN_GRADE_PACKAGEID_2);
            }

            String sql = query.toString();

            Session session = null;

            try {
                session = openSession();

                Query q = session.createQuery(sql);

                QueryPos qPos = QueryPos.getInstance(q);

                if (userId != null) {
                    qPos.add(userId.longValue());
                }

                if (packageId != null) {
                    qPos.add(packageId.longValue());
                }

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

                if (list.isEmpty()) {
                    FinderCacheUtil.putResult(FINDER_PATH_FETCH_BY_GRADE,
                        finderArgs, list);
                } else {
                    if ((list.size() > 1) && _log.isWarnEnabled()) {
                        _log.warn(
                            "LFPackageGradeStoragePersistenceImpl.fetchByGrade(Long, Long, 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.");
                    }

                    LFPackageGradeStorage lfPackageGradeStorage = list.get(0);

                    result = lfPackageGradeStorage;

                    cacheResult(lfPackageGradeStorage);

                    if ((lfPackageGradeStorage.getUserId() != userId) ||
                            (lfPackageGradeStorage.getPackageId() != packageId)) {
                        FinderCacheUtil.putResult(FINDER_PATH_FETCH_BY_GRADE,
                            finderArgs, lfPackageGradeStorage);
                    }
                }
            } catch (Exception e) {
View Full Code Here

     * @throws SystemException if a system exception occurred
     */
    @Override
    public LFPackageGradeStorage removeByGrade(Long userId, Long packageId)
        throws NoSuchLFPackageGradeStorageException, SystemException {
        LFPackageGradeStorage lfPackageGradeStorage = findByGrade(userId,
                packageId);

        return remove(lfPackageGradeStorage);
    }
View Full Code Here

     * @return the new l f package grade storage
     */
    @Override
    public LFPackageGradeStorage create(
        LFPackageGradeStoragePK lfPackageGradeStoragePK) {
        LFPackageGradeStorage lfPackageGradeStorage = new LFPackageGradeStorageImpl();

        lfPackageGradeStorage.setNew(true);
        lfPackageGradeStorage.setPrimaryKey(lfPackageGradeStoragePK);

        return lfPackageGradeStorage;
    }
View Full Code Here

        Session session = null;

        try {
            session = openSession();

            LFPackageGradeStorage lfPackageGradeStorage = (LFPackageGradeStorage) session.get(LFPackageGradeStorageImpl.class,
                    primaryKey);

            if (lfPackageGradeStorage == null) {
                if (_log.isWarnEnabled()) {
                    _log.warn(_NO_SUCH_ENTITY_WITH_PRIMARY_KEY + primaryKey);
View Full Code Here

     * @throws SystemException if a system exception occurred
     */
    @Override
    public LFPackageGradeStorage findByPrimaryKey(Serializable primaryKey)
        throws NoSuchLFPackageGradeStorageException, SystemException {
        LFPackageGradeStorage lfPackageGradeStorage = fetchByPrimaryKey(primaryKey);

        if (lfPackageGradeStorage == null) {
            if (_log.isWarnEnabled()) {
                _log.warn(_NO_SUCH_ENTITY_WITH_PRIMARY_KEY + primaryKey);
            }
View Full Code Here

     * @throws SystemException if a system exception occurred
     */
    @Override
    public LFPackageGradeStorage fetchByPrimaryKey(Serializable primaryKey)
        throws SystemException {
        LFPackageGradeStorage lfPackageGradeStorage = (LFPackageGradeStorage) EntityCacheUtil.getResult(LFPackageGradeStorageModelImpl.ENTITY_CACHE_ENABLED,
                LFPackageGradeStorageImpl.class, primaryKey);

        if (lfPackageGradeStorage == _nullLFPackageGradeStorage) {
            return null;
        }
View Full Code Here

TOP

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

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.