I'm trying to make a request to get data from the database
The boolean value of three options comes into the parameters:
But I can't figure out what to do with null
@Repository
public interface Repo extends ReactiveCrudRepository<Device,Long> {
@Query("SELECT * FROM device where user_id = $1 and show = $2")
Flux<Device> findByUserIdAndShow(String userId, Boolean show);
}
@Query("SELECT * FROM device where user_id = $1 and ($2 is null or show = $2)")