Test case: https://github.com/johnaohara/hibernate-orm/commit/e416ca42accd97923862da8fa4048ff01993a686