Created attachment 855112 [details] Simple pure Hibernate Maven JUnit test Description of problem: When a composite key is used a "select count (distinct <entity_type>)" query fails to enclose the column names that make up the key attribute in parenthesis and the following exception is raised: org.hibernate.exception.SQLGrammarException: could not extract ResultSet ... Caused by: org.postgresql.util.PSQLException: ERROR: function count(character varying, character varying) does not exist Hint: No function matches the given name and argument types. You might need to add explicit type casts. Position: 8 Version-Release number of selected component (if applicable): EAP 6.1.1 and Hibernate 4.2.0.SP1 How reproducible: Consistently Steps to Reproduce: 1. Using Hibernate core libraries that include the fix for https://hibernate.atlassian.net/browse/HHH-7165 (introduced in Hibernate 4.1.2), create an entity with a composite key 2. Issue a "select count (distinct <entity_type>)" query Actual results: Raises exception above Expected results: Should return a numeric count Additional info: https://hibernate.atlassian.net/browse/HHH-8864
Corrected upstream and will be a part of the EAP 6.3 component upgrade.
Fixed by upgrade -> ON_QA
verified on EAP 6.3.0.ER1