protected <T> T processSelectGroup(T obj, String groupName, Collection<CpoWhere> wheres, Collection<CpoOrderBy> orderBy, Collection<CpoNativeFunction> nativeExpressions, Session sess) throws CpoException {
    T criteriaObj = obj;
    boolean recordsExist = false;
    Logger localLogger = obj == null ? logger : LoggerFactory.getLogger(obj.getClass());

    int recordCount = 0;
    int attributesSet = 0;

    T rObj = null;

    if (obj == null) {
      throw new CpoException("NULL Object passed into retrieveBean");
    }

    try {
      CpoClass cpoClass = metaDescriptor.getMetaClass(criteriaObj);
      List<CpoFunction> functions = cpoClass.getFunctionGroup(CpoAdapter.RETRIEVE_GROUP, groupName).getFunctions();

      localLogger.info("=================== Class=<" + criteriaObj.getClass() + "> Type=<" + CpoAdapter.RETRIEVE_GROUP + "> Name=<" + groupName + "> =========================");

      try {
        rObj = (T) obj.getClass().newInstance();
      } catch (IllegalAccessException iae) {
        localLogger.error("=================== Could not access default constructor for Class=<" + obj.getClass() + "> ==================");
        throw new CpoException("Unable to access the constructor of the Return Object", iae);
      } catch (InstantiationException iae) {
        throw new CpoException("Unable to instantiate Return Object", iae);
      }

      for (CpoFunction cpoFunction : functions) {

        CassandraBoundStatementFactory cbsf = new CassandraBoundStatementFactory(sess, this, cpoClass, cpoFunction, criteriaObj, wheres, orderBy, nativeExpressions);
        BoundStatement boundStatement = cbsf.getBoundStatement();

        // insertions on
        // selectgroup
        ResultSet rs = sess.execute(boundStatement);
        cbsf.release();

        ColumnDefinitions columnDefs = rs.getColumnDefinitions();

        if ((columnDefs.size() == 2) && "CPO_ATTRIBUTE".equalsIgnoreCase(columnDefs.getName(1)) && "CPO_VALUE".equalsIgnoreCase(columnDefs.getName(2))) {
          for(Row row : rs) {
            recordsExist = true;
            recordCount++;
            CpoAttribute attribute = cpoClass.getAttributeData(row.getString(0));

            if (attribute != null) {
              attribute.invokeSetter(rObj, new ResultSetCpoData(CassandraMethodMapper.getMethodMapper(), row, attribute, 1));
              attributesSet++;
            }
          }
        } else if (!rs.isExhausted()) {
          recordsExist = true;
          recordCount++;
          Row row = rs.one();
          for (int k = 0; k < columnDefs.size(); k++) {
            CpoAttribute attribute = cpoClass.getAttributeData(columnDefs.getName(k));

            if (attribute != null) {
              attribute.invokeSetter(rObj, new ResultSetCpoData(CassandraMethodMapper.getMethodMapper(), row, attribute, k));
              attributesSet++;
            }
          }

          if (rs.one() != null) {
            String msg = "ProcessSelectGroup(Object, String) failed: Multiple Records Returned";
            localLogger.error(msg);
            throw new CpoException(msg);
          }
        }
        criteriaObj = rObj;
      }

      if (!recordsExist) {
        rObj = null;
        localLogger.info("=================== 0 Records - 0 Attributes - Class=<" + criteriaObj.getClass() + "> Type=<" + CpoAdapter.RETRIEVE_GROUP + "> Name=<" + groupName + "> =========================");
      } else {
        localLogger.info("=================== " + recordCount + " Records - " + attributesSet + " Attributes - Class=<" + criteriaObj.getClass() + ">  Type=<" + CpoAdapter.RETRIEVE_GROUP + "> Name=<" + groupName + "> =========================");
      }
    } catch (Throwable t) {
      String msg = "ProcessSeclectGroup(Object) failed: " + ExceptionHelper.getLocalizedMessage(t);
      localLogger.error(msg, t);
      throw new CpoException(msg, t);
    }

    return rObj;
  }
protected < T > T processSelectGroup ( T obj , String groupName , Collection < CpoWhere > wheres , Collection < CpoOrderBy > orderBy , Collection < CpoNativeFunction > nativeExpressions , Session sess ) throws CpoException { T criteriaObj = obj ; boolean recordsExist = false ; Logger localLogger = obj == null ? logger : LoggerFactory . getLogger ( obj . getClass ( ) ) ; int recordCount = 0 ; int attributesSet = 0 ; T rObj = null ; if ( obj == null ) { throw new CpoException ( "NULL Object passed into retrieveBean" ) ; } try { CpoClass cpoClass = metaDescriptor . getMetaClass ( criteriaObj ) ; List < CpoFunction > functions = cpoClass . getFunctionGroup ( CpoAdapter . RETRIEVE_GROUP , groupName ) . getFunctions ( ) ; localLogger . info ( "=================== Class=<" + criteriaObj . getClass ( ) + "> Type=<" + CpoAdapter . RETRIEVE_GROUP + "> Name=<" + groupName + "> =========================" ) ; try { rObj = ( T ) obj . getClass ( ) . newInstance ( ) ; } catch ( IllegalAccessException iae ) { localLogger . error ( "=================== Could not access default constructor for Class=<" + obj . getClass ( ) + "> ==================" ) ; throw new CpoException ( "Unable to access the constructor of the Return Object" , iae ) ; } catch ( InstantiationException iae ) { throw new CpoException ( "Unable to instantiate Return Object" , iae ) ; } for ( CpoFunction cpoFunction : functions ) { CassandraBoundStatementFactory cbsf = new CassandraBoundStatementFactory ( sess , this , cpoClass , cpoFunction , criteriaObj , wheres , orderBy , nativeExpressions ) ; BoundStatement boundStatement = cbsf . getBoundStatement ( ) ; ResultSet rs = sess . execute ( boundStatement ) ; cbsf . release ( ) ; ColumnDefinitions columnDefs = rs . getColumnDefinitions ( ) ; if ( ( columnDefs . size ( ) == 2 ) && "CPO_ATTRIBUTE" . equalsIgnoreCase ( columnDefs . getName ( 1 ) ) && "CPO_VALUE" . equalsIgnoreCase ( columnDefs . getName ( 2 ) ) ) { for ( Row row : rs ) { recordsExist = true ; recordCount ++ ; CpoAttribute attribute = cpoClass . getAttributeData ( row . getString ( 0 ) ) ; if ( attribute != null ) { attribute . invokeSetter ( rObj , new ResultSetCpoData ( CassandraMethodMapper . getMethodMapper ( ) , row , attribute , 1 ) ) ; attributesSet ++ ; } } } else if ( ! rs . isExhausted ( ) ) { recordsExist = true ; recordCount ++ ; Row row = rs . one ( ) ; for ( int k = 0 ; k < columnDefs . size ( ) ; k ++ ) { CpoAttribute attribute = cpoClass . getAttributeData ( columnDefs . getName ( k ) ) ; if ( attribute != null ) { attribute . invokeSetter ( rObj , new ResultSetCpoData ( CassandraMethodMapper . getMethodMapper ( ) , row , attribute , k ) ) ; attributesSet ++ ; } } if ( rs . one ( ) != null ) { String msg = "ProcessSelectGroup(Object, String) failed: Multiple Records Returned" ; localLogger . error ( msg ) ; throw new CpoException ( msg ) ; } } criteriaObj = rObj ; } if ( ! recordsExist ) { rObj = null ; localLogger . info ( "=================== 0 Records - 0 Attributes - Class=<" + criteriaObj . getClass ( ) + "> Type=<" + CpoAdapter . RETRIEVE_GROUP + "> Name=<" + groupName + "> =========================" ) ; } else { localLogger . info ( "=================== " + recordCount + " Records - " + attributesSet + " Attributes - Class=<" + criteriaObj . getClass ( ) + ">  Type=<" + CpoAdapter . RETRIEVE_GROUP + "> Name=<" + groupName + "> =========================" ) ; } } catch ( Throwable t ) { String msg = "ProcessSeclectGroup(Object) failed: " + ExceptionHelper . getLocalizedMessage ( t ) ; localLogger . error ( msg , t ) ; throw new CpoException ( msg , t ) ; } return rObj ; }
DOCUMENT ME!

@param obj       DOCUMENT ME!
@param groupName DOCUMENT ME!
@param sess       DOCUMENT ME!
@return DOCUMENT ME!
@throws CpoException DOCUMENT ME!