Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Strange behaviour of Native Query

 
Ankit Garg
Sheriff
Posts: 9580
33
Android Google Web Toolkit Hibernate IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well I am using a complicated native query. Because of some sort of performance enhancements, EJB is giving me wrong result in that. First let me explain what the query looks like (I'm giving a simplified version of my query. I had to use native query because I had to group my results month wise)



Now I don't know why, it returns the same value for both the columns. I'm sure this is some sort of short cut used by JPA to use a cached version of the value for the second column as both the columns have the same. Although I've solved it by usin SqlResultSetMapping in Payment entity and modifying the query





Still if there is a way to correct this, then please tell me.

Thanks
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic