-->
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: Using formula-based property causes invalid SQL code for chi
PostPosted: Fri Dec 05, 2008 2:18 pm 
Newbie

Joined: Mon Sep 15, 2008 8:30 pm
Posts: 7
Hi,

I am facing the below issue, which was reported in JIRA on 26/Jan/06(see below URL), but seem it is not fixed yet. Is there any workaround for this?
Please help me, it's very important for me. Thanks.

URL : http://opensource.atlassian.com/project ... e/HHH-1400


Using formula-based property causes invalid SQL code for children "subselect" query

I have simple one-to-many relationship, mapped as set:

<class name="Parent">
<set name="children" lazy="false" fetch="subselect">
<key column="PARENT_OID"/>
<one-to-many class="Child"/>
</set>
</class>

this works fine, constructing subselect SQL which looks like (e.g. for HQL query "from Parent"):
select <child fields> from <child table> where child.PARENT_OID in (select this_.OID from PARENT this_)
(simplified)

However, when adding a formula-based property into Parent:
<property name="myFormulaField" formula="(complex_select )"/>

Now SQL becomes:
select <child fields> from <child table> where PARENT_OID in (complex_select) as formula0_1_, <some parent fields> from PARENT this_)

This SQL fails because of incorrect grammar (it also seems that backet is missing).

This is something weird, because subselect fetching only needs Parent's identity column, not any other properties. And I don't think it should be affected by Parent's formula-based properties.



http://opensource.atlassian.com/projects/hibernate/browse/HHH-1400


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.