I am trying to intercept Hibernate query execution, Here is my hibernate mapping
<class name="com.model.Parent" table="Parent"
optimistic-lock="version" dynamic-update="true" dynamic-insert="true"
type="org.hibernate.usertype.UserType" column="OBJECT_ID" />
( Here UserType is GUID format).....
If the generated query like the following
select * from Parent p_ where p_.id = ? OR p_.id in (?,?,?)
need to replace
HEXTORAW(?) for tables (columns defined with RAW).
Required query should be like this
select * from Parent p_ where p_.id = HEXTORAW(?) OR p_.id in (HEXTORAW(?),HEXTORAW(?),HEXTORAW(?))
Since I am working with existing system, can't change database column types.
How to find columns defined by RAW on the query execution (if i use interceptors or any other filters)?
and how to apply HEXTORAW() on those found columns?