Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

IsTrue/False in Spring Data query creation

Does Spring Data query creation supports IsTrue/False in the query creation?

I found this section http://docs.spring.io/spring-data/jpa/docs/1.0.0.M1/reference/html/#jpa.query-methods.query-creation in an older version documentation, but I cannot find something similar for the latest version.

like image 277
Adrian Ber Avatar asked May 13 '26 00:05

Adrian Ber


1 Answers

Yes, simply use IsTrue or IsFalse your repository methods:

interface PersonRepository extends Repository<Person, Long> {

  Iterable<Person> findByActiveIsTrue();
}

This is also listed in the keywords section of the reference documentation.

like image 123
Oliver Drotbohm Avatar answered May 14 '26 14:05

Oliver Drotbohm



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!