当前位置: 首页>>代码示例>>Java>>正文


Java Query类代码示例

本文整理汇总了Java中com.liferay.portal.kernel.dao.orm.Query的典型用法代码示例。如果您正苦于以下问题:Java Query类的具体用法?Java Query怎么用?Java Query使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


Query类属于com.liferay.portal.kernel.dao.orm包,在下文中一共展示了Query类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: countAll

import com.liferay.portal.kernel.dao.orm.Query; //导入依赖的package包/类
/**
 * Returns the number of dict collections.
 *
 * @return the number of dict collections
 */
@Override
public int countAll() {
	Long count = (Long)finderCache.getResult(FINDER_PATH_COUNT_ALL,
			FINDER_ARGS_EMPTY, this);

	if (count == null) {
		Session session = null;

		try {
			session = openSession();

			Query q = session.createQuery(_SQL_COUNT_DICTCOLLECTION);

			count = (Long)q.uniqueResult();

			finderCache.putResult(FINDER_PATH_COUNT_ALL, FINDER_ARGS_EMPTY,
				count);
		}
		catch (Exception e) {
			finderCache.removeResult(FINDER_PATH_COUNT_ALL,
				FINDER_ARGS_EMPTY);

			throw processException(e);
		}
		finally {
			closeSession(session);
		}
	}

	return count.intValue();
}
 
开发者ID:VietOpenCPS,项目名称:opencps-v2,代码行数:37,代码来源:DictCollectionPersistenceImpl.java

示例2: countAll

import com.liferay.portal.kernel.dao.orm.Query; //导入依赖的package包/类
/**
 * Returns the number of votings.
 *
 * @return the number of votings
 */
@Override
public int countAll() {
	Long count = (Long)finderCache.getResult(FINDER_PATH_COUNT_ALL,
			FINDER_ARGS_EMPTY, this);

	if (count == null) {
		Session session = null;

		try {
			session = openSession();

			Query q = session.createQuery(_SQL_COUNT_VOTING);

			count = (Long)q.uniqueResult();

			finderCache.putResult(FINDER_PATH_COUNT_ALL, FINDER_ARGS_EMPTY,
				count);
		}
		catch (Exception e) {
			finderCache.removeResult(FINDER_PATH_COUNT_ALL,
				FINDER_ARGS_EMPTY);

			throw processException(e);
		}
		finally {
			closeSession(session);
		}
	}

	return count.intValue();
}
 
开发者ID:VietOpenCPS,项目名称:opencps-v2,代码行数:37,代码来源:VotingPersistenceImpl.java

示例3: countAll

import com.liferay.portal.kernel.dao.orm.Query; //导入依赖的package包/类
/**
 * Returns the number of voting results.
 *
 * @return the number of voting results
 */
@Override
public int countAll() {
	Long count = (Long)finderCache.getResult(FINDER_PATH_COUNT_ALL,
			FINDER_ARGS_EMPTY, this);

	if (count == null) {
		Session session = null;

		try {
			session = openSession();

			Query q = session.createQuery(_SQL_COUNT_VOTINGRESULT);

			count = (Long)q.uniqueResult();

			finderCache.putResult(FINDER_PATH_COUNT_ALL, FINDER_ARGS_EMPTY,
				count);
		}
		catch (Exception e) {
			finderCache.removeResult(FINDER_PATH_COUNT_ALL,
				FINDER_ARGS_EMPTY);

			throw processException(e);
		}
		finally {
			closeSession(session);
		}
	}

	return count.intValue();
}
 
开发者ID:VietOpenCPS,项目名称:opencps-v2,代码行数:37,代码来源:VotingResultPersistenceImpl.java

示例4: countAll

import com.liferay.portal.kernel.dao.orm.Query; //导入依赖的package包/类
/**
 * Returns the number of dict items.
 *
 * @return the number of dict items
 */
@Override
public int countAll() {
	Long count = (Long)finderCache.getResult(FINDER_PATH_COUNT_ALL,
			FINDER_ARGS_EMPTY, this);

	if (count == null) {
		Session session = null;

		try {
			session = openSession();

			Query q = session.createQuery(_SQL_COUNT_DICTITEM);

			count = (Long)q.uniqueResult();

			finderCache.putResult(FINDER_PATH_COUNT_ALL, FINDER_ARGS_EMPTY,
				count);
		}
		catch (Exception e) {
			finderCache.removeResult(FINDER_PATH_COUNT_ALL,
				FINDER_ARGS_EMPTY);

			throw processException(e);
		}
		finally {
			closeSession(session);
		}
	}

	return count.intValue();
}
 
开发者ID:VietOpenCPS,项目名称:opencps-v2,代码行数:37,代码来源:DictItemPersistenceImpl.java

示例5: countAll

import com.liferay.portal.kernel.dao.orm.Query; //导入依赖的package包/类
/**
 * Returns the number of dict item groups.
 *
 * @return the number of dict item groups
 */
@Override
public int countAll() {
	Long count = (Long)finderCache.getResult(FINDER_PATH_COUNT_ALL,
			FINDER_ARGS_EMPTY, this);

	if (count == null) {
		Session session = null;

		try {
			session = openSession();

			Query q = session.createQuery(_SQL_COUNT_DICTITEMGROUP);

			count = (Long)q.uniqueResult();

			finderCache.putResult(FINDER_PATH_COUNT_ALL, FINDER_ARGS_EMPTY,
				count);
		}
		catch (Exception e) {
			finderCache.removeResult(FINDER_PATH_COUNT_ALL,
				FINDER_ARGS_EMPTY);

			throw processException(e);
		}
		finally {
			closeSession(session);
		}
	}

	return count.intValue();
}
 
开发者ID:VietOpenCPS,项目名称:opencps-v2,代码行数:37,代码来源:DictItemGroupPersistenceImpl.java

示例6: countAll

import com.liferay.portal.kernel.dao.orm.Query; //导入依赖的package包/类
/**
 * Returns the number of dict groups.
 *
 * @return the number of dict groups
 */
@Override
public int countAll() {
	Long count = (Long)finderCache.getResult(FINDER_PATH_COUNT_ALL,
			FINDER_ARGS_EMPTY, this);

	if (count == null) {
		Session session = null;

		try {
			session = openSession();

			Query q = session.createQuery(_SQL_COUNT_DICTGROUP);

			count = (Long)q.uniqueResult();

			finderCache.putResult(FINDER_PATH_COUNT_ALL, FINDER_ARGS_EMPTY,
				count);
		}
		catch (Exception e) {
			finderCache.removeResult(FINDER_PATH_COUNT_ALL,
				FINDER_ARGS_EMPTY);

			throw processException(e);
		}
		finally {
			closeSession(session);
		}
	}

	return count.intValue();
}
 
开发者ID:VietOpenCPS,项目名称:opencps-v2,代码行数:37,代码来源:DictGroupPersistenceImpl.java

示例7: countAll

import com.liferay.portal.kernel.dao.orm.Query; //导入依赖的package包/类
/**
 * Returns the number of comments.
 *
 * @return the number of comments
 */
@Override
public int countAll() {
	Long count = (Long)finderCache.getResult(FINDER_PATH_COUNT_ALL,
			FINDER_ARGS_EMPTY, this);

	if (count == null) {
		Session session = null;

		try {
			session = openSession();

			Query q = session.createQuery(_SQL_COUNT_COMMENT);

			count = (Long)q.uniqueResult();

			finderCache.putResult(FINDER_PATH_COUNT_ALL, FINDER_ARGS_EMPTY,
				count);
		}
		catch (Exception e) {
			finderCache.removeResult(FINDER_PATH_COUNT_ALL,
				FINDER_ARGS_EMPTY);

			throw processException(e);
		}
		finally {
			closeSession(session);
		}
	}

	return count.intValue();
}
 
开发者ID:VietOpenCPS,项目名称:opencps-v2,代码行数:37,代码来源:CommentPersistenceImpl.java

示例8: countAll

import com.liferay.portal.kernel.dao.orm.Query; //导入依赖的package包/类
/**
 * Returns the number of regions.
 *
 * @return the number of regions
 */
@Override
public int countAll() {
	Long count = (Long)finderCache.getResult(FINDER_PATH_COUNT_ALL,
			FINDER_ARGS_EMPTY, this);

	if (count == null) {
		Session session = null;

		try {
			session = openSession();

			Query q = session.createQuery(_SQL_COUNT_REGION);

			count = (Long)q.uniqueResult();

			finderCache.putResult(FINDER_PATH_COUNT_ALL, FINDER_ARGS_EMPTY,
				count);
		}
		catch (Exception e) {
			finderCache.removeResult(FINDER_PATH_COUNT_ALL,
				FINDER_ARGS_EMPTY);

			throw processException(e);
		}
		finally {
			closeSession(session);
		}
	}

	return count.intValue();
}
 
开发者ID:liferay,项目名称:liferay-blade-samples,代码行数:37,代码来源:RegionPersistenceImpl.java

示例9: countAll

import com.liferay.portal.kernel.dao.orm.Query; //导入依赖的package包/类
/**
 * Returns the number of countries.
 *
 * @return the number of countries
 */
@Override
public int countAll() {
	Long count = (Long)finderCache.getResult(FINDER_PATH_COUNT_ALL,
			FINDER_ARGS_EMPTY, this);

	if (count == null) {
		Session session = null;

		try {
			session = openSession();

			Query q = session.createQuery(_SQL_COUNT_COUNTRY);

			count = (Long)q.uniqueResult();

			finderCache.putResult(FINDER_PATH_COUNT_ALL, FINDER_ARGS_EMPTY,
				count);
		}
		catch (Exception e) {
			finderCache.removeResult(FINDER_PATH_COUNT_ALL,
				FINDER_ARGS_EMPTY);

			throw processException(e);
		}
		finally {
			closeSession(session);
		}
	}

	return count.intValue();
}
 
开发者ID:liferay,项目名称:liferay-blade-samples,代码行数:37,代码来源:CountryPersistenceImpl.java

示例10: countAll

import com.liferay.portal.kernel.dao.orm.Query; //导入依赖的package包/类
/**
 * Returns the number of foos.
 *
 * @return the number of foos
 */
@Override
public int countAll() {
	Long count = (Long)finderCache.getResult(FINDER_PATH_COUNT_ALL,
			FINDER_ARGS_EMPTY, this);

	if (count == null) {
		Session session = null;

		try {
			session = openSession();

			Query q = session.createQuery(_SQL_COUNT_FOO);

			count = (Long)q.uniqueResult();

			finderCache.putResult(FINDER_PATH_COUNT_ALL, FINDER_ARGS_EMPTY,
				count);
		}
		catch (Exception e) {
			finderCache.removeResult(FINDER_PATH_COUNT_ALL,
				FINDER_ARGS_EMPTY);

			throw processException(e);
		}
		finally {
			closeSession(session);
		}
	}

	return count.intValue();
}
 
开发者ID:liferay,项目名称:liferay-blade-samples,代码行数:37,代码来源:FooPersistenceImpl.java

示例11: countAll

import com.liferay.portal.kernel.dao.orm.Query; //导入依赖的package包/类
/**
 * Returns the number of applications.
 *
 * @return the number of applications
 * @throws SystemException if a system exception occurred
 */
@Override
public int countAll() throws SystemException {
	Long count = (Long)FinderCacheUtil.getResult(FINDER_PATH_COUNT_ALL,
			FINDER_ARGS_EMPTY, this);

	if (count == null) {
		Session session = null;

		try {
			session = openSession();

			Query q = session.createQuery(_SQL_COUNT_APPLICATION);

			count = (Long)q.uniqueResult();

			FinderCacheUtil.putResult(FINDER_PATH_COUNT_ALL,
				FINDER_ARGS_EMPTY, count);
		}
		catch (Exception e) {
			FinderCacheUtil.removeResult(FINDER_PATH_COUNT_ALL,
				FINDER_ARGS_EMPTY);

			throw processException(e);
		}
		finally {
			closeSession(session);
		}
	}

	return count.intValue();
}
 
开发者ID:openegovplatform,项目名称:OEPv2,代码行数:38,代码来源:ApplicationPersistenceImpl.java

示例12: countAll

import com.liferay.portal.kernel.dao.orm.Query; //导入依赖的package包/类
/**
 * Returns the number of dossier doc2 templates.
 *
 * @return the number of dossier doc2 templates
 * @throws SystemException if a system exception occurred
 */
@Override
public int countAll() throws SystemException {
	Long count = (Long)FinderCacheUtil.getResult(FINDER_PATH_COUNT_ALL,
			FINDER_ARGS_EMPTY, this);

	if (count == null) {
		Session session = null;

		try {
			session = openSession();

			Query q = session.createQuery(_SQL_COUNT_DOSSIERDOC2TEMPLATE);

			count = (Long)q.uniqueResult();

			FinderCacheUtil.putResult(FINDER_PATH_COUNT_ALL,
				FINDER_ARGS_EMPTY, count);
		}
		catch (Exception e) {
			FinderCacheUtil.removeResult(FINDER_PATH_COUNT_ALL,
				FINDER_ARGS_EMPTY);

			throw processException(e);
		}
		finally {
			closeSession(session);
		}
	}

	return count.intValue();
}
 
开发者ID:openegovplatform,项目名称:OEPv2,代码行数:38,代码来源:DossierDoc2TemplatePersistenceImpl.java

示例13: countAll

import com.liferay.portal.kernel.dao.orm.Query; //导入依赖的package包/类
/**
 * Returns the number of a h subscriptions.
 *
 * @return the number of a h subscriptions
 * @throws SystemException if a system exception occurred
 */
@Override
public int countAll() throws SystemException {
    Long count = (Long) FinderCacheUtil.getResult(FINDER_PATH_COUNT_ALL,
            FINDER_ARGS_EMPTY, this);

    if (count == null) {
        Session session = null;

        try {
            session = openSession();

            Query q = session.createQuery(_SQL_COUNT_AHSUBSCRIPTION);

            count = (Long) q.uniqueResult();

            FinderCacheUtil.putResult(FINDER_PATH_COUNT_ALL,
                FINDER_ARGS_EMPTY, count);
        } catch (Exception e) {
            FinderCacheUtil.removeResult(FINDER_PATH_COUNT_ALL,
                FINDER_ARGS_EMPTY);

            throw processException(e);
        } finally {
            closeSession(session);
        }
    }

    return count.intValue();
}
 
开发者ID:fraunhoferfokus,项目名称:particity,代码行数:36,代码来源:AHSubscriptionPersistenceImpl.java

示例14: countAll

import com.liferay.portal.kernel.dao.orm.Query; //导入依赖的package包/类
/**
 * Returns the number of doc files.
 *
 * @return the number of doc files
 * @throws SystemException if a system exception occurred
 */
@Override
public int countAll() throws SystemException {
	Long count = (Long)FinderCacheUtil.getResult(FINDER_PATH_COUNT_ALL,
			FINDER_ARGS_EMPTY, this);

	if (count == null) {
		Session session = null;

		try {
			session = openSession();

			Query q = session.createQuery(_SQL_COUNT_DOCFILE);

			count = (Long)q.uniqueResult();

			FinderCacheUtil.putResult(FINDER_PATH_COUNT_ALL,
				FINDER_ARGS_EMPTY, count);
		}
		catch (Exception e) {
			FinderCacheUtil.removeResult(FINDER_PATH_COUNT_ALL,
				FINDER_ARGS_EMPTY);

			throw processException(e);
		}
		finally {
			closeSession(session);
		}
	}

	return count.intValue();
}
 
开发者ID:openegovplatform,项目名称:OEPv2,代码行数:38,代码来源:DocFilePersistenceImpl.java

示例15: countAll

import com.liferay.portal.kernel.dao.orm.Query; //导入依赖的package包/类
/**
 * Returns the number of dossier proc bookmarks.
 *
 * @return the number of dossier proc bookmarks
 * @throws SystemException if a system exception occurred
 */
@Override
public int countAll() throws SystemException {
	Long count = (Long)FinderCacheUtil.getResult(FINDER_PATH_COUNT_ALL,
			FINDER_ARGS_EMPTY, this);

	if (count == null) {
		Session session = null;

		try {
			session = openSession();

			Query q = session.createQuery(_SQL_COUNT_DOSSIERPROCBOOKMARK);

			count = (Long)q.uniqueResult();

			FinderCacheUtil.putResult(FINDER_PATH_COUNT_ALL,
				FINDER_ARGS_EMPTY, count);
		}
		catch (Exception e) {
			FinderCacheUtil.removeResult(FINDER_PATH_COUNT_ALL,
				FINDER_ARGS_EMPTY);

			throw processException(e);
		}
		finally {
			closeSession(session);
		}
	}

	return count.intValue();
}
 
开发者ID:openegovplatform,项目名称:OEPv2,代码行数:38,代码来源:DossierProcBookmarkPersistenceImpl.java


注:本文中的com.liferay.portal.kernel.dao.orm.Query类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。