@Override
	public CPDefinitionGroupedEntry fetchByC_E(long CPDefinitionId,
		long entryCProductId, boolean retrieveFromCache) {
		Object[] finderArgs = new Object[] { CPDefinitionId, entryCProductId };

		Object result = null;

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

		if (result instanceof CPDefinitionGroupedEntry) {
			CPDefinitionGroupedEntry cpDefinitionGroupedEntry = (CPDefinitionGroupedEntry)result;

			if ((CPDefinitionId != cpDefinitionGroupedEntry.getCPDefinitionId()) ||
					(entryCProductId != cpDefinitionGroupedEntry.getEntryCProductId())) {
				result = null;
			}
		}

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

			query.append(_SQL_SELECT_CPDEFINITIONGROUPEDENTRY_WHERE);

			query.append(_FINDER_COLUMN_C_E_CPDEFINITIONID_2);

			query.append(_FINDER_COLUMN_C_E_ENTRYCPRODUCTID_2);

			String sql = query.toString();

			Session session = null;

			try {
				session = openSession();

				Query q = session.createQuery(sql);

				QueryPos qPos = QueryPos.getInstance(q);

				qPos.add(CPDefinitionId);

				qPos.add(entryCProductId);

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

				if (list.isEmpty()) {
					finderCache.putResult(FINDER_PATH_FETCH_BY_C_E, finderArgs,
						list);
				}
				else {
					CPDefinitionGroupedEntry cpDefinitionGroupedEntry = list.get(0);

					result = cpDefinitionGroupedEntry;

					cacheResult(cpDefinitionGroupedEntry);
				}
			}
			catch (Exception e) {
				finderCache.removeResult(FINDER_PATH_FETCH_BY_C_E, finderArgs);

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

		if (result instanceof List<?>) {
			return null;
		}
		else {
			return (CPDefinitionGroupedEntry)result;
		}
	}
@ Override public CPDefinitionGroupedEntry fetchByC_E ( long CPDefinitionId , long entryCProductId , boolean retrieveFromCache ) { Object [ ] finderArgs = new Object [ ] { CPDefinitionId , entryCProductId } ; Object result = null ; if ( retrieveFromCache ) { result = finderCache . getResult ( FINDER_PATH_FETCH_BY_C_E , finderArgs , this ) ; } if ( result instanceof CPDefinitionGroupedEntry ) { CPDefinitionGroupedEntry cpDefinitionGroupedEntry = ( CPDefinitionGroupedEntry ) result ; if ( ( CPDefinitionId != cpDefinitionGroupedEntry . getCPDefinitionId ( ) ) || ( entryCProductId != cpDefinitionGroupedEntry . getEntryCProductId ( ) ) ) { result = null ; } } if ( result == null ) { StringBundler query = new StringBundler ( 4 ) ; query . append ( _SQL_SELECT_CPDEFINITIONGROUPEDENTRY_WHERE ) ; query . append ( _FINDER_COLUMN_C_E_CPDEFINITIONID_2 ) ; query . append ( _FINDER_COLUMN_C_E_ENTRYCPRODUCTID_2 ) ; String sql = query . toString ( ) ; Session session = null ; try { session = openSession ( ) ; Query q = session . createQuery ( sql ) ; QueryPos qPos = QueryPos . getInstance ( q ) ; qPos . add ( CPDefinitionId ) ; qPos . add ( entryCProductId ) ; List < CPDefinitionGroupedEntry > list = q . list ( ) ; if ( list . isEmpty ( ) ) { finderCache . putResult ( FINDER_PATH_FETCH_BY_C_E , finderArgs , list ) ; } else { CPDefinitionGroupedEntry cpDefinitionGroupedEntry = list . get ( 0 ) ; result = cpDefinitionGroupedEntry ; cacheResult ( cpDefinitionGroupedEntry ) ; } } catch ( Exception e ) { finderCache . removeResult ( FINDER_PATH_FETCH_BY_C_E , finderArgs ) ; throw processException ( e ) ; } finally { closeSession ( session ) ; } } if ( result instanceof List < ? > ) { return null ; } else { return ( CPDefinitionGroupedEntry ) result ; } }
Returns the cp definition grouped entry where CPDefinitionId = &#63; and entryCProductId = &#63; or returns <code>null</code> if it could not be found, optionally using the finder cache.

@param CPDefinitionId the cp definition ID
@param entryCProductId the entry c product ID
@param retrieveFromCache whether to retrieve from the finder cache
@return the matching cp definition grouped entry, or <code>null</code> if a matching cp definition grouped entry could not be found