-
1. Re: Entity bean association ???
epbernard Aug 25, 2005 11:45 AM (in response to jc7442)I don't know what you're talking about.
An association has to have an annotation describing it's logical multiplicity -
2. Re: Entity bean association ???
jc7442 Aug 25, 2005 12:13 PM (in response to jc7442)If I do not specify any association, entity bean are deployed, I can create instance in the DB and when I look the DB using an SQL browser (I have a mySql db), I can see a column with the name of my field containing a tiny blob.
If I add the ManyToOne annotation, using the same browser I see that the mapping for my object has changed and now instead of a tiny blob, I see the PK of the objects.
My question was just to understand why with no annotation I have a tiny blob (is it a default value or something that may be paramater ?).
Another problem I try to solve is:
- I have a node entity bean that handles an interface leaf. In JDO2, this kind of mapping is possible, I just need to specify the list of valid classes that implment this interface (if classes are not specified, all classes are valid). I try to do the same with hibernate, I do not find annotation to specify the list of valid classes. If I just add ManyToOne annotation, I have the following exception at deployment time:16:48:41,536 WARN [ServiceController] Problem creating service jboss.j2ee:module=Persistence.par,uid=20796783,service=EJB3 org.hibernate.AnnotationException: Unable to find entity fr.biomerieux.dnachip.bo.classification.Leaf at org.hibernate.cfg.AnnotationBinder.bindFkSecondPass(AnnotationBinder.java:1480) at org.hibernate.cfg.FkSecondPass.secondPass(FkSecondPass.java:37) at org.hibernate.cfg.FkSecondPass.doSecondPass(FkSecondPass.java:31) at org.hibernate.cfg.AnnotationConfiguration.secondPassCompile(AnnotationConfiguration.java:215) at org.hibernate.cfg.Configuration.buildMappings(Configuration.java:876) at org.hibernate.ejb.HibernatePersistence.handleListenerCallbacks(HibernatePersistence.java:448) at org.hibernate.ejb.HibernatePersistence.createEntityManagerFactory(HibernatePersistence.java:438) at org.hibernate.ejb.HibernatePersistence.createContainerEntityManagerFactory(HibernatePersistence.java:272) at org.jboss.ejb3.Ejb3Deployment.initializeManagedEntityManagerFactory(Ejb3Deployment.java:476) at org.jboss.ejb3.Ejb3Deployment.create(Ejb3Deployment.java:219) at org.jboss.ejb3.Ejb3Module.createService(Ejb3Module.java:34) at org.jboss.system.ServiceMBeanSupport.jbossInternalCreate(ServiceMBeanSupport.java:252) at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:234) at sun.reflect.GeneratedMethodAccessor2.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:141) at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80) at org.jboss.mx.server.Invocation.invoke(Invocation.java:72) at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:245) at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:644) at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:974) at $Proxy0.create(Unknown Source) at org.jboss.system.ServiceController.create(ServiceController.java:356) at org.jboss.system.ServiceController.create(ServiceController.java:295) at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:141) at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80) at org.jboss.mx.server.Invocation.invoke(Invocation.java:72) at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:245) at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:644) at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:176) at $Proxy17.create(Unknown Source) at org.jboss.ejb3.EJB3Deployer.create(EJB3Deployer.java:178) at org.jboss.deployment.MainDeployer.create(MainDeployer.java:919) at org.jboss.deployment.MainDeployer.create(MainDeployer.java:909) at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:773) at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:737) at sun.reflect.GeneratedMethodAccessor16.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:141) at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80) at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:118) at org.jboss.mx.server.Invocation.invoke(Invocation.java:74) at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:127) at org.jboss.mx.server.Invocation.invoke(Invocation.java:74) at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:245) at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:644) at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:176) at $Proxy9.deploy(Unknown Source)
I probably just missed something in the mapping, but I can not find what !!! -
3. Re: Entity bean association ???
jc7442 Aug 26, 2005 5:42 AM (in response to jc7442)A thread that answer my interface problem:
http://forum.hibernate.org/viewtopic.php?p=2238824#2238824