Oracleで7つのパラメータを受け取って5を返すストアドプロシージャを呼び出していますが、2つのパラメータに興味があります。 これは私が複数のIN OUTパラメータと注釈を使用してMyBatisでストアドプロシージャを呼び出す
@Select(value = "{CALL prc_ultimo_nombramiento(#{tipoIdentificacion, mode=IN},#{numeroIdentificacion, mode=IN},#{idEt, jdbcType=VARCHAR},#{fechaPosesion, mode=OUT, jdbcType=VARCHAR},#{idTipoNombramiento, mode=OUT, jdbcType=VARCHAR},#{validar, jdbcType=VARCHAR},#{mensaje, jdbcType=VARCHAR})}")
@Options(statementType = StatementType.CALLABLE)
@ResultType(CPDatosDocente.class)
CPDatosDocente obtenerDatosFechaPosesionIdNombramiento(CPDatosDocente datosDocente);
私CPDatosDocenteは、私はとても必要なすべての変数を含むPOJOで選択しMyBatisのです。
String idTipoNombramiento;
String validar;
String mensaje;
String fechaPosesion;
String tipoIdentificacion;
String numeroIdentificacion;
String idEt;
//Getters and setters...
私はMyBatisのセンテンスを呼んでいるが、私はプロシージャを呼び出すときに、私のオブジェクト(CPDatosDocente)は
public CPDatosDocente obtenerFechaPosesionIdNombramiento(Long tipoIdentificacion,
Long numeroIdentificacionDocente) {
SqlSession session = sf.openSession();
try {
// Se abre conexión con el mapper
CPDatosDocenteMapper mapper = session.getMapper(CPDatosDocenteMapper.class);
// Se ejecuta la consulta para obtener la fecha de posesión y el
// tipo de nombramiento
CPDatosDocente datos = new CPDatosDocente();
datos.setTipoIdentificacion(tipoIdentificacion);
datos.setNumeroIdentificacion(numeroIdentificacionDocente);
CPDatosDocente datosDocente = mapper.obtenerDatosFechaPosesionIdNombramiento(datos);
System.out.println(datosDocente.getFechaPosesion());
return datosDocente;
} finally {
session.close();
}
}
nullで、私は多くのことを試してみましたが、私は持っているDAOを持っています必要なパラメータOUTを持つオブジェクトを取得できませんでした。
エラーメッセージが表示されますか?それ以外に5つのOUTパラメータがあると言っていますが、2つしか提供していません。2つしか使用していないのに5つをすべて提供してください。 Oracleは、プロシージャのシグネチャと一致するプロシージャの呼び出しを受け取る必要があります。 – FDavidov