Hi,
I have some DAO's that using SQLQuery for fetching data from database .
I have some application security requirement to filter the return results - this requirements is cross application, not for a single dao .
My dao's model objects are simple pojo's that not mapped by hibernate (not annotated with @Entity)
1. I tried to Implement LoadEventListener , and it seems that on runtime it execute just for @Entity objects bound to the session , but not for objects that not mapped by hibernate and using SQLQuery
2 .I also thought of using Interceptor but I dont sure there is a way to filter result return from database , I found this post on the same issue - not answered
Quote:
https://forum.hibernate.org/viewtopic.php?f=1&t=929687&view=previous
Is there is a way to dynamically change SqlQuery by adding a "where" / or another condition ? / Pre executing changing / manipulating the sql string result that will be generated by hibernate ?
Is there is a way to filter results by Hibernate Interceptor ?
Thanks in advance