[~dometec], I was able to reproduce this and will take a closer look when I have a chance. Notes for myself:
CollectionBinder#bind had a relevant fix commented out -- switched it to the following: {code} // do it right away, otherwise @ManyToOne on composite element call addSecondPass // and raise a ConcurrentModificationException sp.doSecondPass( CollectionHelper.EMPTY_MAP ); // mappings.addSecondPass( sp, !isMappedBy ); {code}
Your entities had the following, causing the issue: {code} User @ElementCollection(fetch = FetchType.EAGER) private Set<Address> addresses; Address @ElementCollection(fetch = FetchType.EAGER) @Enumerated(EnumType.STRING) private Set<AddressType> type; {code}
Un-commenting that fix results in an exception at the following stack. Something goofy is going on with the CompositeElementPropertyMapping sequence -- Address#type is being interpreted as "One to One", according to the exception. {code} Thread [main] (Suspended (breakpoint at line 61 in AbstractPropertyMapping)) CompositeElementPropertyMapping(AbstractPropertyMapping).getIdentifierColumnNames() line: 61 CompositeElementPropertyMapping(AbstractPropertyMapping).initPropertyPaths(String, Type, String[], String[], String[], String[], Mapping) line: 187 CompositeElementPropertyMapping(AbstractPropertyMapping).initComponentPropertyPaths(String, CompositeType, String[], String[], String[], String[], Mapping) line: 285 CompositeElementPropertyMapping.<init>(String[], String[], String[], String[], CompositeType, Mapping) line: 49 BasicCollectionPersister(AbstractCollectionPersister).<init>(Collection, CollectionRegionAccessStrategy, Configuration, SessionFactoryImplementor) line: 551 BasicCollectionPersister.<init>(Collection, CollectionRegionAccessStrategy, Configuration, SessionFactoryImplementor) line: 76 NativeConstructorAccessorImpl.newInstance0(Constructor, Object[]) line: not available [native method] NativeConstructorAccessorImpl.newInstance(Object[]) line: 57 DelegatingConstructorAccessorImpl.newInstance(Object[]) line: 45 Constructor<T>.newInstance(Object...) line: 525 PersisterFactoryImpl.create(Class<CollectionPersister>, Class[], Object, Object, CollectionRegionAccessStrategy, SessionFactoryImplementor) line: 231 PersisterFactoryImpl.createCollectionPersister(Configuration, Collection, CollectionRegionAccessStrategy, SessionFactoryImplementor) line: 201 SessionFactoryImpl.<init>(Configuration, Mapping, ServiceRegistry, Settings, SessionFactoryObserver) line: 421 Configuration.buildSessionFactory(ServiceRegistry) line: 1849 TestCase(BaseCoreFunctionalTestCase).buildSessionFactory() line: 147 NativeMethodAccessorImpl.invoke0(Method, Object, Object[]) line: not available [native method] NativeMethodAccessorImpl.invoke(Object, Object[]) line: 57 DelegatingMethodAccessorImpl.invoke(Object, Object[]) line: 43 Method.invoke(Object, Object...) line: 601 TestClassMetadata.performCallbackInvocation(Method, Object) line: 209 TestClassMetadata.invokeCallback(Method, Object) line: 196 TestClassMetadata.performCallbacks(LinkedHashSet<Method>, Object) line: 190 TestClassMetadata.performBeforeClassCallbacks(Object) line: 181 BeforeClassCallbackHandler.evaluate() line: 42 AfterClassCallbackHandler.evaluate() line: 42 CustomRunner(ParentRunner<T>).run(RunNotifier) line: 300 JUnit4TestMethodReference(JUnit4TestReference).run(TestExecution) line: 50 TestExecution.run(ITestReference[]) line: 38 RemoteTestRunner.runTests(String[], String, TestExecution) line: 467 RemoteTestRunner.runTests(TestExecution) line: 683 RemoteTestRunner.run() line: 390 RemoteTestRunner.main(String[]) line: 197 {code}
|
|