[prev in list] [next in list] [prev in thread] [next in thread] 

List:       openejb-user
Subject:    Re: How to set Java / JDBC / SQL type mapping with Open EJB ?
From:       "Olivier THIERRY" <olivier.thierry () gmail ! com>
Date:       2008-11-07 8:37:59
Message-ID: 6bbf89b80811070037s5bdc2250i6ee32192e1de5c79 () mail ! gmail ! com
[Download RAW message or body]


I had a response about this problem, and this due to HSQDLB itself, not
Hibernate neither OpenEJB.
Actually HSQLDB nevers use Java float internally, just doubles, so I should
define my properties as double instead of float.

Olivier

2008/11/6 Olivier THIERRY <olivier.thierry@gmail.com>

> Thanks for your response.
>
> I should have known this was a problem with JPA implementation since the
> problem is the same when using Hibernate console, and Open EJB is not
> involved in this case !
>
> Anyway I can't test with Open JPA because I use some specific Hibernate
> features. So I will ask my question on Hibernate forums and I will report
> here, I am sure it's something that could be useful for many people.
>
> Olivier
>
> 2008/11/5 David Blevins <david.blevins@visi.com>
>
>
>> On Nov 4, 2008, at 7:52 AM, Olivier THIERRY wrote:
>>
>>  But it nevers returns any result, while I have no problem running the
>>> similar queries with string or int columns instead of float one ! So it=
's
>>> just a problem with floats. Moreover using Hibernate console, I could
>>> make
>>> it work but I had to set my parameter as a double. So it looks like I
>>> have a
>>> type mapping problem with floats between Java, JDBC and HSQLDB. For wha=
t
>>> I
>>> understood this type mapping is configured on the application server. I=
n
>>> JBoss AS (the one I use in production), there's a file for this, called
>>> standardjbosscmp-jdbc.xml. It defines for each database product and eac=
h
>>> Java type the JDBC and SQL corresponding types. Do we have the equivale=
nt
>>> with Open EJB ? Or is there something I misunderstood with JPA ? Please
>>> tell
>>> me if it's not a problem with Open EJB because I am not sure at all abo=
ut
>>> this.
>>>
>>
>>
>> Type mapping is all handled by the JPA provider.  I'd double check with
>> Hibernate.
>>
>> I know OpenJPA and other JPA implementations have logic that adapts thei=
r
>> JDBC usage to match the dialect of the database and the capabilities of =
its
>> JDBC driver.  Pretty sure I've seen a similar property for Hibernate.
>>
>> One quick test might be to temporarily switch your JPA provider to say
>> OpenJPA, which is certified, and see how it handles the query.
>>
>> -David
>>
>>
>
>
> --
> Seules 2 choses sont infinies : l'univers et la b=EAtise humaine ; et enc=
ore
> pour l'univers, je ne suis pas s=FBr =85 (Einstein)
>


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic