Hello, I'm a little stuck with this thing, I have a problem with a function created in oracle that retrieve me a cursor, the main problem is that when I call it whit diferent parameters don't give any results, I try this function in an hibernate-free enviroment and I do get some results, but when I call it in hibernate I have no results.
Hope someone can help, I'm very stuck whit this
Thanks
Hibernate version: 3.0
Mapping documents:
<sql-query name="ObtEquipo" callable="true">
<return alias="equipo" class="mx.com.femsa.sam.model.dao.equipment.EquipmentDescriptionTO">
<return-property name="base" column="BASE"/>
<return-property name="idEquipo" column="ID_EQUIPO"/>
<return-property name="descripcion" column="DESCRIPCION"/>
<return-property name="estatus" column="ESTATUS"/>
<return-property name="ubicacion" column="UBICACION"/>
<return-property name="kmsDisponibles" column="KMS_DISPONIBLES"/>
<return-property name="diasDisponibles" column="DIAS_DISPONIBLES"/>
<return-property name="kmsAcumulados" column="KMS_ACUMULADOS"/>
<return-property name="fechaDisponible" column="FECHA_DISPONIBLE"/>
<return-property name="idGrupoTrabajo" column="ID_GRUPO_TRABAJO"/>
<return-property name="idTipoEquipo" column="ID_TIPO_EQUIPO"/>
</return>
{? = call F_OBT_EQUIPO(:parametros)}
</sql-query>
Code between sessionFactory.openSession() and session.close():
public List getEquipment(IDCard idCard, int equipmentType, String processArea, String screen,
String orderBy, String sort, Object[] parameters, String sqlFunction) {
List lista = new ArrayList();
try{
Query query= getSession().getNamedQuery(sqlFunction);
query.setParameterList("parametros",parameters);
lista = query.list();
}catch(Exception e){
e.printStackTrace();
LogManager.write(e);
}finally {
getSession().close();
}
return lista;
}
Full stack trace of any exception that occurs:
Name and version of the database you are using:
Oracle 9i
The generated SQL (show_sql=true):
Debug level Hibernate log excerpt:
Problems with Session and transaction handling?
Read this:
http://hibernate.org/42.html