@Override
	public int countByG_C_C_DB(long groupId, long classNameId, long classPK,
		boolean defaultBilling) {
		FinderPath finderPath = FINDER_PATH_COUNT_BY_G_C_C_DB;

		Object[] finderArgs = new Object[] {
				groupId, classNameId, classPK, defaultBilling
			};

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

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

			query.append(_SQL_COUNT_COMMERCEADDRESS_WHERE);

			query.append(_FINDER_COLUMN_G_C_C_DB_GROUPID_2);

			query.append(_FINDER_COLUMN_G_C_C_DB_CLASSNAMEID_2);

			query.append(_FINDER_COLUMN_G_C_C_DB_CLASSPK_2);

			query.append(_FINDER_COLUMN_G_C_C_DB_DEFAULTBILLING_2);

			String sql = query.toString();

			Session session = null;

			try {
				session = openSession();

				Query q = session.createQuery(sql);

				QueryPos qPos = QueryPos.getInstance(q);

				qPos.add(groupId);

				qPos.add(classNameId);

				qPos.add(classPK);

				qPos.add(defaultBilling);

				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 countByG_C_C_DB ( long groupId , long classNameId , long classPK , boolean defaultBilling ) { FinderPath finderPath = FINDER_PATH_COUNT_BY_G_C_C_DB ; Object [ ] finderArgs = new Object [ ] { groupId , classNameId , classPK , defaultBilling } ; Long count = ( Long ) finderCache . getResult ( finderPath , finderArgs , this ) ; if ( count == null ) { StringBundler query = new StringBundler ( 5 ) ; query . append ( _SQL_COUNT_COMMERCEADDRESS_WHERE ) ; query . append ( _FINDER_COLUMN_G_C_C_DB_GROUPID_2 ) ; query . append ( _FINDER_COLUMN_G_C_C_DB_CLASSNAMEID_2 ) ; query . append ( _FINDER_COLUMN_G_C_C_DB_CLASSPK_2 ) ; query . append ( _FINDER_COLUMN_G_C_C_DB_DEFAULTBILLING_2 ) ; String sql = query . toString ( ) ; Session session = null ; try { session = openSession ( ) ; Query q = session . createQuery ( sql ) ; QueryPos qPos = QueryPos . getInstance ( q ) ; qPos . add ( groupId ) ; qPos . add ( classNameId ) ; qPos . add ( classPK ) ; qPos . add ( defaultBilling ) ; 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 commerce addresses where groupId = &#63; and classNameId = &#63; and classPK = &#63; and defaultBilling = &#63;.

@param groupId the group ID
@param classNameId the class name ID
@param classPK the class pk
@param defaultBilling the default billing
@return the number of matching commerce addresses