Example usage for com.liferay.portal.kernel.dao.orm QueryDefinition QueryDefinition

List of usage examples for com.liferay.portal.kernel.dao.orm QueryDefinition QueryDefinition

Introduction

In this page you can find the example usage for com.liferay.portal.kernel.dao.orm QueryDefinition QueryDefinition.

Prototype

public QueryDefinition(int status, long ownerUserId, boolean includeOwner, int start, int end,
            OrderByComparator<T> orderByComparator) 

Source Link

Usage

From source file:com.liferay.journal.service.impl.JournalArticleServiceImpl.java

License:Open Source License

/**
 * Returns an ordered range of all the web content articles matching the
 * group, user, the root folder or any of its subfolders.
 *
 * @param  groupId the primary key of the web content article's group
 * @param  userId the primary key of the user (optionally <code>0</code>)
 * @param  rootFolderId the primary key of the root folder to begin the
 *         search// w w w . j av a2  s. c  om
 * @param  status the web content article's workflow status. For more
 *         information see {@link WorkflowConstants} for constants starting
 *         with the "STATUS_" prefix.
 * @param  start the lower bound of the range of web content articles to
 *         return
 * @param  end the upper bound of the range of web content articles to
 *         return (not inclusive)
 * @param  orderByComparator the comparator to order the web content
 *         articles
 * @return the range of matching web content articles ordered by the
 *         comparator
 */
@Override
public List<JournalArticle> getGroupArticles(long groupId, long userId, long rootFolderId, int status,
        boolean includeOwner, int start, int end, OrderByComparator<JournalArticle> orderByComparator)
        throws PortalException {

    List<Long> folderIds = new ArrayList<>();

    if (rootFolderId != JournalFolderConstants.DEFAULT_PARENT_FOLDER_ID) {
        folderIds = journalFolderService.getFolderIds(groupId, rootFolderId);
    }

    QueryDefinition<JournalArticle> queryDefinition = new QueryDefinition<>(status, userId, includeOwner, start,
            end, orderByComparator);

    return journalArticleFinder.filterFindByG_F_C(groupId, folderIds,
            JournalArticleConstants.CLASSNAME_ID_DEFAULT, queryDefinition);
}

From source file:com.liferay.journal.service.impl.JournalFolderServiceImpl.java

License:Open Source License

@Override
public List<Object> getFoldersAndArticles(long groupId, long userId, long folderId, int status, int start,
        int end, OrderByComparator<?> obc) {

    QueryDefinition<?> queryDefinition = new QueryDefinition<>(status, userId, true, start, end,
            (OrderByComparator<Object>) obc);

    return journalFolderFinder.filterFindF_A_ByG_F(groupId, folderId, queryDefinition);
}

From source file:com.liferay.journal.service.impl.JournalFolderServiceImpl.java

License:Open Source License

@Override
public List<Object> getFoldersAndArticles(long groupId, long userId, long folderId, int status, Locale locale,
        int start, int end, OrderByComparator<?> obc) {

    QueryDefinition<?> queryDefinition = new QueryDefinition<>(status, userId, true, start, end,
            (OrderByComparator<Object>) obc);

    return journalFolderFinder.filterFindF_A_ByG_F_L(groupId, folderId, locale, queryDefinition);
}