-->
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.  [ 8 posts ] 
Author Message
 Post subject: How to pass parameters to the stored procedures
PostPosted: Fri Dec 10, 2004 12:34 pm 
Newbie

Joined: Wed Nov 17, 2004 4:17 pm
Posts: 9
Hi,
I am going through a sample of Stored Procedure.

<sql-insert callable="true">{ call createJoinTable(?, ?, ?) }</sql-insert>

but didnt get how to pass paramenters to the procedure. How to define the sequence of parameters. I have read that we should pass the paramters to the Stored Procedure in the same sequence in which Hibernate expects. But didnt get in which sequence does Hibernate expects the parameters.

Can anyone please help me with some sample.

Thanks a lot,
shilpa


Top
 Profile  
 
 Post subject:
PostPosted: Fri Dec 10, 2004 12:46 pm 
Expert
Expert

Joined: Sat Jun 12, 2004 4:49 pm
Posts: 915
I suppose that is sequence how you define id and properties in class

regards


Top
 Profile  
 
 Post subject:
PostPosted: Fri Dec 10, 2004 4:08 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
unfortunately it is not.

at some point we logged the generated sql to the debug log, but that seem to have been removed.

until i find a way to get it back you can either look at the sql hibernate uses or simply use a debugger to see what BasicEntityPersister.customSQLxxx variables contain :)

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject: Can we pass 2 objects to the stored procedure?
PostPosted: Fri Dec 10, 2004 6:24 pm 
Newbie

Joined: Wed Nov 17, 2004 4:17 pm
Posts: 9
Is it possible to pass objects of different classes to the stored procedure.

e.g.

TeststoredProcedure takes two parameters:
1. Customer.firstName
2. Organization.name

So here we will need to pass 2 objects (each of different class),
can we do this?

Thanks,
shilpa


Top
 Profile  
 
 Post subject:
PostPosted: Fri Dec 10, 2004 6:58 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
hibernate assumes your stored procedure follows a similar structure as what delete, insert, update statements would require for data.

if you have more "highlevel stored procedures" which your referring to non-key/id values of related classes indicates then you probably have a better possibliity to write a custompersister that handles your stored proceudres (which is somewhat easy now that the default persisters support callable statements)

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Sun Dec 12, 2004 7:57 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
max wrote:
until i find a way to get it back you can either look at the sql hibernate uses or simply use a debugger to see what BasicEntityPersister.customSQLxxx variables contain :)


it's still there.

if you enable debug logging you should see the entitypersisters dump a set of static sql's from which you should be able to see which sequence hibernate expect the parameters to be in.

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject: How to enable Debug in log4J
PostPosted: Mon Dec 13, 2004 3:07 pm 
Newbie

Joined: Wed Nov 17, 2004 4:17 pm
Posts: 9
Hi,
How to enable debug in log4j.

I have added following to the log4j.properties file,

log4j.logger.net.sf.hibernate.persister.BasicEntityPersister=debug

and the log4j.properties is in my classpath.

Now how to make my program read that log4j.properties file ?

Thanks,
shilpa


Top
 Profile  
 
 Post subject:
PostPosted: Mon Dec 13, 2004 4:38 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
if it is the root of your classpath it should do it automatically.

_________________
Max
Don't forget to rate


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 8 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:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.