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


Java QueryPos类代码示例

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


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

示例1: getExpiredOffersByOrg

import com.liferay.portal.kernel.dao.orm.QueryPos; //导入依赖的package包/类
@Override
public List<AHOffer> getExpiredOffersByOrg(long orgId, long starTime, long endTime)
		throws SystemException {
	List<AHOffer> result = null;

	Session session = null;

	try {

		session = openSession();
		
		SQLQuery query = session.createSQLQuery(getExpiredOffersByOrg);
		
		query.addEntity("AHOffer", AHOfferImpl.class);
		
		QueryPos qPos = QueryPos.getInstance(query);
		qPos.add(orgId);
		qPos.add(starTime);
		qPos.add(endTime);
		result = (List<AHOffer>) query.list();
	} catch (Exception e) {
		throw new SystemException(e);
	} finally {
		closeSession(session);
	}
	return result;
}
 
开发者ID:fraunhoferfokus,项目名称:particity,代码行数:28,代码来源:AHOfferFinderImpl.java

示例2: getApplication_EntitlementsSize

import com.liferay.portal.kernel.dao.orm.QueryPos; //导入依赖的package包/类
/**
 * Returns the number of application_ entitlements associated with the entitlement.
 *
 * @param pk the primary key of the entitlement
 * @return the number of application_ entitlements associated with the entitlement
 * @throws SystemException if a system exception occurred
 */
public int getApplication_EntitlementsSize(long pk)
    throws SystemException {
    Object[] finderArgs = new Object[] { pk };

    Long count = (Long) FinderCacheUtil.getResult(FINDER_PATH_GET_APPLICATION_ENTITLEMENTS_SIZE,
            finderArgs, this);

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

        try {
            session = openSession();

            SQLQuery q = session.createSQLQuery(_SQL_GETAPPLICATION_ENTITLEMENTSSIZE);

            q.addScalar(COUNT_COLUMN_NAME,
                com.liferay.portal.kernel.dao.orm.Type.LONG);

            QueryPos qPos = QueryPos.getInstance(q);

            qPos.add(pk);

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

            FinderCacheUtil.putResult(FINDER_PATH_GET_APPLICATION_ENTITLEMENTS_SIZE,
                finderArgs, count);

            closeSession(session);
        }
    }

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

示例3: countByUuid

import com.liferay.portal.kernel.dao.orm.QueryPos; //导入依赖的package包/类
/**
 * Returns the number of dict collections where uuid = &#63;.
 *
 * @param uuid the uuid
 * @return the number of matching dict collections
 */
@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_DICTCOLLECTION_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,代码来源:DictCollectionPersistenceImpl.java

示例4: countByUUID_G

import com.liferay.portal.kernel.dao.orm.QueryPos; //导入依赖的package包/类
/**
 * Returns the number of dict collections where uuid = &#63; and groupId = &#63;.
 *
 * @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

示例5: countByUuid_C

import com.liferay.portal.kernel.dao.orm.QueryPos; //导入依赖的package包/类
/**
 * Returns the number of dict collections where uuid = &#63; and companyId = &#63;.
 *
 * @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

示例6: countByF_dictCollectionCode

import com.liferay.portal.kernel.dao.orm.QueryPos; //导入依赖的package包/类
/**
 * Returns the number of dict collections where collectionCode = &#63; and groupId = &#63;.
 *
 * @param collectionCode the collection code
 * @param groupId the group ID
 * @return the number of matching dict collections
 */
@Override
public int countByF_dictCollectionCode(String collectionCode, long groupId) {
	FinderPath finderPath = FINDER_PATH_COUNT_BY_F_DICTCOLLECTIONCODE;

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

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

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

		query.append(_SQL_COUNT_DICTCOLLECTION_WHERE);

		boolean bindCollectionCode = false;

		if (collectionCode == null) {
			query.append(_FINDER_COLUMN_F_DICTCOLLECTIONCODE_COLLECTIONCODE_1);
		}
		else if (collectionCode.equals(StringPool.BLANK)) {
			query.append(_FINDER_COLUMN_F_DICTCOLLECTIONCODE_COLLECTIONCODE_3);
		}
		else {
			bindCollectionCode = true;

			query.append(_FINDER_COLUMN_F_DICTCOLLECTIONCODE_COLLECTIONCODE_2);
		}

		query.append(_FINDER_COLUMN_F_DICTCOLLECTIONCODE_GROUPID_2);

		String sql = query.toString();

		Session session = null;

		try {
			session = openSession();

			Query q = session.createQuery(sql);

			QueryPos qPos = QueryPos.getInstance(q);

			if (bindCollectionCode) {
				qPos.add(collectionCode);
			}

			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

示例7: countByUuid

import com.liferay.portal.kernel.dao.orm.QueryPos; //导入依赖的package包/类
/**
 * Returns the number of votings where uuid = &#63;.
 *
 * @param uuid the uuid
 * @return the number of matching votings
 */
@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_VOTING_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,代码来源:VotingPersistenceImpl.java

示例8: countByUUID_G

import com.liferay.portal.kernel.dao.orm.QueryPos; //导入依赖的package包/类
/**
 * Returns the number of votings where uuid = &#63; and groupId = &#63;.
 *
 * @param uuid the uuid
 * @param groupId the group ID
 * @return the number of matching votings
 */
@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_VOTING_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,代码来源:VotingPersistenceImpl.java

示例9: countByUuid_C

import com.liferay.portal.kernel.dao.orm.QueryPos; //导入依赖的package包/类
/**
 * Returns the number of votings where uuid = &#63; and companyId = &#63;.
 *
 * @param uuid the uuid
 * @param companyId the company ID
 * @return the number of matching votings
 */
@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_VOTING_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,代码来源:VotingPersistenceImpl.java

示例10: countByUuid

import com.liferay.portal.kernel.dao.orm.QueryPos; //导入依赖的package包/类
/**
 * Returns the number of voting results where uuid = &#63;.
 *
 * @param uuid the uuid
 * @return the number of matching voting results
 */
@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_VOTINGRESULT_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,代码来源:VotingResultPersistenceImpl.java

示例11: countByUUID_G

import com.liferay.portal.kernel.dao.orm.QueryPos; //导入依赖的package包/类
/**
 * Returns the number of voting results where uuid = &#63; and groupId = &#63;.
 *
 * @param uuid the uuid
 * @param groupId the group ID
 * @return the number of matching voting results
 */
@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_VOTINGRESULT_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,代码来源:VotingResultPersistenceImpl.java

示例12: countByUuid_C

import com.liferay.portal.kernel.dao.orm.QueryPos; //导入依赖的package包/类
/**
 * Returns the number of voting results where uuid = &#63; and companyId = &#63;.
 *
 * @param uuid the uuid
 * @param companyId the company ID
 * @return the number of matching voting results
 */
@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_VOTINGRESULT_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,代码来源:VotingResultPersistenceImpl.java

示例13: countByUuid

import com.liferay.portal.kernel.dao.orm.QueryPos; //导入依赖的package包/类
/**
 * Returns the number of dict items where uuid = &#63;.
 *
 * @param uuid the uuid
 * @return the number of matching dict items
 */
@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_DICTITEM_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,代码来源:DictItemPersistenceImpl.java

示例14: countByUUID_G

import com.liferay.portal.kernel.dao.orm.QueryPos; //导入依赖的package包/类
/**
 * Returns the number of dict items where uuid = &#63; and groupId = &#63;.
 *
 * @param uuid the uuid
 * @param groupId the group ID
 * @return the number of matching dict items
 */
@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_DICTITEM_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,代码来源:DictItemPersistenceImpl.java

示例15: countByUuid_C

import com.liferay.portal.kernel.dao.orm.QueryPos; //导入依赖的package包/类
/**
 * Returns the number of dict items where uuid = &#63; and companyId = &#63;.
 *
 * @param uuid the uuid
 * @param companyId the company ID
 * @return the number of matching dict items
 */
@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_DICTITEM_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,代码来源:DictItemPersistenceImpl.java


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