Orcle过程的输入参数为Clob,并从spring数据jpa中将输入参数作为json对象传递

时间:2019-09-05 10:31:16

标签: spring jpa spring-data-jpa

过程输入参数是clob并在spring数据jpa中执行过程时将json对象作为输入参数传递,但是我遇到了类似的异常 org.springframework.orm.jpa.JpaSystemException:无法序列化;嵌套的异常是org.hibernate.type.SerializationException:无法序列化

       Connection connection = entityManager.unwrap(SessionImpl.class).connection();
    CLOB clob = (CLOB) connection.createClob();
    clob.setString(1, requestJson.toString());

    final String P_JSON_OBJECT = "p_json_object";
            StoredProcedureQuery storedProcedure = entityManager.createStoredProcedureQuery("PROCEDURE");
    storedProcedure.registerStoredProcedureParameter(P_JSON_OBJECT, CLOB.class, ParameterMode.IN);
    storedProcedure.registerStoredProcedureParameter(P_STATUS_MSG, String.class, ParameterMode.OUT);    
    storedProcedure.setParameter(P_JSON_OBJECT, clob);  
    storedProcedure.execute();

0 个答案:

没有答案