@Override
	public CommercePriceEntry fetchByC_C(long commercePriceListId,
		String CPInstanceUuid, boolean retrieveFromCache) {
		Object[] finderArgs = new Object[] { commercePriceListId, CPInstanceUuid };

		Object result = null;

		if (retrieveFromCache) {
			result = finderCache.getResult(FINDER_PATH_FETCH_BY_C_C,
					finderArgs, this);
		}

		if (result instanceof CommercePriceEntry) {
			CommercePriceEntry commercePriceEntry = (CommercePriceEntry)result;

			if ((commercePriceListId != commercePriceEntry.getCommercePriceListId()) ||
					!Objects.equals(CPInstanceUuid,
						commercePriceEntry.getCPInstanceUuid())) {
				result = null;
			}
		}

		if (result == null) {
			StringBundler query = new StringBundler(4);

			query.append(_SQL_SELECT_COMMERCEPRICEENTRY_WHERE);

			query.append(_FINDER_COLUMN_C_C_COMMERCEPRICELISTID_2);

			boolean bindCPInstanceUuid = false;

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

				query.append(_FINDER_COLUMN_C_C_CPINSTANCEUUID_2);
			}

			String sql = query.toString();

			Session session = null;

			try {
				session = openSession();

				Query q = session.createQuery(sql);

				QueryPos qPos = QueryPos.getInstance(q);

				qPos.add(commercePriceListId);

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

				List<CommercePriceEntry> list = q.list();

				if (list.isEmpty()) {
					finderCache.putResult(FINDER_PATH_FETCH_BY_C_C, finderArgs,
						list);
				}
				else {
					CommercePriceEntry commercePriceEntry = list.get(0);

					result = commercePriceEntry;

					cacheResult(commercePriceEntry);
				}
			}
			catch (Exception e) {
				finderCache.removeResult(FINDER_PATH_FETCH_BY_C_C, finderArgs);

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

		if (result instanceof List<?>) {
			return null;
		}
		else {
			return (CommercePriceEntry)result;
		}
	}
@ Override public CommercePriceEntry fetchByC_C ( long commercePriceListId , String CPInstanceUuid , boolean retrieveFromCache ) { Object [ ] finderArgs = new Object [ ] { commercePriceListId , CPInstanceUuid } ; Object result = null ; if ( retrieveFromCache ) { result = finderCache . getResult ( FINDER_PATH_FETCH_BY_C_C , finderArgs , this ) ; } if ( result instanceof CommercePriceEntry ) { CommercePriceEntry commercePriceEntry = ( CommercePriceEntry ) result ; if ( ( commercePriceListId != commercePriceEntry . getCommercePriceListId ( ) ) || ! Objects . equals ( CPInstanceUuid , commercePriceEntry . getCPInstanceUuid ( ) ) ) { result = null ; } } if ( result == null ) { StringBundler query = new StringBundler ( 4 ) ; query . append ( _SQL_SELECT_COMMERCEPRICEENTRY_WHERE ) ; query . append ( _FINDER_COLUMN_C_C_COMMERCEPRICELISTID_2 ) ; boolean bindCPInstanceUuid = false ; if ( CPInstanceUuid == null ) { query . append ( _FINDER_COLUMN_C_C_CPINSTANCEUUID_1 ) ; } else if ( CPInstanceUuid . equals ( "" ) ) { query . append ( _FINDER_COLUMN_C_C_CPINSTANCEUUID_3 ) ; } else { bindCPInstanceUuid = true ; query . append ( _FINDER_COLUMN_C_C_CPINSTANCEUUID_2 ) ; } String sql = query . toString ( ) ; Session session = null ; try { session = openSession ( ) ; Query q = session . createQuery ( sql ) ; QueryPos qPos = QueryPos . getInstance ( q ) ; qPos . add ( commercePriceListId ) ; if ( bindCPInstanceUuid ) { qPos . add ( CPInstanceUuid ) ; } List < CommercePriceEntry > list = q . list ( ) ; if ( list . isEmpty ( ) ) { finderCache . putResult ( FINDER_PATH_FETCH_BY_C_C , finderArgs , list ) ; } else { CommercePriceEntry commercePriceEntry = list . get ( 0 ) ; result = commercePriceEntry ; cacheResult ( commercePriceEntry ) ; } } catch ( Exception e ) { finderCache . removeResult ( FINDER_PATH_FETCH_BY_C_C , finderArgs ) ; throw processException ( e ) ; } finally { closeSession ( session ) ; } } if ( result instanceof List < ? > ) { return null ; } else { return ( CommercePriceEntry ) result ; } }
Returns the commerce price entry where commercePriceListId = &#63; and CPInstanceUuid = &#63; or returns <code>null</code> if it could not be found, optionally using the finder cache.

@param commercePriceListId the commerce price list ID
@param CPInstanceUuid the cp instance uuid
@param retrieveFromCache whether to retrieve from the finder cache
@return the matching commerce price entry, or <code>null</code> if a matching commerce price entry could not be found