You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Due to HHH-12996, a limitation of the Hibernate @IdClass implementation, the implementation of MetaModelImpl#collectIdColumns(...) has some issues with processing domains that suffer from this Hibernate issue. The code in f8cc47b#diff-c2515d6af07b654068b5c62a6567e084R199 will try to look up a nested property, which is not present in the PropertyMapping.
It's not a big blocker that this isn't supported, because apparently this construction is very rare, and even if we would be able to work around the issue, the produced query wouldn't get through the Hibernate query engine because it will fail to process the dot node due to the very same issue. It is however problematic, that due to this exception the entire generation of the metamodel fails. My suggested fix is henceforth to swallow and log the exception, but I'm open to any other suggestions as to how to work around this issue.
For a domain that shows the issue, you can use the domain from my reproducer provided in hibernate/hibernate-orm#2546
Description
Expected behavior
Actual behavior
Steps to reproduce
Environment
Version:
JPA-Provider:
DBMS:
Application Server:
The text was updated successfully, but these errors were encountered:
I see some changes in collectIdColumns indeed , but I'm not sure whether it will work. In order to expand the association attributes for proper CTE binding, we need to resolve the properties, which means we need to create an attribute entry. The contructor of this class fails because isJoinable does a lookup against the EntityPersisters BasicEntityPropertyMapping. The attribute should be there, but isn't. Changing the code to work around this would produce the correct JPQL, but as HHH-12996 shows, because of this issue, Hibernate isn't able to parse the JPQL too. So there is no way to fix this for Hibernate unless we make use of the IdClass properties that can be obtained through the magic path attribute .id or add extra unnecessary joins to the query.
Due to HHH-12996, a limitation of the Hibernate
@IdClass
implementation, the implementation ofMetaModelImpl#collectIdColumns(...)
has some issues with processing domains that suffer from this Hibernate issue. The code in f8cc47b#diff-c2515d6af07b654068b5c62a6567e084R199 will try to look up a nested property, which is not present in thePropertyMapping
.It's not a big blocker that this isn't supported, because apparently this construction is very rare, and even if we would be able to work around the issue, the produced query wouldn't get through the Hibernate query engine because it will fail to process the dot node due to the very same issue. It is however problematic, that due to this exception the entire generation of the metamodel fails. My suggested fix is henceforth to swallow and log the exception, but I'm open to any other suggestions as to how to work around this issue.
For a domain that shows the issue, you can use the domain from my reproducer provided in hibernate/hibernate-orm#2546
Description
Expected behavior
Actual behavior
Steps to reproduce
Environment
Version:
JPA-Provider:
DBMS:
Application Server:
The text was updated successfully, but these errors were encountered: