Returns the number of commerce warehouse items where CProductId = &#63; and CPInstanceUuid = &#63;.

@param CProductId the c product ID
@param CPInstanceUuid the cp instance uuid
@return the number of matching commerce warehouse items
969422
@Override
	public int countByCPI_CPIU(long CProductId, String CPInstanceUuid) {
		FinderPath finderPath = FINDER_PATH_COUNT_BY_CPI_CPIU;

		Object[] finderArgs = new Object[] { CProductId, CPInstanceUuid };

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

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

			query.append(_SQL_COUNT_COMMERCEWAREHOUSEITEM_WHERE);

			query.append(_FINDER_COLUMN_CPI_CPIU_CPRODUCTID_2);

			boolean bindCPInstanceUuid = false;

			if (CPInstanceUuid == null) {
				query.append(_FINDER_COLUMN_CPI_CPIU_CPINSTANCEUUID_1);
			}
			else if (CPInstanceUuid.equals("")) {
				query.append(_FINDER_COLUMN_CPI_CPIU_CPINSTANCEUUID_3);
			}
			else {
				bindCPInstanceUuid = true;

				query.append(_FINDER_COLUMN_CPI_CPIU_CPINSTANCEUUID_2);
			}

			String sql = query.toString();

			Session session = null;

			try {
				session = openSession();

				Query q = session.createQuery(sql);

				QueryPos qPos = QueryPos.getInstance(q);

				qPos.add(CProductId);

				if (bindCPInstanceUuid) {
					qPos.add(CPInstanceUuid);
				}

				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();
	}
1286669
public static List<CommercePriceListUserSegmentEntryRel> findByUuid_C(
		String uuid, long companyId) {
		return getPersistence().findByUuid_C(uuid, companyId);
	}
969049
@Override
	public List<CPDAvailabilityEstimate> findByCommerceAvailabilityEstimateId(
		long commerceAvailabilityEstimateId) {
		return findByCommerceAvailabilityEstimateId(commerceAvailabilityEstimateId,
			QueryUtil.ALL_POS, QueryUtil.ALL_POS, null);
	}
528023
@Override
	public java.util.List<com.liferay.commerce.model.CommerceRegion> getCommerceRegionsByUuidAndCompanyId(
		String uuid, long companyId) {
		return _commerceRegionLocalService.getCommerceRegionsByUuidAndCompanyId(uuid,
			companyId);
	}
763269
@Override
	public List<CPDefinition> findByC_S(long CProductId, int status) {
		return findByC_S(CProductId, status, QueryUtil.ALL_POS,
			QueryUtil.ALL_POS, null);
	}
69347
@Override
	public CPInstance create(long CPInstanceId) {
		CPInstance cpInstance = new CPInstanceImpl();

		cpInstance.setNew(true);
		cpInstance.setPrimaryKey(CPInstanceId);

		String uuid = PortalUUIDUtil.generate();

		cpInstance.setUuid(uuid);

		cpInstance.setCompanyId(companyProvider.getCompanyId());

		return cpInstance;
	}
346232
@Override
	public List<CommercePriceList> getCommercePriceListsByUuidAndCompanyId(
		String uuid, long companyId) {
		return commercePriceListPersistence.findByUuid_C(uuid, companyId);
	}
267870
@Override
	public CommerceDiscount create(long commerceDiscountId) {
		CommerceDiscount commerceDiscount = new CommerceDiscountImpl();

		commerceDiscount.setNew(true);
		commerceDiscount.setPrimaryKey(commerceDiscountId);

		String uuid = PortalUUIDUtil.generate();

		commerceDiscount.setUuid(uuid);

		commerceDiscount.setCompanyId(companyProvider.getCompanyId());

		return commerceDiscount;
	}
1369273
public static com.liferay.commerce.model.CommerceOrder fetchCommerceOrderByUuidAndGroupId(
		String uuid, long groupId) {
		return getService().fetchCommerceOrderByUuidAndGroupId(uuid, groupId);
	}
298311
@Override
	public java.util.List<com.liferay.commerce.product.model.CProduct> getCProductsByUuidAndCompanyId(
		String uuid, long companyId) {
		return _cProductLocalService.getCProductsByUuidAndCompanyId(uuid,
			companyId);
	}
184100
@Override
	public List<CommerceOrder> getCommerceOrdersByUuidAndCompanyId(
		String uuid, long companyId) {
		return commerceOrderPersistence.findByUuid_C(uuid, companyId);
	}
1253404
@Override
	public void removeByCW_CP(long commerceWishListId, long CProductId) {
		for (CommerceWishListItem commerceWishListItem : findByCW_CP(
				commerceWishListId, CProductId, QueryUtil.ALL_POS,
				QueryUtil.ALL_POS, null)) {
			remove(commerceWishListItem);
		}
	}
657716
@Override
	public void removeByCPInstanceUuid(String CPInstanceUuid) {
		for (CommerceWishListItem commerceWishListItem : findByCPInstanceUuid(
				CPInstanceUuid, QueryUtil.ALL_POS, QueryUtil.ALL_POS, null)) {
			remove(commerceWishListItem);
		}
	}
763722
public static List<CommerceVirtualOrderItem> findByUuid_C(String uuid,
		long companyId) {
		return getPersistence().findByUuid_C(uuid, companyId);
	}
565439
@Override
	public void removeByCPI_CPIU(long CProductId, String CPInstanceUuid) {
		for (CommerceWarehouseItem commerceWarehouseItem : findByCPI_CPIU(
				CProductId, CPInstanceUuid, QueryUtil.ALL_POS,
				QueryUtil.ALL_POS, null)) {
			remove(commerceWarehouseItem);
		}
	}
480967
@Override
	public List<CommerceOrderItem> findByC_I(long commerceOrderId,
		long CPInstanceId) {
		return findByC_I(commerceOrderId, CPInstanceId, QueryUtil.ALL_POS,
			QueryUtil.ALL_POS, null);
	}
156845
@Override
	public List<CPDisplayLayout> getCPDisplayLayoutsByUuidAndCompanyId(
		String uuid, long companyId) {
		return cpDisplayLayoutPersistence.findByUuid_C(uuid, companyId);
	}