, WHERE, , .
?
select id, title, author from book where title = :title
?
select id, title, author from book where author = :author
?
select id, title, author from book where title = :title and author = :author
. (, , PreparedStatements) . , , PreparedStatement Java, if . , .
, SELECT, , .
, PreparedStatement, , NamedParameterJdbcTemplate , re Spring.
:
select id, title, author
from book
where coalesce(:title, title) = title
and coalesce(:author, author) = author
NULL . coalesce() - , . , NULL :title, where coalesce(NULL, title) = title, where title = title, , , .
, , . , , .
( , IN (?, ?, ?), , , / .)