Answer the question
In order to leave comments, you need to log in
How to work with mybatis + annotation + function?
Hello, I can’t figure out how to call the oracle function through annotations in mybatis.
Code example:
Maper:
@Select(value= "{ CALL #{outParam, jdbcType=NUMERIC, mode=OUT} := dbq.dbq_app.putmessageinqueue(#{lMess}, #{cIDChainLokBrig})}")
@Options(statementType = StatementType.CALLABLE)
@ResultType(int.class)
int putmessageinqueue(@Param("lMess") String lMess,
@Param("cIDChainLokBrig") int cIDChainLokBrig);
try {
Integer result = mapper.putmessageinqueue(lMess,cIDChainLokBrig);
if (result!=null){
return result;
}
}catch (Exception ignored){
if (!ignored.toString().contains("No information for operation settings.")) {
System.err.println("ERORR! Class:FunctionMyBatis; Function: putmessageinqueue " + ignored);
log.error("ERORR! Class:FunctionMyBatis; Function: putmessageinqueue " + ignored);
}
}
return 0;
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question