@Override
	public int countByCPDefinitionId_LanguageId(long CPDefinitionId,
		String languageId) {
		FinderPath finderPath = FINDER_PATH_COUNT_BY_CPDEFINITIONID_LANGUAGEID;

		Object[] finderArgs = new Object[] { CPDefinitionId, languageId };

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

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

			query.append(_SQL_COUNT_CPDEFINITIONLOCALIZATION_WHERE);

			query.append(_FINDER_COLUMN_CPDEFINITIONID_LANGUAGEID_CPDEFINITIONID_2);

			boolean bindLanguageId = false;

			if (languageId == null) {
				query.append(_FINDER_COLUMN_CPDEFINITIONID_LANGUAGEID_LANGUAGEID_1);
			}
			else if (languageId.equals("")) {
				query.append(_FINDER_COLUMN_CPDEFINITIONID_LANGUAGEID_LANGUAGEID_3);
			}
			else {
				bindLanguageId = true;

				query.append(_FINDER_COLUMN_CPDEFINITIONID_LANGUAGEID_LANGUAGEID_2);
			}

			String sql = query.toString();

			Session session = null;

			try {
				session = openSession();

				Query q = session.createQuery(sql);

				QueryPos qPos = QueryPos.getInstance(q);

				qPos.add(CPDefinitionId);

				if (bindLanguageId) {
					qPos.add(languageId);
				}

				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();
	}
@ Override public int countByCPDefinitionId_LanguageId ( long CPDefinitionId , String languageId ) { FinderPath finderPath = FINDER_PATH_COUNT_BY_CPDEFINITIONID_LANGUAGEID ; Object [ ] finderArgs = new Object [ ] { CPDefinitionId , languageId } ; Long count = ( Long ) finderCache . getResult ( finderPath , finderArgs , this ) ; if ( count == null ) { StringBundler query = new StringBundler ( 3 ) ; query . append ( _SQL_COUNT_CPDEFINITIONLOCALIZATION_WHERE ) ; query . append ( _FINDER_COLUMN_CPDEFINITIONID_LANGUAGEID_CPDEFINITIONID_2 ) ; boolean bindLanguageId = false ; if ( languageId == null ) { query . append ( _FINDER_COLUMN_CPDEFINITIONID_LANGUAGEID_LANGUAGEID_1 ) ; } else if ( languageId . equals ( "" ) ) { query . append ( _FINDER_COLUMN_CPDEFINITIONID_LANGUAGEID_LANGUAGEID_3 ) ; } else { bindLanguageId = true ; query . append ( _FINDER_COLUMN_CPDEFINITIONID_LANGUAGEID_LANGUAGEID_2 ) ; } String sql = query . toString ( ) ; Session session = null ; try { session = openSession ( ) ; Query q = session . createQuery ( sql ) ; QueryPos qPos = QueryPos . getInstance ( q ) ; qPos . add ( CPDefinitionId ) ; if ( bindLanguageId ) { qPos . add ( languageId ) ; } 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 ( ) ; }
Returns the number of cp definition localizations where CPDefinitionId = &#63; and languageId = &#63;.

@param CPDefinitionId the cp definition ID
@param languageId the language ID
@return the number of matching cp definition localizations