DATAMONGO-431 - Adapted changes in CrudRepository.save(…).

This commit is contained in:
Oliver Gierke
2012-04-13 22:40:07 +02:00
parent 472beaf6d2
commit 9e50621c1b
2 changed files with 5 additions and 5 deletions

View File

@@ -34,7 +34,7 @@ public interface MongoRepository<T, ID extends Serializable> extends PagingAndSo
* (non-Javadoc)
* @see org.springframework.data.repository.CrudRepository#save(java.lang.Iterable)
*/
List<T> save(Iterable<? extends T> entites);
<S extends T> List<S> save(Iterable<S> entites);
/*
* (non-Javadoc)

View File

@@ -65,7 +65,7 @@ public class SimpleMongoRepository<T, ID extends Serializable> implements MongoR
* (non-Javadoc)
* @see org.springframework.data.repository.CrudRepository#save(java.lang.Object)
*/
public T save(T entity) {
public <S extends T> S save(S entity) {
Assert.notNull(entity, "Entity must not be null!");
@@ -77,13 +77,13 @@ public class SimpleMongoRepository<T, ID extends Serializable> implements MongoR
* (non-Javadoc)
* @see org.springframework.data.repository.CrudRepository#save(java.lang.Iterable)
*/
public List<T> save(Iterable<? extends T> entities) {
public <S extends T> List<S> save(Iterable<S> entities) {
Assert.notNull(entities, "The given Iterable of entities not be null!");
List<T> result = new ArrayList<T>();
List<S> result = new ArrayList<S>();
for (T entity : entities) {
for (S entity : entities) {
save(entity);
result.add(entity);
}