I created a test which demonstrates the issue:
https://github.com/schauder/bug-hibernate-id-cascading/blob/tuple-alias/orm/hibernate-orm-5/src/test/java/org/hibernate/bugs/JPAUnitTestCase.java
This fails: {code} Query query = entityManager.createQuery("select one from SomeEntity where id = 23", Tuple.class);
Tuple tuple = (Tuple) query.getSingleResult();
TupleElement<?> element = tuple.getElements().get(0); assertNotNull(element.getAlias()); {code}
Because {{element.getAlias()}} returns {{null}} although I think it should return the column name {{"one"}}
Note that the test does not fail when the query is edited to include an explicit alias: { { select one as one from SomeEntity where id = 23} } |
|