Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp
Hibernate version: 3.2.6.ga
Mapping documents:
Code between sessionFactory.openSession() and session.close():
Full stack trace of any exception that occurs:
Name and version of the database you are using: Oracle 10g
The generated SQL (show_sql=true):
Debug level Hibernate log excerpt:
Hello,
In my hibernate-mapping file I am attempting to call a database decrypt function on a string field in the formula attribute of the property tag:
<property name="fname" formula="mydecryptfunction(request0_.personname.fname)">
</property>
The problem is that I have to specify the table alias (request0_) in the attribute. This forces my code to have to be aware of the generated alias.
I would prefer the alias to be picked up from my dao method:
return getHibernateTemplate()
.find("from mypackage.RequestEntity myAliasName")
But the generated sql always uses the auto-generated alias "request0_":
select request0_.ID as ID0_, decrypt(request0_.personname.fname) as formula0_ from REQUEST request0_
If it is not possible to force the generated sql to use my assigned alias, I would like to use some kind of placeholder for the generated alias in the formula, so I don't have to hardcode it.; or to at least override the generated alias somewhere.
Does anyone have an idea as to how to resolve this?
This appears related to the following issue which is unresolved:
http://opensource.atlassian.com/project ... e/HHH-1902.
Thanks