Skip to content

Commit 9e50621

Browse files
committed
DATAMONGO-431 - Adapted changes in CrudRepository.save(…).
1 parent 472beaf commit 9e50621

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

Diff for: spring-data-mongodb/src/main/java/org/springframework/data/mongodb/repository/MongoRepository.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ public interface MongoRepository<T, ID extends Serializable> extends PagingAndSo
3434
* (non-Javadoc)
3535
* @see org.springframework.data.repository.CrudRepository#save(java.lang.Iterable)
3636
*/
37-
List<T> save(Iterable<? extends T> entites);
37+
<S extends T> List<S> save(Iterable<S> entites);
3838

3939
/*
4040
* (non-Javadoc)

Diff for: spring-data-mongodb/src/main/java/org/springframework/data/mongodb/repository/support/SimpleMongoRepository.java

+4-4
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ public SimpleMongoRepository(MongoEntityInformation<T, ID> metadata, MongoOperat
6565
* (non-Javadoc)
6666
* @see org.springframework.data.repository.CrudRepository#save(java.lang.Object)
6767
*/
68-
public T save(T entity) {
68+
public <S extends T> S save(S entity) {
6969

7070
Assert.notNull(entity, "Entity must not be null!");
7171

@@ -77,13 +77,13 @@ public T save(T entity) {
7777
* (non-Javadoc)
7878
* @see org.springframework.data.repository.CrudRepository#save(java.lang.Iterable)
7979
*/
80-
public List<T> save(Iterable<? extends T> entities) {
80+
public <S extends T> List<S> save(Iterable<S> entities) {
8181

8282
Assert.notNull(entities, "The given Iterable of entities not be null!");
8383

84-
List<T> result = new ArrayList<T>();
84+
List<S> result = new ArrayList<S>();
8585

86-
for (T entity : entities) {
86+
for (S entity : entities) {
8787
save(entity);
8888
result.add(entity);
8989
}

0 commit comments

Comments
 (0)