How to initialize Specification of Spring Data JPA?

Specification.where(null) works just fine.
It is annotated with @Nullable and the implementation handles null values as it should.

The problem is that you are using the and method as if it would modify the Specification, but it creates a new one. So you should use

spec = spec.and( ... );

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)