aspose file tools*
The moose likes Object Relational Mapping and the fly likes Stored Procedures + Hibernate + Xml mapping Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "Stored Procedures + Hibernate + Xml mapping" Watch "Stored Procedures + Hibernate + Xml mapping" New topic
Author

Stored Procedures + Hibernate + Xml mapping

Matheus Mendes
Ranch Hand

Joined: May 15, 2007
Posts: 66
Hi ranches !


People I already search in a lot of google sites and do not found any solution that fits my problem. I have the following SP in SQL Server 2005 Express:



Isn't a very well designed procedure, It just returns me a result set. Well I tried to map this procedure as a nativeNamedQuery(annotation) and as a xml mapping. But I have the problem in the return type. I have a bean :




Well on my procedur I did return the sum(field1), field2, these both fields are on my bean but I wont to return it on my queries, so I must create a bean with only 2 attributes mapped as my procedure's return columns ???

Following is my namedQuery and my orm.xml mapping





The Death of one is a tragedy, but the Death of a million is just a statistic. Joseph Stalin

SCJP 6.0, SCJD
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Stored Procedures + Hibernate + Xml mapping
 
Similar Threads
Hibernate: Why is bag semantic getting applied when I'm not using Lists?
hibernate composite key problem
Error when inserting data in hibernate
Duplicated rows on the database
Mapping to an xml typed column (PostgreSQL) on an EJB3 entity in JBoss 5.1