-->
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.  [ 2 posts ] 
Author Message
 Post subject: NHibernate formula hql
PostPosted: Mon Mar 31, 2008 7:00 am 
Beginner
Beginner

Joined: Sun Oct 22, 2006 12:06 pm
Posts: 39
In some entities have it's formulas,
but there is a bug in formula parser.

For instance I have

class Order
{
..
public virtual int CountOfOrderLines { get; set; }
}

so I have a formula for CountOfOrderLines as
(SELECT COUNT(ORDER_LINE.ORDER_LINE_ID)
FROM ORDER_LINE
WHERE ORDER_LINE.REF_ORDER_MASTER = ORDER_MASTER_ID
)

if execute an hql like "from Order o"
but the generated sql is like

select order0_.ORDER_ID as ORDER1_36_, ... , order0_.(SELECT COUNT(ORDER_LINE.ORDER_LINE_ID)
FROM ORDER_LINE
WHERE ORDER_LINE.REF_ORDER_MASTER = ORDER_MASTER_ID
) AS column12_36_, ... FROM from ORDER order0_

now the bug is in generated hql expressin order0_.( in formula,


Top
 Profile  
 
 Post subject:
PostPosted: Mon Mar 31, 2008 10:02 am 
Beginner
Beginner

Joined: Sun Oct 22, 2006 12:06 pm
Posts: 39
I'm a idiot.

(Forgot to put formula clause for formula criterias)


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 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.