Return-Path: Delivered-To: apmail-openjpa-users-archive@minotaur.apache.org Received: (qmail 85950 invoked from network); 11 Dec 2009 06:11:56 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 11 Dec 2009 06:11:56 -0000 Received: (qmail 47573 invoked by uid 500); 11 Dec 2009 06:11:56 -0000 Delivered-To: apmail-openjpa-users-archive@openjpa.apache.org Received: (qmail 47500 invoked by uid 500); 11 Dec 2009 06:11:54 -0000 Mailing-List: contact users-help@openjpa.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@openjpa.apache.org Delivered-To: mailing list users@openjpa.apache.org Received: (qmail 47481 invoked by uid 99); 11 Dec 2009 06:11:54 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 11 Dec 2009 06:11:54 +0000 X-ASF-Spam-Status: No, hits=-1.7 required=5.0 tests=AWL,BAYES_00 X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of lists+1214986160035-208411@n2.nabble.com designates 216.139.236.158 as permitted sender) Received: from [216.139.236.158] (HELO kuber.nabble.com) (216.139.236.158) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 11 Dec 2009 06:11:50 +0000 Received: from jim.nabble.com ([192.168.236.80]) by kuber.nabble.com with esmtp (Exim 4.63) (envelope-from ) id 1NIyiu-0003zY-UC for users@openjpa.apache.org; Thu, 10 Dec 2009 22:11:28 -0800 Date: Thu, 10 Dec 2009 22:11:28 -0800 (PST) From: Himadri To: users@openjpa.apache.org Message-ID: <1260511888926-4149660.post@n2.nabble.com> In-Reply-To: <1260504832232-4149434.post@n2.nabble.com> References: <1259673349454-4093559.post@n2.nabble.com> <89c0c52c0912021608j45c1e99bra50dd4e0e0ae85de@mail.gmail.com> <1260195720158-4126266.post@n2.nabble.com> <1260241294806-4130072.post@n2.nabble.com> <1260349850961-4138239.post@n2.nabble.com> <1260504832232-4149434.post@n2.nabble.com> Subject: Re: Open JPA generates incorrect Union All for Date and Boolean Datatype MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Nabble-From: Himadri Hi Ravi , Thanks ! It worked with none. I need to run all the test cases to see this is not breaking others. Yes , the default behaviour is JOIN not parallel , but User Guide mentions parallel as default. We dont want JOIN. I have put it as none for now.=20 All Entities extends EntityBase which has common attribute like id and version. Do you think this is not a good way to implement ?=20 Ravi P Palacherla wrote: >=20 > Hi Himadri, >=20 > Here are answers for some of your questions: >=20 >>> Why is it trying to get union all even for em.find(... ) ?=20 >=20 > In your application all the entities ( E.g: AddOn.java, Typed.java) are > all subclasses of EntityBase. >=20 > If you use either of the following property: > > or > > then you will not see the error. >=20 > If you use parallel, then seperate select statements are used to eager > fetch data for subclasses=20 > and if you use "none" then I guess it will no try to fetch the subclasses= . > so, you can use any of the above properties to fix your issue. >=20 > The third type of SubclassFetchMode is "join" and even though the > documentation claims that "parallel" is default mode=20 > http://openjpa.apache.org/builds/1.1.0/apache-openjpa-1.1.0/docs/manual/m= anual.html#openjpa.jdbc.SubclassFetchMode > The default looks like "join" mode. >=20 > So if using any of the above properties is acceptable to you then please > use it. >=20 > If you must use "JOIN" then please let me know and I will spend more time > to find the cause of the issue. >=20 > Regards, > Ravi. >=20 >=20 >=20 >=20 >=20 > Himadri wrote: >>=20 >> So sorry .. attached the wrong one .. Please see the correct one here.If >> I run the junit , I get this exception "javax.ejb.EJBException: EJB >> Exception: ; nested exception is:=20 >> =09 >> org.apache.openjpa.persistence.PersistenceException: [BEA][Oracle JDBC >> Driver][Oracle]ORA-01790: expression must have same datatype as >> corresponding expression >> {prepstmnt 2625 SELECT 0, t0.ID, t0.version, t0.master_Ref, t0.NAME_F, >> '', 0, NULL, '', 0, 0, '1970-01-01', '', 0.0 FROM AddOn_T t0 WHERE t0.ID >> =3D ? UNION ALL SELECT 1, t0.ID, t0.version, t0.addOn_Ref, t0.NAME_F, ''= , >> 0, NULL, '', 0, 0, '1970-01-01', '', 0.0 FROM Master_T t0 WHERE t0.ID = =3D ? >> UNION ALL SELECT 2, t0.ID, t0.version, t0.NAME_F, t0.primaryMaster_Ref, >> t0.secondaryMaster_Ref, 0, NULL, '', 0, 0, '1970-01-01', '', 0.0 FROM >> Slave_T t0 WHERE t0.ID =3D ? UNION ALL SELECT 3, t0.ID, t0.version, >> t0.addOn_Ref, t0.NAME_F, '', 0, NULL, '', 0, 0, '1970-01-01', '', 0.0 >> FROM SubAddOn_T t0 WHERE t0.ID =3D ? UNION ALL SELECT 4, t0.ID, t0.versi= on, >> t0.NAME_F, t0.slave_Ref, '', 0, NULL, '', 0, 0, '1970-01-01', '', 0.0 >> FROM SubSlave_T t0 WHERE t0.ID =3D ? UNION ALL SELECT 5, t0.ID, t0.versi= on, >> '', '', '', t0.COUNTER_F, t0.DATA_F, t0.ENUMED1_F, t0.ENUMED2_F, >> t0.FLAG_F, t0.MOMENT_F, t0.NAME_F, t0.VALUE_F FROM TYPED_T t0 WHERE t0.I= D >> =3D ? [params=3D(String) 34B85860E33211DE984DF2390A53043A, (String) >> 34B85860E33211DE984DF2390A53043A, (String) >> 34B85860E33211DE984DF2390A53043A, (String) >> 34B85860E33211DE984DF2390A53043A, (String) >> 34B85860E33211DE984DF2390A53043A, (String) >> 34B85860E33211DE984DF2390A53043A]} [code=3D1790, state=3DHY000] >> =09at >> weblogic.ejb.container.internal.RemoteBusinessIntfProxy.unwrapRemoteExce= ption(RemoteBusinessIntfProxy.java:105) >> =09at >> weblogic.ejb.container.internal.RemoteBusinessIntfProxy.invoke(RemoteBus= inessIntfProxy.java:87) >> =09at $Proxy0.testType(Unknown Source) >> =09at com.tieto.magic.poc.test.TestSample.testP(TestSample.java:54) >> =09at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) >> =09at >> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.jav= a:39) >> =09at >> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessor= Impl.java:25) >> =09at java.lang.reflect.Method.invoke(Method.java:597) >> =09at junit.framework.TestCase.runTest(TestCase.java:168) >> =09at junit.framework.TestCase.runBare(TestCase.java:134) >> =09at junit.framework.TestResult$1.protect(TestResult.java:110) >> =09at junit.framework.TestResult.runProtected(TestResult.java:128) >> =09at junit.framework.TestResult.run(TestResult.java:113) >> =09at junit.framework.TestCase.run(TestCase.java:124) >> =09at junit.framework.TestSuite.runTest(TestSuite.java:232) >> =09at junit.framework.TestSuite.run(TestSuite.java:227) >> =09at >> org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.jav= a:81) >> =09at >> org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4Tes= tReference.java:45) >> =09at >> org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.ja= va:38) >> =09at >> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTe= stRunner.java:460) >> =09at >> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTe= stRunner.java:673) >> =09at >> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRun= ner.java:386) >> =09at >> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRu= nner.java:196) >> Caused by: >> org.apache.openjpa.persistence.PersistenceException: [BEA][Oracle JDBC >> Driver][Oracle]ORA-01790: expression must have same datatype as >> corresponding expression >> {prepstmnt 2625 SELECT 0, t0.ID, t0.version, t0.master_Ref, t0.NAME_F, >> '', 0, NULL, '', 0, 0, '1970-01-01', '', 0.0 FROM AddOn_T t0 WHERE t0.ID >> =3D ? UNION ALL SELECT 1, t0.ID, t0.version, t0.addOn_Ref, t0.NAME_F, ''= , >> 0, NULL, '', 0, 0, '1970-01-01', '', 0.0 FROM Master_T t0 WHERE t0.ID = =3D ? >> UNION ALL SELECT 2, t0.ID, t0.version, t0.NAME_F, t0.primaryMaster_Ref, >> t0.secondaryMaster_Ref, 0, NULL, '', 0, 0, '1970-01-01', '', 0.0 FROM >> Slave_T t0 WHERE t0.ID =3D ? UNION ALL SELECT 3, t0.ID, t0.version, >> t0.addOn_Ref, t0.NAME_F, '', 0, NULL, '', 0, 0, '1970-01-01', '', 0.0 >> FROM SubAddOn_T t0 WHERE t0.ID =3D ? UNION ALL SELECT 4, t0.ID, t0.versi= on, >> t0.NAME_F, t0.slave_Ref, '', 0, NULL, '', 0, 0, '1970-01-01', '', 0.0 >> FROM SubSlave_T t0 WHERE t0.ID =3D ? UNION ALL SELECT 5, t0.ID, t0.versi= on, >> '', '', '', t0.COUNTER_F, t0.DATA_F, t0.ENUMED1_F, t0.ENUMED2_F, >> t0.FLAG_F, t0.MOMENT_F, t0.NAME_F, t0.VALUE_F FROM TYPED_T t0 WHERE t0.I= D >> =3D ? [params=3D(String) 34B85860E33211DE984DF2390A53043A, (String) >> 34B85860E33211DE984DF2390A53043A, (String) >> 34B85860E33211DE984DF2390A53043A, (String) >> 34B85860E33211DE984DF2390A53043A, (String) >> 34B85860E33211DE984DF2390A53043A, (String) >> 34B85860E33211DE984DF2390A53043A]} [code=3D1790, state=3DHY000] >> =09at >> org.apache.openjpa.jdbc.sql.SQLExceptions.narrow(SQLExceptions.java:146) >> =09at >> org.apache.openjpa.jdbc.sql.DBDictionary.newStoreException(DBDictionary.= java:4150) >> =09at >> org.apache.openjpa.jdbc.sql.SQLExceptions.getStore(SQLExceptions.java:10= 2) >> =09at >> org.apache.openjpa.jdbc.sql.SQLExceptions.getStore(SQLExceptions.java:88= ) >> =09at >> org.apache.openjpa.jdbc.sql.SQLExceptions.getStore(SQLExceptions.java:64= ) >> =09at >> org.apache.openjpa.jdbc.kernel.JDBCStoreManager.initialize(JDBCStoreMana= ger.java:268) >> =09at >> org.apache.openjpa.kernel.DelegatingStoreManager.initialize(DelegatingSt= oreManager.java:111) >> =09at >> org.apache.openjpa.datacache.DataCacheStoreManager.initialize(DataCacheS= toreManager.java:336) >> =09at >> org.apache.openjpa.kernel.DelegatingStoreManager.initialize(DelegatingSt= oreManager.java:111) >> =09at >> org.apache.openjpa.kernel.ROPStoreManager.initialize(ROPStoreManager.jav= a:57) >> =09at org.apache.openjpa.kernel.BrokerImpl.initialize(BrokerImpl.java:89= 4) >> =09at kodo.kernel.KodoBroker.initialize(KodoBroker.java:65) >> =09at org.apache.openjpa.kernel.BrokerImpl.find(BrokerImpl.java:852) >> =09at org.apache.openjpa.kernel.BrokerImpl.find(BrokerImpl.java:769) >> =09at kodo.kernel.KodoBroker.find(KodoBroker.java:232) >> =09at >> org.apache.openjpa.kernel.DelegatingBroker.find(DelegatingBroker.java:18= 3) >> =09at >> org.apache.openjpa.persistence.EntityManagerImpl.find(EntityManagerImpl.= java:452) >> =09at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) >> =09at >> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.jav= a:39) >> =09at >> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessor= Impl.java:25) >> =09at java.lang.reflect.Method.invoke(Method.java:597) >> =09at >> weblogic.deployment.BasePersistenceContextProxyImpl.invoke(BasePersisten= ceContextProxyImpl.java:90) >> =09at >> weblogic.deployment.TransactionalEntityManagerProxyImpl.invoke(Transacti= onalEntityManagerProxyImpl.java:89) >> =09at >> weblogic.deployment.BasePersistenceContextProxyImpl.invoke(BasePersisten= ceContextProxyImpl.java:80) >> =09at >> weblogic.deployment.TransactionalEntityManagerProxyImpl.invoke(Transacti= onalEntityManagerProxyImpl.java:24) >> =09at $Proxy140.find(Unknown Source) >> =09at >> com.tieto.magic.poc.domain.DomainServicesBean.testType(DomainServicesBea= n.java:48) >> =09at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) >> =09at >> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.jav= a:39) >> =09at >> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessor= Impl.java:25) >> =09at java.lang.reflect.Method.invoke(Method.java:597) >> =09at >> com.bea.core.repackaged.springframework.aop.support.AopUtils.invokeJoinp= ointUsingReflection(AopUtils.java:281) >> =09at >> com.bea.core.repackaged.springframework.aop.framework.ReflectiveMethodIn= vocation.invokeJoinpoint(ReflectiveMethodInvocation.java:187) >> =09at >> com.bea.core.repackaged.springframework.aop.framework.ReflectiveMethodIn= vocation.proceed(ReflectiveMethodInvocation.java:154) >> =09at >> com.bea.core.repackaged.springframework.aop.support.DelegatingIntroducti= onInterceptor.doProceed(DelegatingIntroductionInterceptor.java:126) >> =09at >> com.bea.core.repackaged.springframework.aop.support.DelegatingIntroducti= onInterceptor.invoke(DelegatingIntroductionInterceptor.java:114) >> =09at >> com.bea.core.repackaged.springframework.aop.framework.ReflectiveMethodIn= vocation.proceed(ReflectiveMethodInvocation.java:176) >> =09at >> com.bea.core.repackaged.springframework.jee.spi.MethodInvocationVisitorI= mpl.visit(MethodInvocationVisitorImpl.java:15) >> =09at >> weblogic.ejb.container.injection.EnvironmentInterceptorCallbackImpl.call= back(EnvironmentInterceptorCallbackImpl.java:54) >> =09at >> com.bea.core.repackaged.springframework.jee.spi.EnvironmentInterceptor.i= nvoke(EnvironmentInterceptor.java:30) >> =09at >> com.bea.core.repackaged.springframework.aop.framework.ReflectiveMethodIn= vocation.proceed(ReflectiveMethodInvocation.java:176) >> =09at >> com.bea.core.repackaged.springframework.aop.interceptor.ExposeInvocation= Interceptor.invoke(ExposeInvocationInterceptor.java:89) >> =09at >> com.bea.core.repackaged.springframework.aop.framework.ReflectiveMethodIn= vocation.proceed(ReflectiveMethodInvocation.java:176) >> =09at >> com.bea.core.repackaged.springframework.aop.support.DelegatingIntroducti= onInterceptor.doProceed(DelegatingIntroductionInterceptor.java:126) >> =09at >> com.bea.core.repackaged.springframework.aop.support.DelegatingIntroducti= onInterceptor.invoke(DelegatingIntroductionInterceptor.java:114) >> =09at >> com.bea.core.repackaged.springframework.aop.framework.ReflectiveMethodIn= vocation.proceed(ReflectiveMethodInvocation.java:176) >> =09at >> com.bea.core.repackaged.springframework.aop.framework.JdkDynamicAopProxy= .invoke(JdkDynamicAopProxy.java:210) >> =09at $Proxy142.testType(Unknown Source) >> =09at >> com.tieto.magic.poc.domain.DomainServicesBean_au5mn8_DomainServicesRImpl= .testType(DomainServicesBean_au5mn8_DomainServicesRImpl.java:65) >> =09at >> com.tieto.magic.poc.domain.DomainServicesBean_au5mn8_DomainServicesRImpl= _WLSkel.invoke(Unknown >> Source) >> =09at weblogic.rmi.internal.BasicServerRef.invoke(BasicServerRef.java:58= 9) >> =09at >> weblogic.rmi.cluster.ClusterableServerRef.invoke(ClusterableServerRef.ja= va:230) >> =09at weblogic.rmi.internal.BasicServerRef$1.run(BasicServerRef.java:477= ) >> =09at >> weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSu= bject.java:363) >> =09at weblogic.security.service.SecurityManager.runAs(Unknown Source) >> =09at >> weblogic.rmi.internal.BasicServerRef.handleRequest(BasicServerRef.java:4= 73) >> =09at >> weblogic.rmi.internal.wls.WLSExecuteRequest.run(WLSExecuteRequest.java:1= 18) >> =09at weblogic.work.ExecuteThread.execute(ExecuteThread.java:201) >> =09at weblogic.work.ExecuteThread.run(ExecuteThread.java:173) >> Caused by: java.lang.Exception: >> org.apache.openjpa.lib.jdbc.ReportingSQLException: [BEA][Oracle JDBC >> Driver][Oracle]ORA-01790: expression must have same datatype as >> corresponding expression >> {prepstmnt 2625 SELECT 0, t0.ID, t0.version, t0.master_Ref, t0.NAME_F, >> '', 0, NULL, '', 0, 0, '1970-01-01', '', 0.0 FROM AddOn_T t0 WHERE t0.ID >> =3D ? UNION ALL SELECT 1, t0.ID, t0.version, t0.addOn_Ref, t0.NAME_F, ''= , >> 0, NULL, '', 0, 0, '1970-01-01', '', 0.0 FROM Master_T t0 WHERE t0.ID = =3D ? >> UNION ALL SELECT 2, t0.ID, t0.version, t0.NAME_F, t0.primaryMaster_Ref, >> t0.secondaryMaster_Ref, 0, NULL, '', 0, 0, '1970-01-01', '', 0.0 FROM >> Slave_T t0 WHERE t0.ID =3D ? UNION ALL SELECT 3, t0.ID, t0.version, >> t0.addOn_Ref, t0.NAME_F, '', 0, NULL, '', 0, 0, '1970-01-01', '', 0.0 >> FROM SubAddOn_T t0 WHERE t0.ID =3D ? UNION ALL SELECT 4, t0.ID, t0.versi= on, >> t0.NAME_F, t0.slave_Ref, '', 0, NULL, '', 0, 0, '1970-01-01', '', 0.0 >> FROM SubSlave_T t0 WHERE t0.ID =3D ? UNION ALL SELECT 5, t0.ID, t0.versi= on, >> '', '', '', t0.COUNTER_F, t0.DATA_F, t0.ENUMED1_F, t0.ENUMED2_F, >> t0.FLAG_F, t0.MOMENT_F, t0.NAME_F, t0.VALUE_F FROM TYPED_T t0 WHERE t0.I= D >> =3D ? [params=3D(String) 34B85860E33211DE984DF2390A53043A, (String) >> 34B85860E33211DE984DF2390A53043A, (String) >> 34B85860E33211DE984DF2390A53043A, (String) >> 34B85860E33211DE984DF2390A53043A, (String) >> 34B85860E33211DE984DF2390A53043A, (String) >> 34B85860E33211DE984DF2390A53043A]} [code=3D1790, state=3DHY000] >> =09at >> org.apache.openjpa.util.Exceptions.replaceNestedThrowables(Exceptions.ja= va:249) >> =09at >> org.apache.openjpa.persistence.PersistenceException.writeObject(Persiste= nceException.java:100) >> =09at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) >> =09at >> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.jav= a:39) >> =09at >> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessor= Impl.java:25) >> =09at java.lang.reflect.Method.invoke(Method.java:597) >> =09at >> java.io.ObjectStreamClass.invokeWriteObject(ObjectStreamClass.java:945) >> =09at >> java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1461) >> =09at >> java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1= 392) >> =09at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:11= 50) >> =09at >> java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:15= 09) >> =09at >> java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1474) >> =09at >> java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1= 392) >> =09at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:11= 50) >> =09at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:326= ) >> =09at >> weblogic.rjvm.MsgAbbrevOutputStream.writeObject(MsgAbbrevOutputStream.ja= va:618) >> =09at >> weblogic.rjvm.MsgAbbrevOutputStream.sendThrowable(MsgAbbrevOutputStream.= java:471) >> =09at >> weblogic.rmi.internal.BasicServerRef.handleThrowable(BasicServerRef.java= :694) >> =09at >> weblogic.rmi.internal.BasicServerRef.postInvoke(BasicServerRef.java:650) >> =09at >> weblogic.rmi.internal.BasicServerRef.handleRequest(BasicServerRef.java:4= 92) >> =09... 3 more >>=20 >> " >>=20 >> http://n2.nabble.com/file/n4138239/SampleEJBEar.ear SampleEJBEar.ear=20 >>=20 >> Ravi P Palacherla wrote: >>>=20 >>> Looks like the SampleEJB.ear in the attachment is not a correct ear. >>> I am unable to deploy it on Weblogic server. >>>=20 >>> Also the configuration files (like persistence.xml) and entities are >>> missing in the attachment without which I may not be able to tell what >>> configuration you are using. >>>=20 >>> Are you using openJPA configurations or kodo configurations ? >>> There was a known issue with a CLOB data type when kodo configuration i= s >>> used.=20 >>> The fix for this is in kodo files, it overrides openJPA's classes in >>> order to fix it. >>>=20 >>> Before going into details of the fix, Please attach a replicable >>> testcase. >>> That way I can see if the same fix applies for your scenario or not. >>>=20 >>> It would be great if you are able to replicate the issue with openJPA >>> configuration itself; we can work together on resolving the issue in >>> openJPA itself. >>>=20 >>> Also there were some workarounds of setting >>> "SubclassFetchMode=3Dnone";which I would not completely recommend with = out >>> understanding your complete environment. >>>=20 >>> Regards, >>> Ravi. >>>=20 >>>=20 >>> himadri wrote: >>>>=20 >>>>=20 >>>>=20 >>>> Hi, >>>>=20 >>>> This is strange. The problem comes when I add Child Associations to th= e >>>> entity. If I remove Child Asscoiations , all work fine. I have attache= d >>>> my Sample here.=20 >>>> Please see JPG for Entity Associations. SampleEJB.ear is the deployabl= e >>>> ear on WL10.3.=20 >>>>=20 >>>> Let me know if you find out anything .. for now I have replace all >>>> em.find with em.createQuery(Select ...) , But will like to know the >>>> real reason behind it !=20 >>>>=20 >>>> Lemme know if I can provide more simplified sample .... >>>>=20 >>>> Thanks, >>>> Himadri=20 >>>>=20 >>>>=20 >>>> ________________________________ >>>> From: Kevin Sutter [via OpenJPA] >>>> >>>> To: himadri >>>> Sent: Thu, 3 December, 2009 5:39:17 AM >>>> Subject: Re: Open JPA generates incorrect Union All for Date and >>>> Boolean Datatype >>>>=20 >>>> This sounds very strange. =C2=A0From your description, I have no idea = why >>>> Date=20 >>>> and Boolean attributes are having problems with Oracle. =C2=A0And, why= a >>>> Union=20 >>>> All is being generated for a simple find operation baffles me as well.= =20 >>>> Unless there is some inheritance or eagerly fetched relationships >>>> involved.=20 >>>> Still, I thought OpenJPA used Joins over Unions.=20 >>>>=20 >>>> Can you simplify the problem to a simple testcase that could be >>>> provided?=20 >>>>=20 >>>> Thanks,=20 >>>> Kevin=20 >>>>=20 >>>> On Tue, Dec 1, 2009 at 7:15 AM, himadri <[hidden email]> wrote:=20 >>>>=20 >>>>=20 >>>>>=20 >>>>> Hi,=20 >>>>>=20 >>>>> I have an EJB3.0 application deployed on Weblogic 10.3 and Oracle 10g >>>>> DB. I=20 >>>>> have an entity Typed which has Date and Boolean datatypes. em.persist >>>>> is=20 >>>>> sucessful.=20 >>>>>=20 >>>>> But whereever there is em.find() on any entity in this application , = I >>>>> have=20 >>>>> observed that open JPA =C2=A0tries to get Union =C2=A0of all entities= . This may >>>>> be=20 >>>>> because its first time , But it fails with exception=20 >>>>>=20 >>>>> "[BEA][Oracle JDBC Driver][Oracle]ORA-01790:expression must have same= =20 >>>>> datatype as corresponding expression"=20 >>>>>=20 >>>>> The SQL generated is union all of all entities in the application . >>>>> For=20 >>>>> boolean FLAG_F , MOMENT_F wrong sql is generated. It should have >>>>> to_date=20 >>>>> function for date. I have used DATE and boolean in Entity class.=20 >>>>>=20 >>>>> SELECT 0, t0.ID, t0.version, t0.NAME_F, '', 0, NULL, '', 0, 0,=20 >>>>> '1970-01-01',=20 >>>>> '', 0.0 FROM AddOn_T t0 WHERE t0.ID =3D ?=20 >>>>> UNION ALL=20 >>>>> SELECT 1, t0.ID, t0.version, '', '', t0.COUNTER_F, t0.DATA_F, >>>>> t0.ENUMED1_F,=20 >>>>> t0.ENUMED2_F, t0.FLAG_F, t0.MOMENT_F, t0.NAME_F, t0.VALUE_F FROM >>>>> TYPED_T t0=20 >>>>> WHERE t0.ID =3D ? [params=3D(String) 30, (String) 30]} [code=3D1790, >>>>> state=3DHY000]=20 >>>>>=20 >>>>> I guess openJPA fails to add to_date function for DATE and surroundin= g=20 >>>>> chars=20 >>>>> for boolean. Is this a bug or some settings available. =C2=A0Why is i= t >>>>> trying to=20 >>>>> get union all even for em.find(... ) ?=20 >>>>>=20 >>>>> Thanks in advance..=20 >>>>> - H=20 >>>>>=20 >>>>>=20 >>>>>=20 >>>>>=20 >>>>>=20 >>>>>=20 >>>>> --=20 >>>>> View this message in context:=20 >>>>> http://n2.nabble.com/Open-JPA-generates-incorrect-Union-All-for-Date-= and-Boolean-Datatype-tp4093559p4093559.html >>>>> Sent from the OpenJPA Users mailing list archive at Nabble.com.=20 >>>>>=20 >>>>=20 >>>>=20 >>>> ________________________________ >>>>=20 >>>> View message @ >>>> http://n2.nabble.com/Open-JPA-generates-incorrect-Union-All-for-Date-a= nd-Boolean-Datatype-tp4093559p4103283.html=20 >>>> To unsubscribe from Open JPA generates incorrect Union All for Date an= d >>>> Boolean Datatype, click here.=20 >>>>=20 >>>>=20 >>>>=20 >>>> The INTERNET now has a personality. YOURS! See your Yahoo! >>>> Homepage. http://in.yahoo.com/ >>>> =20 >>>>=20 >>>=20 >>>=20 >>=20 >>=20 >=20 >=20 --=20 View this message in context: http://n2.nabble.com/Open-JPA-generates-incor= rect-Union-All-for-Date-and-Boolean-Datatype-tp4093559p4149660.html Sent from the OpenJPA Users mailing list archive at Nabble.com.