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

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


     * @throws SystemException if a system exception occurred
     */
    @Override
    public LFTincanLrsDocument findByDocumentId(String documentId)
        throws NoSuchLFTincanLrsDocumentException, SystemException {
        LFTincanLrsDocument lfTincanLrsDocument = fetchByDocumentId(documentId);

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

            msg.append(_NO_SUCH_ENTITY_WITH_KEY);
View Full Code Here


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

        if (result instanceof LFTincanLrsDocument) {
            LFTincanLrsDocument lfTincanLrsDocument = (LFTincanLrsDocument) result;

            if (!Validator.equals(documentId,
                        lfTincanLrsDocument.getDocumentId())) {
                result = null;
            }
        }

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

            query.append(_SQL_SELECT_LFTINCANLRSDOCUMENT_WHERE);

            boolean bindDocumentId = false;

            if (documentId == null) {
                query.append(_FINDER_COLUMN_DOCUMENTID_DOCUMENTID_1);
            } else if (documentId.equals(StringPool.BLANK)) {
                query.append(_FINDER_COLUMN_DOCUMENTID_DOCUMENTID_3);
            } else {
                bindDocumentId = true;

                if (documentId.equals(StringPool.BLANK)) {
                    query.append(_FINDER_COLUMN_DOCUMENTID_DOCUMENTID_3);
                } else {
                    query.append(_FINDER_COLUMN_DOCUMENTID_DOCUMENTID_2);
                }
            }

            String sql = query.toString();

            Session session = null;

            try {
                session = openSession();

                Query q = session.createQuery(sql);

                QueryPos qPos = QueryPos.getInstance(q);

                if (bindDocumentId) {
                    if (documentId != null) {
                        qPos.add(documentId);
                    }
                }

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

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

                    LFTincanLrsDocument lfTincanLrsDocument = list.get(0);

                    result = lfTincanLrsDocument;

                    cacheResult(lfTincanLrsDocument);

                    if ((lfTincanLrsDocument.getDocumentId() == null) ||
                            !lfTincanLrsDocument.getDocumentId()
                                                    .equals(documentId)) {
                        FinderCacheUtil.putResult(FINDER_PATH_FETCH_BY_DOCUMENTID,
                            finderArgs, lfTincanLrsDocument);
                    }
                }
View Full Code Here

     * @throws SystemException if a system exception occurred
     */
    @Override
    public LFTincanLrsDocument removeByDocumentId(String documentId)
        throws NoSuchLFTincanLrsDocumentException, SystemException {
        LFTincanLrsDocument lfTincanLrsDocument = findByDocumentId(documentId);

        return remove(lfTincanLrsDocument);
    }
View Full Code Here

     * @param id the primary key for the new l f tincan lrs document
     * @return the new l f tincan lrs document
     */
    @Override
    public LFTincanLrsDocument create(long id) {
        LFTincanLrsDocument lfTincanLrsDocument = new LFTincanLrsDocumentImpl();

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

        return lfTincanLrsDocument;
    }
View Full Code Here

        Session session = null;

        try {
            session = openSession();

            LFTincanLrsDocument lfTincanLrsDocument = (LFTincanLrsDocument) session.get(LFTincanLrsDocumentImpl.class,
                    primaryKey);

            if (lfTincanLrsDocument == 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 LFTincanLrsDocument findByPrimaryKey(Serializable primaryKey)
        throws NoSuchLFTincanLrsDocumentException, SystemException {
        LFTincanLrsDocument lfTincanLrsDocument = fetchByPrimaryKey(primaryKey);

        if (lfTincanLrsDocument == 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 LFTincanLrsDocument fetchByPrimaryKey(Serializable primaryKey)
        throws SystemException {
        LFTincanLrsDocument lfTincanLrsDocument = (LFTincanLrsDocument) EntityCacheUtil.getResult(LFTincanLrsDocumentModelImpl.ENTITY_CACHE_ENABLED,
                LFTincanLrsDocumentImpl.class, primaryKey);

        if (lfTincanLrsDocument == _nullLFTincanLrsDocument) {
            return null;
        }
View Full Code Here

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

        LFTincanLrsDocument lfTincanLrsDocument = (LFTincanLrsDocument) obj;

        long primaryKey = lfTincanLrsDocument.getPrimaryKey();

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

    public LFTincanLrsDocument createLFTincanLrsDocument() throws SystemException {
        return super.createLFTincanLrsDocument(counterLocalService.increment(LFTincanLrsDocument.class.getName()));
    }

    public LFTincanLrsDocument createLFTincanLrsDocument(String documentId, Date update, String contentType, String content) throws SystemException {
        LFTincanLrsDocument document = createLFTincanLrsDocument(counterLocalService.increment(LFTincanLrsDocument.class.getName()));
        document.setDocumentId(documentId);
        document.setUpdate(update);
        document.setContentType(contentType);
        document.setContent(content);
        lfTincanLrsDocumentPersistence.update(document, false);
        return document;
    }
View Full Code Here

TOP

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

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.