-->
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: How do you do a criteria API projection on a superclass?
PostPosted: Fri Apr 08, 2011 4:00 am 
Newbie

Joined: Mon Aug 15, 2005 9:19 pm
Posts: 8
Hi,

I have three classes A, B and C that inherit from a common superclass D. The classes are mapped one table for each class A, B and C.

Problem is that when I do a count projection I get three rows returned. A count for each "table". I want one row.

Code:
session.createCriteria(D.class).setProjection(Projections.rowCount())


Is is possible with the criteria API or do I have to use native SQL?

Any assistance much appreciated.

Cheers,
David


Top
 Profile  
 
 Post subject: Re: How do you do a criteria API projection on a superclass?
PostPosted: Sun Apr 10, 2011 8:11 pm 
Newbie

Joined: Mon Aug 15, 2005 9:19 pm
Posts: 8
I logged a bug is JIRA for this http://opensource.atlassian.com/projects/hibernate/browse/HHH-6104


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.