Examples of LFQuizTreeElement


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

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

        LFQuizTreeElement lfQuizTreeElement = (LFQuizTreeElement) obj;

        long primaryKey = lfQuizTreeElement.getPrimaryKey();

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

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

     */
    @Override
    public LFQuizTreeElement findByQuizID_First(Integer quizID,
        OrderByComparator orderByComparator)
        throws NoSuchLFQuizTreeElementException, SystemException {
        LFQuizTreeElement lfQuizTreeElement = fetchByQuizID_First(quizID,
                orderByComparator);

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

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

     */
    @Override
    public LFQuizTreeElement findByQuizID_Last(Integer quizID,
        OrderByComparator orderByComparator)
        throws NoSuchLFQuizTreeElementException, SystemException {
        LFQuizTreeElement lfQuizTreeElement = fetchByQuizID_Last(quizID,
                orderByComparator);

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

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

     */
    @Override
    public LFQuizTreeElement[] findByQuizID_PrevAndNext(long id,
        Integer quizID, OrderByComparator orderByComparator)
        throws NoSuchLFQuizTreeElementException, SystemException {
        LFQuizTreeElement lfQuizTreeElement = findByPrimaryKey(id);

        Session session = null;

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

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

     */
    @Override
    public LFQuizTreeElement findByQuizAndElementID(Integer quizID,
        String elementID)
        throws NoSuchLFQuizTreeElementException, SystemException {
        LFQuizTreeElement lfQuizTreeElement = fetchByQuizAndElementID(quizID,
                elementID);

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

View Full Code Here

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

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

        if (result instanceof LFQuizTreeElement) {
            LFQuizTreeElement lfQuizTreeElement = (LFQuizTreeElement) result;

            if (!Validator.equals(quizID, lfQuizTreeElement.getQuizID()) ||
                    !Validator.equals(elementID,
                        lfQuizTreeElement.getElementID())) {
                result = null;
            }
        }

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

            query.append(_SQL_SELECT_LFQUIZTREEELEMENT_WHERE);

            if (quizID == null) {
                query.append(_FINDER_COLUMN_QUIZANDELEMENTID_QUIZID_NULL_2);
            } else {
                query.append(_FINDER_COLUMN_QUIZANDELEMENTID_QUIZID_2);
            }

            boolean bindElementID = false;

            if (elementID == null) {
                query.append(_FINDER_COLUMN_QUIZANDELEMENTID_ELEMENTID_1);
            } else if (elementID.equals(StringPool.BLANK)) {
                query.append(_FINDER_COLUMN_QUIZANDELEMENTID_ELEMENTID_3);
            } else {
                bindElementID = true;

                if (elementID.equals(StringPool.BLANK)) {
                    query.append(_FINDER_COLUMN_QUIZANDELEMENTID_ELEMENTID_3);
                } else {
                    query.append(_FINDER_COLUMN_QUIZANDELEMENTID_ELEMENTID_2);
                }
            }

            String sql = query.toString();

            Session session = null;

            try {
                session = openSession();

                Query q = session.createQuery(sql);

                QueryPos qPos = QueryPos.getInstance(q);

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

                if (bindElementID) {
                    if (elementID != null) {
                        qPos.add(elementID);
                    }
                }

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

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

                    LFQuizTreeElement lfQuizTreeElement = list.get(0);

                    result = lfQuizTreeElement;

                    cacheResult(lfQuizTreeElement);

                    if ((lfQuizTreeElement.getQuizID() != quizID) ||
                            (lfQuizTreeElement.getElementID() == null) ||
                            !lfQuizTreeElement.getElementID().equals(elementID)) {
                        FinderCacheUtil.putResult(FINDER_PATH_FETCH_BY_QUIZANDELEMENTID,
                            finderArgs, lfQuizTreeElement);
                    }
                }
            } catch (Exception e) {
View Full Code Here

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

     */
    @Override
    public LFQuizTreeElement removeByQuizAndElementID(Integer quizID,
        String elementID)
        throws NoSuchLFQuizTreeElementException, SystemException {
        LFQuizTreeElement lfQuizTreeElement = findByQuizAndElementID(quizID,
                elementID);

        return remove(lfQuizTreeElement);
    }
View Full Code Here

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

     * @param id the primary key for the new l f quiz tree element
     * @return the new l f quiz tree element
     */
    @Override
    public LFQuizTreeElement create(long id) {
        LFQuizTreeElement lfQuizTreeElement = new LFQuizTreeElementImpl();

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

        return lfQuizTreeElement;
    }
View Full Code Here

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

        Session session = null;

        try {
            session = openSession();

            LFQuizTreeElement lfQuizTreeElement = (LFQuizTreeElement) session.get(LFQuizTreeElementImpl.class,
                    primaryKey);

            if (lfQuizTreeElement == 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.LFQuizTreeElement

     * @throws SystemException if a system exception occurred
     */
    @Override
    public LFQuizTreeElement findByPrimaryKey(Serializable primaryKey)
        throws NoSuchLFQuizTreeElementException, SystemException {
        LFQuizTreeElement lfQuizTreeElement = fetchByPrimaryKey(primaryKey);

        if (lfQuizTreeElement == 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.