-->
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: JPA QL query with COUNT() fails for composite PK
PostPosted: Sat Nov 25, 2006 11:47 am 
Regular
Regular

Joined: Sat Nov 25, 2006 11:37 am
Posts: 72
I have an entity mapped to a table with a composite PK.

A JPA QL query of the form:

select COUNT(o) from Entity as o

creates the following invalid SQL:

SELECT COUNT(PK1, PK2) FROM EntityTable

Using Toplink as JPA provider against the same entities and queries works fine as Toplink emits:

SELECT COUNT(*) FROM EntityTable

Is this a Hibernate bug or am I incorrectly using the JPA QL?

This is with the latest version of Hibernate against a MySQL 4.1.x database.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Dec 04, 2006 4:49 pm 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
can you provide a runnable testcase and attach it to JIRA

_________________
Emmanuel


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.