Skip to main content


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 MikFriend
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 SutherlandFriend
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: Thu Apr 25 08:58:35 GMT 2024

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

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

Back to the top