【发布时间】:2018-01-25 10:37:14
【问题描述】:
在 Oracle 数据库中我定义了类型:
create or replace TYPE person_type
AS OBJECT (id NUMBER(10), name VARCHAR2(50), age NUMBER);
还有一个存储过程
create or replace PROCEDURE add_person (in_person IN person_type)
AS
BEGIN
INSERT into person (id, name, age) VALUES(in_person.id, in_person.name, person.age);
END;
我正在使用带有 Hibernate 的 Spring Boot,我想使用一些等效的 java bean 作为输入参数来调用该过程。 我见过很多例子,但它们只使用基本类型,而不是组合对象。 也有一些带有表注释的例子,但我不保证数据库中有这样的表,我只保证了存储过程的类型。
【问题讨论】:
标签: java oracle object stored-procedures