Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EclipseLink » Getting Double instead of BigDecimal when using EntityManager#createNativeQuery()
Getting Double instead of BigDecimal when using EntityManager#createNativeQuery() [message #642932] Fri, 03 December 2010 06:57 Go to next message
Mik is currently offline Mik
Messages: 3
Registered: August 2010
Junior Member
Hello,
I am executing SQL statements via the JPA EntityManager's method createNativeQuery().

For numerical data (decimals) in the database I get BigDecimals within my Java programm.

Is there a way to tell JPA to return these values as Doubles instead of as BigDecimals?

Regards,
Mik
Re: Getting Double instead of BigDecimal when using EntityManager#createNativeQuery() [message #643356 is a reply to message #642932] Mon, 06 December 2010 10:51 Go to previous message
James Sutherland is currently offline James Sutherland
Messages: 1939
Registered: July 2009
Location: Ottawa, Canada
Senior Member

For a raw native query, no, whatever the database returns is returned.

If you define the native query to return an Entity, then the types will be automatically converter to the Entity's types.


James : Wiki : Book : Blog : Twitter
Previous Topic:Union
Next Topic:Using Extensions for Schema Generation
Goto Forum:
  


Current Time: Wed Jul 30 09:11:59 EDT 2014

Powered by FUDForum. Page generated in 0.01827 seconds