@Transactional public int deleteAll(){
  List<T> allEntities=retrieveAll();
  for (  T entity : allEntities) {
    delete(entity);
  }
  return allEntities.size();
}

@ Transactional public int deleteAll ( ) { List < T > allEntities = retrieveAll ( ) ; for ( T entity : allEntities ) { delete ( entity ) ; } return allEntities . size ( ) ; }
deletes all instances of class t in the database .
