-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: auto-generated table alias in property formula
PostPosted: Mon Nov 17, 2008 3:17 pm 
Newbie

Joined: Mon Nov 17, 2008 2:49 pm
Posts: 1
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


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.