DATAJPA-1754 - Checks that the entity passed to save is not null.
Before this change a null value would have yielded an ambiguous exception, instead of a proper IllegalArgumentException. Signed-off-by: Jens Schauder <jschauder@vmware.com>
This commit is contained in:
@@ -550,6 +550,8 @@ public class SimpleJpaRepository<T, ID> implements JpaRepositoryImplementation<T
|
||||
@Override
|
||||
public <S extends T> S save(S entity) {
|
||||
|
||||
Assert.notNull(entity, "Entity must not be null.");
|
||||
|
||||
if (entityInformation.isNew(entity)) {
|
||||
em.persist(entity);
|
||||
return entity;
|
||||
|
||||
Reference in New Issue
Block a user