Looks like the SampleEJB.ear in the attachment is not a correct ear.
I am unable to deploy it on Weblogic server.

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.

Are you using openJPA configurations or kodo configurations ?
There was a known issue with a CLOB data type when kodo configuration is
used. 
The fix for this is in kodo files, it overrides openJPA's classes in order
to fix it.

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.

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.

Also there were some workarounds of setting "SubclassFetchMode=none";which I
would not completely recommend with out understanding your complete
environment.

Regards,
Ravi.


himadri wrote:
> 
> 
> 
> Hi,
> 
> This is strange. The problem comes when I add Child Associations to the
> entity. If I remove Child Asscoiations , all work fine. I have attached my
> Sample here. 
> Please see JPG for Entity Associations. SampleEJB.ear is the deployable
> ear on WL10.3. 
> 
> 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 ! 
> 
> Lemme know if I can provide more simplified sample ....
> 
> Thanks,
> Himadri 
> 
> 
> ________________________________
> From: Kevin Sutter [via OpenJPA]
> <ml-node+4103283-1191879...@n2.nabble.com>
> To: himadri <hima_...@yahoo.co.in>
> Sent: Thu, 3 December, 2009 5:39:17 AM
> Subject: Re: Open JPA generates incorrect Union All for Date and Boolean
> Datatype
> 
> This sounds very strange.  From your description, I have no idea why Date 
> and Boolean attributes are having problems with Oracle.  And, why a Union 
> All is being generated for a simple find operation baffles me as well. 
> Unless there is some inheritance or eagerly fetched relationships
> involved. 
> Still, I thought OpenJPA used Joins over Unions. 
> 
> Can you simplify the problem to a simple testcase that could be provided? 
> 
> Thanks, 
> Kevin 
> 
> On Tue, Dec 1, 2009 at 7:15 AM, himadri <[hidden email]> wrote: 
> 
> 
>> 
>> Hi, 
>> 
>> I have an EJB3.0 application deployed on Weblogic 10.3 and Oracle 10g DB.
>> I 
>> have an entity Typed which has Date and Boolean datatypes. em.persist is 
>> sucessful. 
>> 
>> But whereever there is em.find() on any entity in this application , I
>> have 
>> observed that open JPA  tries to get Union  of all entities. This may be 
>> because its first time , But it fails with exception 
>> 
>> "[BEA][Oracle JDBC Driver][Oracle]ORA-01790:expression must have same 
>> datatype as corresponding expression" 
>> 
>> The SQL generated is union all of all entities in the application . For 
>> boolean FLAG_F , MOMENT_F wrong sql is generated. It should have to_date 
>> function for date. I have used DATE and boolean in Entity class. 
>> 
>> SELECT 0, t0.ID, t0.version, t0.NAME_F, '', 0, NULL, '', 0, 0, 
>> '1970-01-01', 
>> '', 0.0 FROM AddOn_T t0 WHERE t0.ID = ? 
>> UNION ALL 
>> SELECT 1, t0.ID, t0.version, '', '', 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.ID = ? [params=(String) 30, (String) 30]} [code=1790,
>> state=HY000] 
>> 
>> I guess openJPA fails to add to_date function for DATE and surrounding 
>> chars 
>> for boolean. Is this a bug or some settings available.  Why is it trying
>> to 
>> get union all even for em.find(... ) ? 
>> 
>> Thanks in advance.. 
>> - H 
>> 
>> 
>> 
>> 
>> 
>> 
>> -- 
>> View this message in context: 
>> 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. 
>> 
> 
> 
> ________________________________
> 
> View message @
> http://n2.nabble.com/Open-JPA-generates-incorrect-Union-All-for-Date-and-Boolean-Datatype-tp4093559p4103283.html
>  
> To unsubscribe from Open JPA generates incorrect Union All for Date and
> Boolean Datatype, click here. 
> 
> 
> 
>       The INTERNET now has a personality. YOURS! See your Yahoo! Homepage.
> http://in.yahoo.com/
>  
> 

-- 
View this message in context: 
http://n2.nabble.com/Open-JPA-generates-incorrect-Union-All-for-Date-and-Boolean-Datatype-tp4093559p4130072.html
Sent from the OpenJPA Users mailing list archive at Nabble.com.

Reply via email to