# Getting an UnsupportedOperationException: Re-work support for semi-resolve

**URL:** <https://discourse.hibernate.org/t/getting-an-unsupportedoperationexception-re-work-support-for-semi-resolve/8830>\
**Category:** Hibernate ORM\
**Created:** [January 11, 2024, 9:29am UTC](https://discourse.hibernate.org/t/getting-an-unsupportedoperationexception-re-work-support-for-semi-resolve/8830 "2024-01-11T09:29:48Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Himanshu\_Jha](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.hibernate.org/himanshu_jha/32/2925_2.png) [@Himanshu\_Jha](https://discourse.hibernate.org/u/Himanshu_Jha)\
**Post date:** [January 11, 2024, 9:29am UTC](https://discourse.hibernate.org/t/getting-an-unsupportedoperationexception-re-work-support-for-semi-resolve/8830/1 "2024-01-11T09:29:48Z")

</div>

We have upgraded the hibernate-core version from 5.4.21.Final to 6.4.0.Final. and we are facing the same exception UnsupportedOperationException(“Re-work support for semi-resolve”);

Further, we have observed this in the case of one-to-many join (@JoinColumn Annotation) along with the findAll method for that entity and where the **referencedColumnName** is null.

Also, in hibernate-core version before 6.x ([hibernate-orm/hibernate-core/src/main/java/org/hibernate/type/CollectionType.java at main · hibernate/hibernate-orm · GitHub](https://github.com/hibernate/hibernate-orm/blob/main/hibernate-core/src/main/java/org/hibernate/type/CollectionType.java) ) method getKeyOfOwner (line 438)

`if ( !returnedClass.isInstance( id ) ) { id = keyType.semiResolve( entityEntry.getLoadedValue( foreignKeyPropertyName ), session, owner ); }`

now in versions 6.x (including 6.4.0.Final) the same method is changed to the below snippet.

` if (!keyType.getReturnedClass().isInstance(id)) { throw new UnsupportedOperationException("Re-work support for semi-resolve"); } else { return id; }`

For us, it is failing in 6.4.0.Final where id is null. The same case was working in version 5.4.21.Final

Could you please help?

The stacktrace looks like this

org.hibernate.NotYetImplementedFor6Exception: Re-work support for semi-resolve  
at org.hibernate.type.CollectionType.getKeyOfOwner(CollectionType.java:409)  
at org.hibernate.engine.internal.Collections.processReachableCollection(Collections.java:166)  
at org.hibernate.event.internal.FlushVisitor.processCollection(FlushVisitor.java:54)  
at org.hibernate.event.internal.AbstractVisitor.processValue(AbstractVisitor.java:92)  
at org.hibernate.event.internal.AbstractVisitor.processValue(AbstractVisitor.java:59)  
at org.hibernate.event.internal.AbstractVisitor.processEntityPropertyValues(AbstractVisitor.java:53)  
at org.hibernate.event.internal.DefaultFlushEntityEventListener.onFlushEntity(DefaultFlushEntityEventListener.java:152)  
at org.hibernate.event.service.internal.EventListenerGroupImpl.fireEventOnEachListener(EventListenerGroupImpl.java:107)  
at org.hibernate.event.internal.AbstractFlushingEventListener.flushEntities(AbstractFlushingEventListener.java:214)  
at org.hibernate.event.internal.AbstractFlushingEventListener.flushEverythingToExecutions(AbstractFlushingEventListener.java:90)  
at org.hibernate.event.internal.DefaultAutoFlushEventListener.onAutoFlush(DefaultAutoFlushEventListener.java:48)  
at org.hibernate.event.service.internal.EventListenerGroupImpl.fireEventOnEachListener(EventListenerGroupImpl.java:107)  
at org.hibernate.internal.SessionImpl.autoFlushIfRequired(SessionImpl.java:1388)  
at org.hibernate.query.sqm.internal.ConcreteSqmSelectQueryPlan.lambda$new$0(ConcreteSqmSelectQueryPlan.java:111)  
at org.hibernate.query.sqm.internal.ConcreteSqmSelectQueryPlan.withCacheableSqmInterpretation(ConcreteSqmSelectQueryPlan.java:335)  
at org.hibernate.query.sqm.internal.ConcreteSqmSelectQueryPlan.performList(ConcreteSqmSelectQueryPlan.java:276)  
at org.hibernate.query.sqm.internal.QuerySqmImpl.doList(QuerySqmImpl.java:571)  
at org.hibernate.query.spi.AbstractSelectionQuery.list(AbstractSelectionQuery.java:363)  
at org.hibernate.query.sqm.internal.QuerySqmImpl.list(QuerySqmImpl.java:1073)  
at org.hibernate.query.spi.AbstractSelectionQuery.getSingleResult(AbstractSelectionQuery.java:457)  
at org.hibernate.query.sqm.internal.QuerySqmImpl.getSingleResult(QuerySqmImpl.java:1103)  
at org.springframework.data.jpa.repository.query.JpaQueryExecution$SingleEntityExecution.doExecute(JpaQueryExecution.java:193)  
at org.springframework.data.jpa.repository.query.JpaQueryExecution.execute(JpaQueryExecution.java:90)  
at org.springframework.data.jpa.repository.query.AbstractJpaQuery.doExecute(AbstractJpaQuery.java:148)  
at org.springframework.data.jpa.repository.query.AbstractJpaQuery.execute(AbstractJpaQuery.java:136)  
at org.springframework.data.repository.core.support.RepositoryMethodInvoker.doInvoke(RepositoryMethodInvoker.java:136)  
at org.springframework.data.repository.core.support.RepositoryMethodInvoker.invoke(RepositoryMethodInvoker.java:120)  
at org.springframework.data.repository.core.support.QueryExecutorMethodInterceptor.doInvoke(QueryExecutorMethodInterceptor.java:164)  
at org.springframework.data.repository.core.support.QueryExecutorMethodInterceptor.invoke(QueryExecutorMethodInterceptor.java:143)  
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:184)  
at org.springframework.data.projection.DefaultMethodInvokingMethodInterceptor.invoke(DefaultMethodInvokingMethodInterceptor.java:72)  
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:184)  
at org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:123)  
at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:391)  
at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:119)  
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:184)  
at org.springframework.dao.support.PersistenceExceptionTranslationInterceptor.invoke(PersistenceExceptionTranslationInterceptor.java:137)  
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:184)  
at org.springframework.data.jpa.repository.support.CrudMethodMetadataPostProcessor$CrudMethodMetadataPopulatingMethodInterceptor.invoke(CrudMethodMetadataPostProcessor.java:135)  
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:184)  
at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:97)  
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:184)  
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:244)  
at jdk.proxy5/jdk.proxy5.$Proxy1184.findBySellSession\_idSellSession(Unknown Source)  
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)  
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)  
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)  
at java.base/java.lang.reflect.Method.invoke(Method.java:568)  
at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:343)  
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:237)  
at jdk.proxy5/jdk.proxy5.$Proxy1348.findBySellSession\_idSellSession(Unknown Source)  
at com.mycompany.service.myservice.mymethod.java:485)  
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)  
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)  
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)  
at java.base/java.lang.reflect.Method.invoke(Method.java:568)

---

<div class="post-metadata">

**Author:** ![beikov](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.hibernate.org/beikov/32/258_2.png) [@beikov](https://discourse.hibernate.org/u/beikov)\
**Post date:** [January 12, 2024, 3:53pm UTC](https://discourse.hibernate.org/t/getting-an-unsupportedoperationexception-re-work-support-for-semi-resolve/8830/2 "2024-01-12T15:53:52Z")

</div>

Please try to create a reproducer with our test case template ([hibernate-test-case-templates/orm/hibernate-orm-6/src/test/java/org/hibernate/bugs/JPAUnitTestCase.java at main · hibernate/hibernate-test-case-templates · GitHub](https://github.com/hibernate/hibernate-test-case-templates/blob/master/orm/hibernate-orm-6/src/test/java/org/hibernate/bugs/JPAUnitTestCase.java)) and if you are able to reproduce the issue, create a bug ticket in our issue tracker([https://hibernate.atlassian.net](https://hibernate.atlassian.net)) and attach that reproducer.

---

<div class="post-metadata">

**Author:** ![wertical](https://avatars.discourse-cdn.com/v4/letter/w/b782af/32.png) [@wertical](https://discourse.hibernate.org/u/wertical)\
**Post date:** [February 4, 2024, 9:28am UTC](https://discourse.hibernate.org/t/getting-an-unsupportedoperationexception-re-work-support-for-semi-resolve/8830/3 "2024-02-04T09:28:25Z")

</div>

This happens to me when Lombok is used for collections e.g.

```auto
@OneToMany
@JoinColumn(name = "BATCH_JOB_EXECUTION_ID", referencedColumnName = "BATCH_JOB_EXECUTION_ID")
@Builder.Default // Causes re-work support for semi-resolve
private Set<JobExecutionParameter> parameters = new HashSet<>();

```

---

<div class="post-metadata">

**Author:** ![beikov](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.hibernate.org/beikov/32/258_2.png) [@beikov](https://discourse.hibernate.org/u/beikov)\
**Post date:** [February 5, 2024, 10:28am UTC](https://discourse.hibernate.org/t/getting-an-unsupportedoperationexception-re-work-support-for-semi-resolve/8830/4 "2024-02-05T10:28:40Z")

</div>

> Please try to create a reproducer with our test case template ([hibernate-test-case-templates/orm/hibernate-orm-6/src/test/java/org/hibernate/bugs/JPAUnitTestCase.java at main · hibernate/hibernate-test-case-templates · GitHub](https://github.com/hibernate/hibernate-test-case-templates/blob/master/orm/hibernate-orm-6/src/test/java/org/hibernate/bugs/JPAUnitTestCase.java)) and if you are able to reproduce the issue, create a bug ticket in our issue tracker([https://hibernate.atlassian.net](https://hibernate.atlassian.net/)) and attach that reproducer.

Then please be so kind and submit a bug report along with a reproducer based on our test case template.

---

<div class="post-metadata">

**Author:** ![Jayaprabahar](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.hibernate.org/jayaprabahar/32/3071_2.png) [@Jayaprabahar](https://discourse.hibernate.org/u/Jayaprabahar)\
**Post date:** [April 3, 2024, 8:43am UTC](https://discourse.hibernate.org/t/getting-an-unsupportedoperationexception-re-work-support-for-semi-resolve/8830/5 "2024-04-03T08:43:45Z")

</div>

Hi @Himanshu_Jha Any solution found for this issue. We get this as well after Hibernate upgrade.

---

<div class="post-metadata">

**Author:** ![beikov](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.hibernate.org/beikov/32/258_2.png) [@beikov](https://discourse.hibernate.org/u/beikov)\
**Post date:** [April 3, 2024, 1:15pm UTC](https://discourse.hibernate.org/t/getting-an-unsupportedoperationexception-re-work-support-for-semi-resolve/8830/6 "2024-04-03T13:15:49Z")

</div>

I think that this issue was reported as [[HHH-17184] - Hibernate JIRA](https://hibernate.atlassian.net/browse/HHH-17184), so you can watch that to get updates about the current state.  
If you care about this, please consider contributing a test case or also a fix.
