Skip to content

Commit 90ab2f7

Browse files
committed
Polishing.
See #1254
1 parent cac69a8 commit 90ab2f7

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
@@ -131,7 +131,9 @@ public JdbcAggregateTemplate(ApplicationEventPublisher publisher, RelationalMapp
131131
}
132132

133133
/**
134-
* @param entityCallbacks
134+
* Sets the callbacks to be invoked on life cycle events.
135+
*
136+
* @param entityCallbacks must not be {@literal null}.
135137
* @since 1.1
136138
*/
137139
public void setEntityCallbacks(EntityCallbacks entityCallbacks) {
@@ -216,10 +218,10 @@ public <T> T findById(Object id, Class<T> domainType) {
216218
Assert.notNull(domainType, "Domain type must not be null!");
217219

218220
T entity = accessStrategy.findById(id, domainType);
219-
if (entity != null) {
220-
return triggerAfterConvert(entity);
221+
if (entity == null) {
222+
return null;
221223
}
222-
return entity;
224+
return triggerAfterConvert(entity);
223225
}
224226

225227
/*

0 commit comments

Comments
 (0)