/* * (non-Javadoc) * * @see org.springframework.data.repository.CrudRepository#findAll() */ @Override public Collection<T> findAll() { return template.execute( new GemfireCallback<Collection<T>>() { @Override @SuppressWarnings({"rawtypes", "unchecked"}) public Collection<T> doInGemfire(Region region) { return region.values(); } }); }
/* * (non-Javadoc) * * @see org.springframework.data.repository.CrudRepository#deleteAll() */ @Override public void deleteAll() { template.execute( new GemfireCallback<Void>() { @Override @SuppressWarnings("rawtypes") public Void doInGemfire(Region region) { // clear() does not work for partitioned regions try { region.clear(); } catch (UnsupportedOperationException e) { for (Object key : region.keySet()) { region.remove(key); } } return null; } }); }