We're updating the issue view to help you get more done. 

count() query on classes using EmbeddedId should not use id column tuple on Dialects which dont support non-distinct tuple counts

Description

When doing a count on a class mapped as EmbeddedId with multiple Id's the generated sql will fail on several db's (tested on MySQL/MariaDB) since hibernate generate a count sql containing all the id's.
Hibernate creates a different (correct) sql on classes mapped with IdClass and multiple Id's.
A simple test that verify the difference between the two:
https://github.com/stalep/hibernate-orm/commit/54911765de7981ec9a2318fc9928be68ff37bab3

Environment

None

Status

Assignee

Steve Ebersole

Reporter

Ståle W. Pedersen

Components

Fix versions

Affects versions

4.1.1

Priority

Major