docs: @Override
  	public CPDAvailabilityEstimate fetchByCProductId(long CProductId,
  		boolean retrieveFromCache) {
  		Object[] finderArgs = new Object[] { CProductId };
  
  		Object result = null;
  
  		if (retrieveFromCache) {
  			result = finderCache.getResult(FINDER_PATH_FETCH_BY_CPRODUCTID,
  					finderArgs, this);
  		}
  
  		if (result instanceof CPDAvailabilityEstimate) {
  			CPDAvailabilityEstimate cpdAvailabilityEstimate = (CPDAvailabilityEstimate)result;
  
  			if ((CProductId != cpdAvailabilityEstimate.getCProductId())) {
  				result = null;
  			}
  		}
  
  		if (result == null) {
  			StringBundler query = new StringBundler(3);
  
  			query.append(_SQL_SELECT_CPDAVAILABILITYESTIMATE_WHERE);
  
  			query.append(_FINDER_COLUMN_CPRODUCTID_CPRODUCTID_2);
  
  			String sql = query.toString();
  
  			Session session = null;
  
  			try {
  				session = openSession();
  
  				Query q = session.createQuery(sql);
  
  				QueryPos qPos = QueryPos.getInstance(q);
  
  				qPos.add(CProductId);
  
  				List<CPDAvailabilityEstimate> list = q.list();
  
  				if (list.isEmpty()) {
  					finderCache.putResult(FINDER_PATH_FETCH_BY_CPRODUCTID,
  						finderArgs, list);
  				}
  				else {
  					CPDAvailabilityEstimate cpdAvailabilityEstimate = list.get(0);
  
  					result = cpdAvailabilityEstimate;
  
  					cacheResult(cpdAvailabilityEstimate);
  				}
  			}
  			catch (Exception e) {
  				finderCache.removeResult(FINDER_PATH_FETCH_BY_CPRODUCTID,
  					finderArgs);
  
  				throw processException(e);
  			}
  			finally {
  				closeSession(session);
  			}
  		}
  
  		if (result instanceof List<?>) {
  			return null;
  		}
  		else {
  			return (CPDAvailabilityEstimate)result;
  		}
  	}