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.
|