我在Oracle中调用一个存储过程,接收7个参数并返回5,我只对两个参数感兴趣.这是我的MyBatis Select
@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);
Run Code Online (Sandbox Code Playgroud)
我的CPDatosDocente是一个包含我需要的所有变量的POJO.
String idTipoNombramiento;
String validar;
String mensaje;
String fechaPosesion;
String tipoIdentificacion;
String numeroIdentificacion;
String idEt;
//Getters and setters...
Run Code Online (Sandbox Code Playgroud)
我有一个dao,我在调用MyBatis Sentence,但是当我调用procedure时,我的对象(CPDatosDocente)为null
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
// …Run Code Online (Sandbox Code Playgroud)