• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Doubt about native query

 
Victor Maehira
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Good afternoon!
I�ve downloaded the o'reilly ejb 3.0 book's example code. I was running the source code related to native sql queries when I got a ClassCastException. The snippet source code is the following :

Cruise Entity:


Query call:

(The same code can be found on page 623 and 624 of o'reilly book)

The ClassCastException happens in:


If the result�s index is changed, the application works correctly.



How can I justify it?
Thanks in advance!
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Cruise comes first, so as you said, it should be result[0], not result[1].
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic