This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Object Relational Mapping and the fly likes Question of using SqlResultSetMapping Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "Question of using SqlResultSetMapping" Watch "Question of using SqlResultSetMapping" New topic
Author

Question of using SqlResultSetMapping

Tariq Ahsan
Ranch Hand

Joined: Nov 03, 2003
Posts: 116
Hello All,

Learning to use Hibernate and JPA. Trying to use CreateNativeQuery in the following way -



But getting org.hibernate.MappingException: Unknown SqlResultSetMapping [testing]

Not sure if the @SqlResultSetMapping or the @NameNativeQuery need to be in the table1 POJO. In that case I would rather create a db table view doing the same above query using UNION of table1 and table2. I thought I could use SqlResultSetMapping to use one of the 2 tables (table1 or table2) class object's common fields (col1, col2 and col3) and assign the resultList values to it.
Is it something else I am missing or not doing right?

Thanks
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Question of using SqlResultSetMapping
 
Similar Threads
createNativeQuery Question
DB2 Update Sql based on calculation
Projection from inner join
Simple sql
getParameterValues []