Skip to content

Commit 162194b

Browse files
committed
Introduce new constructor for SimpleJdbcRepository.
This is in preparation for #1195. See #1195
1 parent a684097 commit 162194b

File tree

1 file changed

+16
-1
lines changed

1 file changed

+16
-1
lines changed

spring-data-jdbc/src/main/java/org/springframework/data/jdbc/repository/support/SimpleJdbcRepository.java

+16-1
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
import org.springframework.data.domain.Pageable;
2323
import org.springframework.data.domain.Sort;
2424
import org.springframework.data.jdbc.core.JdbcAggregateOperations;
25+
import org.springframework.data.jdbc.core.convert.JdbcConverter;
2526
import org.springframework.data.mapping.PersistentEntity;
2627
import org.springframework.data.repository.PagingAndSortingRepository;
2728
import org.springframework.data.util.Streamable;
@@ -41,7 +42,21 @@ public class SimpleJdbcRepository<T, ID> implements PagingAndSortingRepository<T
4142
private final JdbcAggregateOperations entityOperations;
4243
private final PersistentEntity<T, ?> entity;
4344

44-
public SimpleJdbcRepository(JdbcAggregateOperations entityOperations,PersistentEntity<T, ?> entity) {
45+
public SimpleJdbcRepository(JdbcAggregateOperations entityOperations, PersistentEntity<T, ?> entity,
46+
JdbcConverter converter) {
47+
48+
Assert.notNull(entityOperations, "EntityOperations must not be null.");
49+
Assert.notNull(entity, "Entity must not be null.");
50+
51+
this.entityOperations = entityOperations;
52+
this.entity = entity;
53+
}
54+
55+
/**
56+
* @deprecated Use {@link #SimpleJdbcRepository(JdbcAggregateOperations, PersistentEntity, JdbcConverter)} instead.
57+
*/
58+
@Deprecated
59+
public SimpleJdbcRepository(JdbcAggregateOperations entityOperations, PersistentEntity<T, ?> entity) {
4560

4661
Assert.notNull(entityOperations, "EntityOperations must not be null.");
4762
Assert.notNull(entity, "Entity must not be null.");

0 commit comments

Comments
 (0)