-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
 Post subject: Java Persistence with Hibernate and stored procedure
PostPosted: Tue Nov 06, 2007 11:20 am 
Beginner
Beginner

Joined: Thu Apr 15, 2004 2:01 pm
Posts: 25
Hello

I went through this book of "Java Persistence with Hibernate" where I was looking for how to execute stored procedure. I came across simple example of procedure returning a selection from User class.

I would like to know that what if procedure is returning result from multiple tables? I have a class which includes huge list of attributes from different tables but then what should I specify mapping table as ? Do I need create such table with all attributes?


I went through Chapter 16 of Native SQL too but couldn't figure out the way to do this.

Thank you


Top
 Profile  
 
 Post subject:
PostPosted: Tue Nov 06, 2007 3:50 pm 
Regular
Regular

Joined: Tue Jan 03, 2006 9:20 am
Posts: 74
I'd treat the stored procedure as a view on a (virtual) table, so you don't create the table at all but just map the results of its execution to a Java class (or Map).


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
cron
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.