OneToOne relationships of classes using SINGLE_TABLE inheritance are null when eager loading is used. With lazy loading the relationships are loaded correctly. The error is reproducible with both the Hibernate Query API and Hibernate Criteria API, although they produce slightly different SQL queries and results. The attached ZIP file contains a test case with four test methods:
- queryLazyFetchTest - passes
- queryEagerFetchTest - fails
- criteriaLazyFetchTest - passes
- criteriaEagerFetchTest - fails
|