I've found some contradicting information on the net. Does anyone know whether Hib开发者_开发技巧ernate filters affect the generated sql, or is it just filtering the data as it's read from the database?
Hibernate filters affect the where clause of the generated SQL.
The Introduction to Hibernate Filters is a nice article on filters and provides a demo application allowing to play with them.
If you enable SQL in Hibernate using show_sql"(+"format_sql")
,
and execute query with enabled filter, you will see the result.
For example:
select
item0_.ID as ID0_
from
ITEMS item0_
where
item0_.deleted = 'FALSE' <-- here is filtering
精彩评论