@Override public int countByField2(boolean field2){
  FinderPath finderPath=FINDER_PATH_COUNT_BY_FIELD2;
  Object[] finderArgs=new Object[]{field2};
  Long count=(Long)finderCache.getResult(finderPath,finderArgs,this);
  if (count == null) {
    StringBundler query=new StringBundler(2);
    query.append(_SQL_COUNT_FOO_WHERE);
    query.append(_FINDER_COLUMN_FIELD2_FIELD2_2);
    String sql=query.toString();
    Session session=null;
    try {
      session=openSession();
      Query q=session.createQuery(sql);
      QueryPos qPos=QueryPos.getInstance(q);
      qPos.add(field2);
      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 countByField2 ( boolean field2 ) { FinderPath finderPath = FINDER_PATH_COUNT_BY_FIELD2 ; Object [ ] finderArgs = new Object [ ] { field2 } ; Long count = ( Long ) finderCache . getResult ( finderPath , finderArgs , this ) ; if ( count == null ) { StringBundler query = new StringBundler ( 2 ) ; query . append ( _SQL_COUNT_FOO_WHERE ) ; query . append ( _FINDER_COLUMN_FIELD2_FIELD2_2 ) ; String sql = query . toString ( ) ; Session session = null ; try { session = openSession ( ) ; Query q = session . createQuery ( sql ) ; QueryPos qPos = QueryPos . getInstance ( q ) ; qPos . add ( field2 ) ; 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 foos where field2 = & # 63 ; .
