-->
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.  [ 6 posts ] 
Author Message
 Post subject: computed property question
PostPosted: Wed Dec 03, 2003 6:54 pm 
Newbie

Joined: Wed Dec 03, 2003 5:23 pm
Posts: 7
If I use the formula attribute of property how do I refer to other properies in the sql statement?


Top
 Profile  
 
 Post subject:
PostPosted: Wed Dec 03, 2003 7:48 pm 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
I don't think you can right now.
Submit a request to Jira (if there isn't any on this subject)

_________________
Emmanuel


Top
 Profile  
 
 Post subject:
PostPosted: Wed Dec 03, 2003 8:05 pm 
Newbie

Joined: Wed Dec 03, 2003 5:23 pm
Posts: 7
I tried this:

<id name="id" column="id" type="long">
<generator class="sequence">
<param name="sequence">security_seq</param>
</generator>
</id>

<property name="name" column="NAME" type="string" />
<property name="description" column="DESCR" type="string" />
<property name="path" column="PATH" type="string" />

<property name="childCount" insert="false" update="false"
formula="(select count(*) from user_group_hierarchies ugh where ugh.parent_group_id = id)"
/>

where the id primary key is refered to at the end of the select statement, which seems to be working. I guess I was expecting to have to delimit the property somehow.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Dec 03, 2003 8:46 pm 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
I read in the HQL statement and not in the sql statement => wrong answer.

_________________
Emmanuel


Top
 Profile  
 
 Post subject:
PostPosted: Wed Dec 03, 2003 9:03 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 12:50 pm
Posts: 5130
Location: Melbourne, Australia
The formula attributes refers to columns, not properties.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Dec 04, 2003 11:17 am 
Newbie

Joined: Wed Dec 03, 2003 5:23 pm
Posts: 7
I think I'm beginning to understand. thanks.


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

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.