Skip to content

Commit d33f5eb

Browse files
committed
Polishing.
See #1254
1 parent 002732f commit d33f5eb

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

spring-data-jdbc/src/main/java/org/springframework/data/jdbc/core/JdbcAggregateTemplate.java

+6-4
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,9 @@ public JdbcAggregateTemplate(ApplicationEventPublisher publisher, RelationalMapp
124124
}
125125

126126
/**
127-
* @param entityCallbacks
127+
* Sets the callbacks to be invoked on life cycle events.
128+
*
129+
* @param entityCallbacks must not be {@literal null}.
128130
* @since 1.1
129131
*/
130132
public void setEntityCallbacks(EntityCallbacks entityCallbacks) {
@@ -197,10 +199,10 @@ public <T> T findById(Object id, Class<T> domainType) {
197199
Assert.notNull(domainType, "Domain type must not be null!");
198200

199201
T entity = accessStrategy.findById(id, domainType);
200-
if (entity != null) {
201-
return triggerAfterConvert(entity);
202+
if (entity == null) {
203+
return null;
202204
}
203-
return entity;
205+
return triggerAfterConvert(entity);
204206
}
205207

206208
@Override

0 commit comments

Comments
 (0)