HHH-8567 - Query identifier properties

Patch and test for HHH-8567 JIRA ticket.
Link: https://hibernate.atlassian.net/browse/HHH-8567

@adamw: Could you review my comment in the JIRA ticket and hereby pull request.

Best regards,
Lukasz Antoniak