Java Query.uniqueResult方法代码示例(javaquery.uniqueresult方法代码示例汇总)

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


Java Query.uniqueResult方法代码示例(javaquery.uniqueresult方法代码示例汇总)

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

示例1: 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

示例2: 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

示例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 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

示例5: 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

示例6: 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

示例7: 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

示例8: countAll

import com.liferay.portal.kernel.dao.orm.Query; //导入方法依赖的package包/类
/**
 * Returns the number of doc templates.
 *
 * @return the number of doc 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_DOCTEMPLATE);

			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,代码来源:DocTemplatePersistenceImpl.java

示例9: countAll

import com.liferay.portal.kernel.dao.orm.Query; //导入方法依赖的package包/类
/**
 * Returns the number of user competences.
 *
 * @return the number of user competences
 * @throws SystemException if a system exception occurred
 */
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_USERCOMPETENCE);

			count = (Long)q.uniqueResult();
		}
		catch (Exception e) {
			throw processException(e);
		}
		finally {
			if (count == null) {
				count = Long.valueOf(0);
			}

			FinderCacheUtil.putResult(FINDER_PATH_COUNT_ALL,
				FINDER_ARGS_EMPTY, count);

			closeSession(session);
		}
	}

	return count.intValue();
} 
开发者ID:TelefonicaED,项目名称:liferaylms-portlet,代码行数:38,代码来源:UserCompetencePersistenceImpl.java

示例10: countAll

import com.liferay.portal.kernel.dao.orm.Query; //导入方法依赖的package包/类
/**
 * Returns the number of user certificate downloads.
 *
 * @return the number of user certificate downloads
 * @throws SystemException if a system exception occurred
 */
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_USERCERTIFICATEDOWNLOAD);

			count = (Long)q.uniqueResult();
		}
		catch (Exception e) {
			throw processException(e);
		}
		finally {
			if (count == null) {
				count = Long.valueOf(0);
			}

			FinderCacheUtil.putResult(FINDER_PATH_COUNT_ALL,
				FINDER_ARGS_EMPTY, count);

			closeSession(session);
		}
	}

	return count.intValue();
} 
开发者ID:TelefonicaED,项目名称:liferaylms-portlet,代码行数:38,代码来源:UserCertificateDownloadPersistenceImpl.java

示例11: countAll

import com.liferay.portal.kernel.dao.orm.Query; //导入方法依赖的package包/类
/**
 * Returns the number of statistic by domains.
 *
 * @return the number of statistic by domains
 * @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_STATISTICBYDOMAIN);

			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,代码来源:StatisticByDomainPersistenceImpl.java

示例12: countAll

import com.liferay.portal.kernel.dao.orm.Query; //导入方法依赖的package包/类
/**
 * Returns the number of courses.
 *
 * @return the number of courses
 * @throws SystemException if a system exception occurred
 */
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_COURSE);

			count = (Long)q.uniqueResult();
		}
		catch (Exception e) {
			throw processException(e);
		}
		finally {
			if (count == null) {
				count = Long.valueOf(0);
			}

			FinderCacheUtil.putResult(FINDER_PATH_COUNT_ALL,
				FINDER_ARGS_EMPTY, count);

			closeSession(session);
		}
	}

	return count.intValue();
} 
开发者ID:TelefonicaED,项目名称:liferaylms-portlet,代码行数:38,代码来源:CoursePersistenceImpl.java

示例13: countByUuid

import com.liferay.portal.kernel.dao.orm.Query; //导入方法依赖的package包/类
/**
 * Returns the number of dict item groups where uuid = ?.
 *
 * @param uuid the uuid
 * @return the number of matching dict item groups
 */
@Override
public int countByUuid(String uuid) {
	FinderPath finderPath = FINDER_PATH_COUNT_BY_UUID;

	Object[] finderArgs = new Object[] { uuid };

	Long count = (Long)finderCache.getResult(finderPath, finderArgs, this);

	if (count == null) {
		StringBundler query = new StringBundler(2);

		query.append(_SQL_COUNT_DICTITEMGROUP_WHERE);

		boolean bindUuid = false;

		if (uuid == null) {
			query.append(_FINDER_COLUMN_UUID_UUID_1);
		}
		else if (uuid.equals(StringPool.BLANK)) {
			query.append(_FINDER_COLUMN_UUID_UUID_3);
		}
		else {
			bindUuid = true;

			query.append(_FINDER_COLUMN_UUID_UUID_2);
		}

		String sql = query.toString();

		Session session = null;

		try {
			session = openSession();

			Query q = session.createQuery(sql);

			QueryPos qPos = QueryPos.getInstance(q);

			if (bindUuid) {
				qPos.add(uuid);
			}

			count = (Long)q.uniqueResult();

			finderCache.putResult(finderPath, finderArgs, count);
		}
		catch (Exception e) {
			finderCache.removeResult(finderPath, finderArgs);

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

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

示例14: countByUUID_G

import com.liferay.portal.kernel.dao.orm.Query; //导入方法依赖的package包/类
/**
 * Returns the number of dict collections where uuid = ? and groupId = ?.
 *
 * @param uuid the uuid
 * @param groupId the group ID
 * @return the number of matching dict collections
 */
@Override
public int countByUUID_G(String uuid, long groupId) {
	FinderPath finderPath = FINDER_PATH_COUNT_BY_UUID_G;

	Object[] finderArgs = new Object[] { uuid, groupId };

	Long count = (Long)finderCache.getResult(finderPath, finderArgs, this);

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

		query.append(_SQL_COUNT_DICTCOLLECTION_WHERE);

		boolean bindUuid = false;

		if (uuid == null) {
			query.append(_FINDER_COLUMN_UUID_G_UUID_1);
		}
		else if (uuid.equals(StringPool.BLANK)) {
			query.append(_FINDER_COLUMN_UUID_G_UUID_3);
		}
		else {
			bindUuid = true;

			query.append(_FINDER_COLUMN_UUID_G_UUID_2);
		}

		query.append(_FINDER_COLUMN_UUID_G_GROUPID_2);

		String sql = query.toString();

		Session session = null;

		try {
			session = openSession();

			Query q = session.createQuery(sql);

			QueryPos qPos = QueryPos.getInstance(q);

			if (bindUuid) {
				qPos.add(uuid);
			}

			qPos.add(groupId);

			count = (Long)q.uniqueResult();

			finderCache.putResult(finderPath, finderArgs, count);
		}
		catch (Exception e) {
			finderCache.removeResult(finderPath, finderArgs);

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

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

示例15: countByUuid_C

import com.liferay.portal.kernel.dao.orm.Query; //导入方法依赖的package包/类
/**
 * Returns the number of dict collections where uuid = ? and companyId = ?.
 *
 * @param uuid the uuid
 * @param companyId the company ID
 * @return the number of matching dict collections
 */
@Override
public int countByUuid_C(String uuid, long companyId) {
	FinderPath finderPath = FINDER_PATH_COUNT_BY_UUID_C;

	Object[] finderArgs = new Object[] { uuid, companyId };

	Long count = (Long)finderCache.getResult(finderPath, finderArgs, this);

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

		query.append(_SQL_COUNT_DICTCOLLECTION_WHERE);

		boolean bindUuid = false;

		if (uuid == null) {
			query.append(_FINDER_COLUMN_UUID_C_UUID_1);
		}
		else if (uuid.equals(StringPool.BLANK)) {
			query.append(_FINDER_COLUMN_UUID_C_UUID_3);
		}
		else {
			bindUuid = true;

			query.append(_FINDER_COLUMN_UUID_C_UUID_2);
		}

		query.append(_FINDER_COLUMN_UUID_C_COMPANYID_2);

		String sql = query.toString();

		Session session = null;

		try {
			session = openSession();

			Query q = session.createQuery(sql);

			QueryPos qPos = QueryPos.getInstance(q);

			if (bindUuid) {
				qPos.add(uuid);
			}

			qPos.add(companyId);

			count = (Long)q.uniqueResult();

			finderCache.putResult(finderPath, finderArgs, count);
		}
		catch (Exception e) {
			finderCache.removeResult(finderPath, finderArgs);

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

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

本文标签属性:

示例:示例的拼音

代码:代码编程

java:java游戏

Query:Query

uniqueResult:uniqueResult

上一篇:《乡音》免费在线观看完整版高清,求百度网盘资源(请问,回乡偶书中的乡音是什么意思?)(《乡音》《询问》)
下一篇:Python NNBase.grad_check方法代码示例(pythonnn.base.nnbase.grad_check方法的典型用法代码示例)

为您推荐