您好工作 Oracle 存储过程,我具有过程名称 Test 和2个参数,输入-> x IN VARCHAR2 ,输出-> < strong>将REF_CURSOR输入SYS_REFCURSOR 。我正在尝试使用休眠模式调用此过程,但是我有异常
线程“ main”中的异常org.hibernate.QueryException:方言[org.hibernate.dialect.OracleDialect]不支持REF_CURSOR参数
import model.Apprisal;
import oracle.jdbc.OracleTypes;
import org.hibernate.Session;
import org.hibernate.SessionFactory;
import org.hibernate.cfg.Configuration;
import org.hibernate.procedure.ProcedureCall;
import org.hibernate.procedure.ProcedureOutputs;
import org.hibernate.result.Output;
import org.hibernate.result.ResultSetOutput;
import javax.persistence.EntityManager;
import javax.persistence.ParameterMode;
import javax.persistence.StoredProcedureQuery;
import java.sql.CallableStatement;
import java.sql.ResultSet;
import java.sql.Types;
import java.util.List;
public class DBUtil {
public static void main(String[] args) {
// crt factiry
SessionFactory factory = new Configuration()
.configure("hibernate.cfg.xml")
//.addAnnotatedClass(Apprisal.class)
.buildSessionFactory();
// crt sesion
Session session = factory.getCurrentSession();
session.beginTransaction();
ProcedureCall call =session.createStoredProcedureCall( "{CALL TEST(?,?) }");
call.registerParameter(1, String.class, ParameterMode.IN).bindValue("12345");
call.registerParameter(2, Class.class, ParameterMode.REF_CURSOR);
Output output = call.getOutputs().getCurrent();
System.out.println("done");
factory.close();
}
}
答案 0 :(得分:0)
[].