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] <[email protected]>
To: himadri <[email protected]>
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-tp4093559p4126266.html
Sent from the OpenJPA Users mailing list archive at Nabble.com.