[hibernate-issues] [JIRA] (HHH-7135) NoSuchElementException in AnnotationBinder.makeInheritanceJoinColumns() when Joined subclass mixed with @MapsId foreign-key id

Ondřej Fischer (JIRA) jira at hibernate.atlassian.net
Wed Jun 10 15:13:40 EDT 2020


Ondřej Fischer ( https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=5e7e3d1679f5ad0c341cdc01 ) *commented* on HHH-7135 ( https://hibernate.atlassian.net/browse/HHH-7135?atlOrigin=eyJpIjoiZmE3YjZmZTdkNDliNDA3ZWI1ZWEwOTM0YTJjNGMxYmYiLCJwIjoiaiJ9 )

Re: NoSuchElementException in AnnotationBinder.makeInheritanceJoinColumns() when Joined subclass mixed with @MapsId foreign-key id ( https://hibernate.atlassian.net/browse/HHH-7135?atlOrigin=eyJpIjoiZmE3YjZmZTdkNDliNDA3ZWI1ZWEwOTM0YTJjNGMxYmYiLCJwIjoiaiJ9 )

Hi,
I'm facing the same issue in version 5.4.10.Final, but cannot update the affected version.

The problem I see is in the class

DependantValue

.
This one on one hand extends SimpleValue, so it inherits field:

private final List<Selectable> columns;

which is initialized to empty list.
On the other hand, it's a wrapper on top of delegated value from the parent entity, which is referenced by field:

   private KeyValue wrappedValue;

The wrappedValue has proper columns available. But the DependantValue doesn't delegate call getColumnIterator() to the wrappedValue. It simply inherits this method, so it accesses it's empty list of columns instead of returning the wrapped one.

The MapsId logic is using this iterator, and in turn tries to map from empty iterator to non-empty list of columns, which hits the NoSuchElementException when calling next() on empty iterator (without testing hasNext() first).

( https://hibernate.atlassian.net/browse/HHH-7135#add-comment?atlOrigin=eyJpIjoiZmE3YjZmZTdkNDliNDA3ZWI1ZWEwOTM0YTJjNGMxYmYiLCJwIjoiaiJ9 ) Add Comment ( https://hibernate.atlassian.net/browse/HHH-7135#add-comment?atlOrigin=eyJpIjoiZmE3YjZmZTdkNDliNDA3ZWI1ZWEwOTM0YTJjNGMxYmYiLCJwIjoiaiJ9 )

Get Jira notifications on your phone! Download the Jira Cloud app for Android ( https://play.google.com/store/apps/details?id=com.atlassian.android.jira.core&referrer=utm_source%3DNotificationLink%26utm_medium%3DEmail ) or iOS ( https://itunes.apple.com/app/apple-store/id1006972087?pt=696495&ct=EmailNotificationLink&mt=8 ) This message was sent by Atlassian Jira (v1001.0.0-SNAPSHOT#100128- sha1:0213fc8 )
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/hibernate-issues/attachments/20200610/9c1f5f81/attachment.html 


More information about the hibernate-issues mailing list