private void persistConsistencyGroups(Collection<BlockConsistencyGroup> cgsToPersist){
  if (null != cgsToPersist && !cgsToPersist.isEmpty()) {
    List<BlockConsistencyGroup> cgsToCreate=new ArrayList<BlockConsistencyGroup>();
    List<BlockConsistencyGroup> cgsToUpdate=new ArrayList<BlockConsistencyGroup>();
    for (    BlockConsistencyGroup cg : cgsToPersist) {
      if (null == cg.getCreationTime()) {
        cgsToCreate.add(cg);
      }
 else {
        cgsToUpdate.add(cg);
      }
    }
    if (!cgsToCreate.isEmpty()) {
      _dbClient.createObject(cgsToCreate);
    }
    if (!cgsToUpdate.isEmpty()) {
      _dbClient.updateObject(cgsToUpdate);
    }
  }
}

private void persistConsistencyGroups ( Collection < BlockConsistencyGroup > cgsToPersist ) { if ( null != cgsToPersist && ! cgsToPersist . isEmpty ( ) ) { List < BlockConsistencyGroup > cgsToCreate = new ArrayList < BlockConsistencyGroup > ( ) ; List < BlockConsistencyGroup > cgsToUpdate = new ArrayList < BlockConsistencyGroup > ( ) ; for ( BlockConsistencyGroup cg : cgsToPersist ) { if ( null == cg . getCreationTime ( ) ) { cgsToCreate . add ( cg ) ; } else { cgsToUpdate . add ( cg ) ; } } if ( ! cgsToCreate . isEmpty ( ) ) { _dbClient . createObject ( cgsToCreate ) ; } if ( ! cgsToUpdate . isEmpty ( ) ) { _dbClient . updateObject ( cgsToUpdate ) ; } } }
persist the consistencygroups in db .
