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 11: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 15: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: Mon Oct 20 08:22:23 GMT 2014

Powered by FUDForum. Page generated in 0.13522 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software