See https://hibernate.atlassian.net/browse/HHH-5222?focusedCommentId=50227&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-50227