[hibernate-issues] [Hibernate-JIRA] Resolved: (EJB-148) Incorrect exception when @CollectionOfElement is used with @Where and FetchType is EAGER
Emmanuel Bernard (JIRA)
noreply at atlassian.com
Mon Aug 28 23:56:24 EDT 2006
[ http://opensource.atlassian.com/projects/hibernate/browse/EJB-148?page=all ]
Emmanuel Bernard resolved EJB-148:
----------------------------------
Fix Version: 3.2.0.cr2
Resolution: Fixed
Assign To: Emmanuel Bernard
> Incorrect exception when @CollectionOfElement is used with @Where and FetchType is EAGER
> ----------------------------------------------------------------------------------------
>
> Key: EJB-148
> URL: http://opensource.atlassian.com/projects/hibernate/browse/EJB-148
> Project: Hibernate Entity Manager
> Type: Bug
> Components: EntityManager
> Versions: 3.1.0.Beta8
> Environment: Jboss Embedded Alfa 5, Hibernate 3.1, mysql 5.0.15
> Reporter: Filippo Guerzoni
> Assignee: Emmanuel Bernard
> Priority: Minor
> Fix For: 3.2.0.cr2
> Attachments: test.zip
>
>
> Hello,
> When using together
> @CollectionOfElements(fetch= FetchType.EAGER)
> @Where(clause="state='A'")
> @JoinTable(name = "functions_loglev", joinColumns = @JoinColumn(name = "id"))
> I'm exeperiencing the following MappingException that doesn't occur when using FetchType.LAZY
> ERROR 11-03 09:46:26,890 (AbstractController.java:incrementState:350) -Error installing to Start: name=persistence.units:jar=Prototype.jar,unitName=logdb state=Create
> org.hibernate.MappingException: @ManyToMany defining filter or where without join fetching not valid within collection using join fetching[model.strutcture.functions.levels]
> at org.hibernate.cfg.annotations.CollectionBinder.checkFilterConditions(CollectionBinder.java:863)
> at org.hibernate.cfg.annotations.CollectionBinder.bindManyToManySecondPass(CollectionBinder.java:849)
> at org.hibernate.cfg.annotations.CollectionBinder.bindStarToManySecondPass(CollectionBinder.java:421)
> at org.hibernate.cfg.annotations.CollectionBinder$1.secondPass(CollectionBinder.java:382)
> at org.hibernate.cfg.CollectionSecondPass.doSecondPass(CollectionSecondPass.java:35)
> at org.hibernate.cfg.annotations.CollectionBinder.bind(CollectionBinder.java:331)
> at org.hibernate.cfg.AnnotationBinder.processElementAnnotations(AnnotationBinder.java:1296)
> at org.hibernate.cfg.AnnotationBinder.bindClass(AnnotationBinder.java:629)
> at org.hibernate.cfg.AnnotationConfiguration.processArtifactsOfType(AnnotationConfiguration.java:276)
> at org.hibernate.cfg.AnnotationConfiguration.secondPassCompile(AnnotationConfiguration.java:210)
> at org.hibernate.cfg.Configuration.buildMappings(Configuration.java:997)
> at org.hibernate.ejb.Ejb3Configuration.buildMappings(Ejb3Configuration.java:722)
> at org.hibernate.ejb.EventListenerConfigurator.configure(EventListenerConfigurator.java:161)
> at org.hibernate.ejb.Ejb3Configuration.createEntityManagerFactory(Ejb3Configuration.java:567)
> at org.hibernate.ejb.Ejb3Configuration.createContainerEntityManagerFactory(Ejb3Configuration.java:245)
> at org.hibernate.ejb.HibernatePersistence.createContainerEntityManagerFactory(HibernatePersistence.java:108)
> at org.jboss.ejb3.entity.PersistenceUnitDeployment.start(PersistenceUnitDeployment.java:260)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> at java.lang.reflect.Method.invoke(Method.java:585)
> at org.jboss.joinpoint.plugins.reflect.ReflectMethodJoinPoint.dispatch(ReflectMethodJoinPoint.java:72)
> at org.jboss.kernel.plugins.dependency.KernelControllerContextActions.dispatchJoinPoint(KernelControllerContextActions.java:96)
> at org.jboss.kernel.plugins.dependency.KernelControllerContextActions$LifecycleAction.installAction(KernelControllerContextActions.java:476)
> at org.jboss.kernel.plugins.dependency.KernelControllerContextActions$KernelControllerContextAction.install(KernelControllerContextActions.java:171)
> at org.jboss.dependency.plugins.AbstractControllerContextActions.install(AbstractControllerContextActions.java:51)
> at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:226)
> at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:593)
> at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:346)
> at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:438)
> at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:379)
> at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:225)
> at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:151)
> at org.jboss.kernel.plugins.dependency.AbstractKernelController.install(AbstractKernelController.java:79)
> at org.jboss.kernel.plugins.dependency.AbstractKernelController.install(AbstractKernelController.java:73)
> at org.jboss.ejb3.MCKernelAbstraction.install(MCKernelAbstraction.java:86)
> at org.jboss.ejb3.Ejb3Deployment.startPersistenceUnits(Ejb3Deployment.java:599)
> at org.jboss.ejb3.Ejb3Deployment.start(Ejb3Deployment.java:452)
> at org.jboss.ejb3.embedded.EJB3StandaloneDeployer.start(EJB3StandaloneDeployer.java:450)
> at AllModelTests.startupEmbeddedJboss(AllModelTests.java:49)
> at AllModelTests$1.setUp(AllModelTests.java:25)
> at junit.extensions.TestSetup$1.protect(TestSetup.java:18)
> at junit.framework.TestResult.runProtected(TestResult.java:124)
> at junit.extensions.TestSetup.run(TestSetup.java:23)
> at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:478)
> at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:344)
> at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196)
> Deleting the @WHERE annotation the Exception disappears.
> I can't understand it at all.
> Why the stack trace refers to manytomany? It's a simple composition of elements.
> Thanks in advance.
> F
> Hibernate version:
> 3.1 with annotations beta8
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://opensource.atlassian.com/projects/hibernate/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira
More information about the hibernate-issues
mailing list