Does Hibernate support processing values with database functions for insert and update? My classes contain character representations of Oracle OLS labels which need to be converted to numbers using Oracle's to_data_label function. This function cannot be reproduced in java since the mapping is done via Oracle's OLS policy tables and I do not want to make a separate query to get the values from Oracle.
The sql I want would look something like this: update myClass set myColumn = to_data_label(myClassAttribute) where id = 100;
Bob Runstein<br />Microsoft Certified Professional<br />Sun Certified Developer for the Java 2 Platform<br />Sun Certified Enterprise Architect for the Java 2 Platform<br /> <br />BR Solutions LLC<br />20797 E. Fair Ln<br />Centennial, CO 80016<br />720-870-7244 home<br />720-254-8966 cell<br />firstname.lastname@example.org
Hibernate does not support the various DB extentions to SQL you see accross all the various flavours of Database. But it does provide createSQLQuery methods (see net.sf.hibernate.Session) which let you call native SQL for those special cases. I'd always re-examine the need for platform specific SQL though. It might be unavoidable, but if not approached carefully you end up negating one of the main benefits of using an ORM technology: it's usefullness cross platform.