Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp
Hibernate version:
3.2
Mapping documents:
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<hibernate-mapping package="bros.temporarytable" auto-import="false">
<class name="CaracteristriquesEBF">
<id name="COIEBF" type="integer" column="COIEBF" />
<property name="COTYPI" type="string" column="COTYPI" />
<property name="COINTE" type="integer" column="COINTE" />
<property name="CONATI" type="string" column="CONATI" />
<property name="CTCTBA" type="string" column="CTCTBA" />
<property name="LICIDE" type="string" column="LICIDE" />
<property name="LIRAIS" type="string" column="LIRAIS" />
<property name="LISIGL" type="string" column="LISIGL" />
<property name="CODNAF" type="string" column="CODNAF" />
<property name="CTIDNT" type="string" column="CTIDNT" />
<property name="COIDNT" type="string" column="COIDNT" />
<property name="CODNIC" type="string" column="CODNIC" />
<property name="COPINT" type="string" column="COPINT" />
<property name="CTETBT" type="string" column="CTETBT" />
<property name="COINCI" type="integer" column="COINCI" />
<property name="COLISO" type="string" column="COLISO" />
<property name="YCORET" type="string" column="YCORET" />
<property name="DDVALT" type="string" column="DDVALT" />
<property name="DFVALT" type="string" column="DFVALT" />
<property name="COCAJI" type="string" column="COCAJI" />
<property name="YLIER2" type="string" column="YLIER2" />
<property name="LIIDEN" type="string" column="LIIDEN" />
</class>
<sql-query name="EBF" callable="true">
<return class="CaracteristriquesEBF">
<return-property name="COTYPI" column="COTYPI" />
<return-property name="COINTE" column="COINTE" />
<return-property name="CONATI" column="CONATI" />
<return-property name="CTCTBA" column="CTCTBA" />
<return-property name="LICIDE" column="LICIDE" />
<return-property name="LIRAIS" column="LIRAIS" />
<return-property name="LISIGL" column="LISIGL" />
<return-property name="CODNAF" column="CODNAF" />
<return-property name="CTIDNT" column="CTIDNT" />
<return-property name="COIDNT" column="COIDNT" />
<return-property name="CODNIC" column="CODNIC" />
<return-property name="COPINT" column="COPINT" />
<return-property name="CTETBT" column="CTETBT" />
<return-property name="COINCI" column="COINCI" />
<return-property name="COLISO" column="COLISO" />
<return-property name="YCORET" column="YCORET" />
<return-property name="COIEBF" column="COIEBF" />
<return-property name="DDVALT" column="DDVALT" />
<return-property name="DFVALT" column="DFVALT" />
<return-property name="COCAJI" column="COCAJI" />
<return-property name="YLIER2" column="YLIER2" />
<return-property name="LIIDEN" column="LIIDEN" />
</return>
{call @@D000.EBFK903( :nblignes, :codeservice, :identifiant, :type, :codeerreur, :libelleerreur, :typeerreur)}
</sql-query>
</hibernate-mapping>
Code between sessionFactory.openSession() and session.close():
Query query = session.getNamedQuery("EBF");
String queryString = query.getQueryString();
String procedureName = queryString.substring(queryString.indexOf('.')+1,queryString.indexOf('(')).trim();
query.setParameter("nblignes",new Integer(Integer.parseInt(args[0])))
.setParameter("codeservice",args[1])
.setParameter("identifiant",args[2])
.setParameter("type",args[3])
.setParameter("codeerreur",null)
.setParameter("libelleerreur",null)
.setParameter("typeerreur",null);
List list = query.list();
query.getNamedParameters();
fin = System.currentTimeMillis();
Iterator it = list.iterator();
while(it.hasNext()){
CaracteristriquesEBF DO =(CaracteristriquesEBF)it.next();
EtablissementBancaire TO = DO.toEBF();
nbCompte++;
TO.displayEBF();
}
System.out.println("nb total comptes : "+nbCompte);
Full stack trace of any exception that occurs:
Name and version of the database you are using:
IBM DB2 v8
The generated SQL (show_sql=true):
Debug level Hibernate log excerpt:
Problems with Session and transaction handling?
In some case, my stored procedure return an empty resultSet and set the tree last parameters define as OUT in the create procedure.
Im' looking for a simple way to get the values of those OUT parameters.
Read this:
http://hibernate.org/42.html