-->
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.  [ 1 post ] 
Author Message
 Post subject: Hibernate invoking oracle Stored procedure
PostPosted: Wed May 26, 2010 9:35 am 
Newbie

Joined: Wed May 26, 2010 9:28 am
Posts: 1
Hi,
I am new to Java and Hibernate.i am invoking a oracle SP usinf spring.I get the list back from Query.list() but how should i see the objects stored in list? wen I iterate the list, I get the Objects but not the actual value.

Mapping:
<hibernate-mapping>

<class name="com.fidelity.LibraryDetails">
<id name="ISBN" type="long" />
<property name="bookName" type="string" />
</class>
<sql-query name="LIB_SP" callable="true">
<return class="com.fidelity.LibraryDetails">
<return-property name="ISBN" column="isbn_nbr" />
<return-property name="bookName" column="book_name" />
</return>
{ call SP_LIB_DTL(? , :branchCD ,:authorCD) }
</sql-query>
</hibernate-mapping>
===============
java class :

Query q = session.getNamedQuery("LIB_SP");
q.setLong("branchCD", lib.getBranch_Code());
q.setLong("authorCD", lib.getAuth_Code());
//@SuppressWarnings("unchecked")
System.out.println("before getting the list");
List list= q.list();
System.out.println("size of the list is " + list.size());
for(int i=0; i<list.size();i++){
System.out.println("list get:"+list.get(i));
}
System.out.println("after list");
===========

results:


before getting the list
Hibernate: { call SP_LIB_DTL(? , ? ,?) }
size of the list is 1
list get:com.fidelity.LibraryDetails@f0c85e
after list
=============================

I would like to see the values stored in list.

apprciate your help.


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

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.