Examples of LFCourse


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

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

        LFCourse lfCourse = (LFCourse) obj;

        long primaryKey = lfCourse.getPrimaryKey();

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

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

     * @throws SystemException if a system exception occurred
     */
    @Override
    public LFCourse findByCourseIdAndUserId(Integer courseID, Integer userID)
        throws NoSuchLFCourseException, SystemException {
        LFCourse lfCourse = fetchByCourseIdAndUserId(courseID, userID);

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

            msg.append(_NO_SUCH_ENTITY_WITH_KEY);
View Full Code Here

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

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

        if (result instanceof LFCourse) {
            LFCourse lfCourse = (LFCourse) result;

            if (!Validator.equals(courseID, lfCourse.getCourseID()) ||
                    !Validator.equals(userID, lfCourse.getUserID())) {
                result = null;
            }
        }

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

            query.append(_SQL_SELECT_LFCOURSE_WHERE);

            if (courseID == null) {
                query.append(_FINDER_COLUMN_COURSEIDANDUSERID_COURSEID_NULL_2);
            } else {
                query.append(_FINDER_COLUMN_COURSEIDANDUSERID_COURSEID_2);
            }

            if (userID == null) {
                query.append(_FINDER_COLUMN_COURSEIDANDUSERID_USERID_NULL_2);
            } else {
                query.append(_FINDER_COLUMN_COURSEIDANDUSERID_USERID_2);
            }

            String sql = query.toString();

            Session session = null;

            try {
                session = openSession();

                Query q = session.createQuery(sql);

                QueryPos qPos = QueryPos.getInstance(q);

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

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

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

                if (list.isEmpty()) {
                    FinderCacheUtil.putResult(FINDER_PATH_FETCH_BY_COURSEIDANDUSERID,
                        finderArgs, list);
                } else {
                    if ((list.size() > 1) && _log.isWarnEnabled()) {
                        _log.warn(
                            "LFCoursePersistenceImpl.fetchByCourseIdAndUserId(Integer, Integer, 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.");
                    }

                    LFCourse lfCourse = list.get(0);

                    result = lfCourse;

                    cacheResult(lfCourse);

                    if ((lfCourse.getCourseID() != courseID) ||
                            (lfCourse.getUserID() != userID)) {
                        FinderCacheUtil.putResult(FINDER_PATH_FETCH_BY_COURSEIDANDUSERID,
                            finderArgs, lfCourse);
                    }
                }
            } catch (Exception e) {
View Full Code Here

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

     * @throws SystemException if a system exception occurred
     */
    @Override
    public LFCourse removeByCourseIdAndUserId(Integer courseID, Integer userID)
        throws NoSuchLFCourseException, SystemException {
        LFCourse lfCourse = findByCourseIdAndUserId(courseID, userID);

        return remove(lfCourse);
    }
View Full Code Here

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

     * @throws SystemException if a system exception occurred
     */
    @Override
    public LFCourse findByGrade(String grade)
        throws NoSuchLFCourseException, SystemException {
        LFCourse lfCourse = fetchByGrade(grade);

        if (lfCourse == null) {
            StringBundler msg = new StringBundler(4);

            msg.append(_NO_SUCH_ENTITY_WITH_KEY);
View Full Code Here

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

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

        if (result instanceof LFCourse) {
            LFCourse lfCourse = (LFCourse) result;

            if (!Validator.equals(grade, lfCourse.getGrade())) {
                result = null;
            }
        }

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

            query.append(_SQL_SELECT_LFCOURSE_WHERE);

            boolean bindGrade = false;

            if (grade == null) {
                query.append(_FINDER_COLUMN_GRADE_GRADE_1);
            } else if (grade.equals(StringPool.BLANK)) {
                query.append(_FINDER_COLUMN_GRADE_GRADE_3);
            } else {
                bindGrade = true;

                if (grade.equals(StringPool.BLANK)) {
                    query.append(_FINDER_COLUMN_GRADE_GRADE_3);
                } else {
                    query.append(_FINDER_COLUMN_GRADE_GRADE_2);
                }
            }

            String sql = query.toString();

            Session session = null;

            try {
                session = openSession();

                Query q = session.createQuery(sql);

                QueryPos qPos = QueryPos.getInstance(q);

                if (bindGrade) {
                    if (grade != null) {
                        qPos.add(grade);
                    }
                }

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

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

                    LFCourse lfCourse = list.get(0);

                    result = lfCourse;

                    cacheResult(lfCourse);

                    if ((lfCourse.getGrade() == null) ||
                            !lfCourse.getGrade().equals(grade)) {
                        FinderCacheUtil.putResult(FINDER_PATH_FETCH_BY_GRADE,
                            finderArgs, lfCourse);
                    }
                }
            } catch (Exception e) {
View Full Code Here

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

     * @throws SystemException if a system exception occurred
     */
    @Override
    public LFCourse removeByGrade(String grade)
        throws NoSuchLFCourseException, SystemException {
        LFCourse lfCourse = findByGrade(grade);

        return remove(lfCourse);
    }
View Full Code Here

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

     * @param id the primary key for the new l f course
     * @return the new l f course
     */
    @Override
    public LFCourse create(long id) {
        LFCourse lfCourse = new LFCourseImpl();

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

        return lfCourse;
    }
View Full Code Here

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

        Session session = null;

        try {
            session = openSession();

            LFCourse lfCourse = (LFCourse) session.get(LFCourseImpl.class,
                    primaryKey);

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

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

     * @throws SystemException if a system exception occurred
     */
    @Override
    public LFCourse findByPrimaryKey(Serializable primaryKey)
        throws NoSuchLFCourseException, SystemException {
        LFCourse lfCourse = fetchByPrimaryKey(primaryKey);

        if (lfCourse == null) {
            if (_log.isWarnEnabled()) {
                _log.warn(_NO_SUCH_ENTITY_WITH_PRIMARY_KEY + primaryKey);
            }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.