aspose file tools
The moose likes EJB Certification (SCBCD/OCPJBCD) and the fly likes Doubt about native query Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Certification » EJB Certification (SCBCD/OCPJBCD)
Reply Bookmark "Doubt about native query" Watch "Doubt about native query" New topic
Author

Doubt about native query

Victor Maehira
Ranch Hand

Joined: Mar 08, 2007
Posts: 32
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

Joined: Nov 24, 2005
Posts: 14670
    
  11

Cruise comes first, so as you said, it should be result[0], not result[1].


[My Blog]
All roads lead to JavaRanch
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: Doubt about native query
 
Similar Threads
Help with JPA
Answers of Sun's Free Proficiency Assessment
Problem javax.persistence.NoResultException: No entity found for query
Trying to figure out how to use MySQL and generated @Id
tracking changes in an array in a session bean