title: Hibernate Mapping for Oracle RAW column
body: <p>We're using Hibernate and not sure how to map properties to RAW columns in Oracle table (specifically that have indexes on them).</p>
  
  <p>It's a known fact that <strong>String</strong> can't be used for entity property value - Hibernate isn't able to prepend the <strong>HEXTORAW</strong> Oracle function call in order to make index on a column to be used (cause without this Oracle implicitly appends RAWTOHEX to column value itself).</p>
  
  <p>However, it's not clear whether using <strong>byte[]</strong> as an entity property value is solving this issue or not. Since JDBC driver is sending binary data directly - it's logical to assume that index would be used - cause there is no any need to execute neither <strong>HEXTORAW</strong> nor <strong>RAWTOHEX</strong> functions.</p>
  
  <p>However, I'm not sure how to prove it (except putting million of records and performing some benchmarks). 
  I tried to search similar questions but without success.</p>
  
  <p>Does anyone has knowledge about that?
  Thanks in advance,</p>