Issues
- Query "select count(h) from Human h" fails if a subclass has a non-Id property named "id"HHH-13114Resolved issue: HHH-13114Andrea Boriero
- Querying entity with non-ID property named 'id' fails if entity has an IdClass composite keyHHH-13084Resolved issue: HHH-13084Former user
- Legacy Criteria query referencing entity having @ManyToMany relationship with FetchType.EAGER results in incorrect number of rowsHHH-13067
- Accessing id property of association within element collection in query leads to exceptionHHH-13045Resolved issue: HHH-13045Christian Beikov
- Incorrect SQL generated by EntityGraph when having ManyToOne and ManyToMany relations and fetch their childHHH-13031
- Property paths for associations that are part of the entity ID (i.e. IdClass) are not initializedHHH-12996Resolved issue: HHH-12996Jan-Willem Gmelig Meyling
- Consider throwing UnsupportedOperationException when a bytecode-enhanced entity's clone method is calledHHH-12971
- NotFoundLogicalOneToOneTest fails on Oracle due to identifiers that are too long (5.1)HHH-12958Resolved issue: HHH-12958Former user
- Joining element collection on correlated inverse association produces wrong SQLHHH-12942
- Set of value objects with primary key and composite user type causes GenericJDBCException with index out of rangeHHH-8982Resolved issue: HHH-8982
10 of 10
Query "select count(h) from Human h" fails if a subclass has a non-Id property named "id"
Fixed
Description
Created November 22, 2018 at 6:07 AM
Updated January 19, 2019 at 5:31 PM
Resolved December 18, 2018 at 5:29 PM
Activity
Show:
Former userDecember 18, 2018 at 5:29 PM
Pushed to master and 5.3 branches.
Former userNovember 27, 2018 at 5:54 PM
, , I can confirm this is needed in 5.1.
Andrea BorieroNovember 23, 2018 at 1:19 PM
I may be wrong but I think this PR is really urgent for the 5.1.17 release but not for master.
Anyway I think will take care of this one on Monday.
Guillaume SmetNovember 23, 2018 at 12:43 PM
do we really need to have that committed to master soon? (Maybe it's required to have it in 5.1.x?)
I think we will have to release a CR2 due to the dependency issues with JAXB that Yoann fixed.
But I would prefer to keep it to the minimum if possible and move everything we can postpone to 5.4.1.
Given the following classes:
Executing the query:
select count( h ) from Human h
results in the following SQL:Note that:
idproperty0_.id
is not the primary key column;Human
does not have a property namedid
;count
should be operating on the primary key,idproperty0_.realId
.The same select expression is generated using
@Inheritance(strategy = InheritanceType.TABLE_PER_CLASS)
.When
@Inheritance(strategy = InheritanceType.JOINED)
is used, the generated SQL is:In addition to using the wrong column, there is no table with alias
idproperty0_1_
.