本文整理汇总了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
的用法示例。
在下文中一共展示了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