-->
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.  [ 4 posts ] 
Author Message
 Post subject: Count don't work! I am dummy?
PostPosted: Fri Mar 23, 2007 12:13 pm 
Newbie

Joined: Wed Sep 06, 2006 8:33 am
Posts: 19
NHibernate version: 1.2

Name and version of the database you are using: Firebird

I try to get the number of records in a table with this expression:
Code:
string query="SELECT COUNT(T) FROM Class1 as T";
this.Session.CreateQuery(query).UniqueResult();


And i receive this exception:
Code:
path expression ends in a composite value [SELECT COUNT(T) FROM Class1 as T]


Note: My class have a composite-id, this same expression in other class works fine.

Any ideas?


Top
 Profile  
 
 Post subject: Really don't works.
PostPosted: Fri Mar 23, 2007 12:17 pm 
Beginner
Beginner

Joined: Fri Oct 20, 2006 8:02 am
Posts: 36
I've also tried to do that and it didn't work.

I couldn't find the erro to.

Some one knows what is wrong with it?


Top
 Profile  
 
 Post subject:
PostPosted: Fri Mar 23, 2007 12:34 pm 
Contributor
Contributor

Joined: Wed May 11, 2005 4:59 pm
Posts: 1766
Location: Prague, Czech Republic
Use count(*).


Top
 Profile  
 
 Post subject:
PostPosted: Fri Mar 23, 2007 1:43 pm 
Newbie

Joined: Wed Sep 06, 2006 8:33 am
Posts: 19
Really, I am dummy!

thanks sergey


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