Example usage for com.liferay.portal.util PropsValues SQL_DATA_MAX_PARAMETERS

List of usage examples for com.liferay.portal.util PropsValues SQL_DATA_MAX_PARAMETERS

Introduction

In this page you can find the example usage for com.liferay.portal.util PropsValues SQL_DATA_MAX_PARAMETERS.

Prototype

int SQL_DATA_MAX_PARAMETERS

To view the source code for com.liferay.portal.util PropsValues SQL_DATA_MAX_PARAMETERS.

Click Source Link

Usage

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

License:Open Source License

@Override
public int getFoldersAndArticlesCount(long groupId, List<Long> folderIds, int status) {

    QueryDefinition<JournalArticle> queryDefinition = new QueryDefinition<>(status);

    if (folderIds.size() <= PropsValues.SQL_DATA_MAX_PARAMETERS) {
        return journalArticleFinder.countByG_F(groupId, folderIds, queryDefinition);
    } else {//from w w w .  j av a2s.  c  o m
        int start = 0;
        int end = PropsValues.SQL_DATA_MAX_PARAMETERS;

        int articlesCount = journalArticleFinder.countByG_F(groupId, folderIds.subList(start, end),
                queryDefinition);

        folderIds.subList(start, end).clear();

        articlesCount += getFoldersAndArticlesCount(groupId, folderIds, status);

        return articlesCount;
    }
}

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

License:Open Source License

@Override
public int getFoldersAndArticlesCount(long groupId, List<Long> folderIds, int status) {

    QueryDefinition<JournalArticle> queryDefinition = new QueryDefinition<>(status);

    if (folderIds.size() <= PropsValues.SQL_DATA_MAX_PARAMETERS) {
        return journalArticleFinder.filterCountByG_F(groupId, folderIds, queryDefinition);
    } else {/*from   ww w .jav a 2 s.c  o m*/
        int start = 0;
        int end = PropsValues.SQL_DATA_MAX_PARAMETERS;

        int articlesCount = journalArticleFinder.filterCountByG_F(groupId, folderIds.subList(start, end),
                queryDefinition);

        folderIds.subList(start, end).clear();

        articlesCount += getFoldersAndArticlesCount(groupId, folderIds, status);

        return articlesCount;
    }
}

From source file:com.liferay.portlet.documentlibrary.service.impl.DLFileEntryServiceImpl.java

License:Open Source License

public int getFoldersFileEntriesCount(long groupId, List<Long> folderIds, int status) throws SystemException {

    if (folderIds.size() <= PropsValues.SQL_DATA_MAX_PARAMETERS) {
        return dlFileEntryFinder.filterCountByG_F_S(groupId, folderIds, status);
    } else {//from   ww w.j  a  v a  2 s.c  o  m
        int start = 0;
        int end = PropsValues.SQL_DATA_MAX_PARAMETERS;

        int filesCount = dlFileEntryFinder.filterCountByG_F_S(groupId, folderIds.subList(start, end), status);

        folderIds.subList(start, end).clear();

        filesCount += getFoldersFileEntriesCount(groupId, folderIds, status);

        return filesCount;
    }
}

From source file:com.liferay.portlet.documentlibrary.service.impl.DLFolderLocalServiceImpl.java

License:Open Source License

public int getFoldersFileEntriesCount(long groupId, List<Long> folderIds, int status) throws SystemException {

    if (folderIds.size() <= PropsValues.SQL_DATA_MAX_PARAMETERS) {
        return dlFileEntryFinder.countByG_F_S(groupId, folderIds, status);
    } else {//from  w ww.  j a  v  a 2s.  com
        int start = 0;
        int end = PropsValues.SQL_DATA_MAX_PARAMETERS;

        int filesCount = dlFileEntryFinder.countByG_F_S(groupId, folderIds.subList(start, end), status);

        folderIds.subList(start, end).clear();

        filesCount += getFoldersFileEntriesCount(groupId, folderIds, status);

        return filesCount;
    }
}