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

Fix versions

Labels

None

backPortable

None

Suitable for new contributors

None

Requires Release Note

None

Pull Request

None

backportDecision

None

Components

Affects versions

Priority

Major
Configure