Confirmed, NH tries to send as parameter every entity's properties mapped
to <sql-insert>/<sql-update> stored procedures, but you could make
exceptions with insert/update=false.
Another issue was the right sintaxis to execute Oracle11g's stored
procedure, this is the mapping that works for me with NH3.3 and
Oracle.DataAccess 4.112.2.0:
<class name="Person" table="PERSONS">
<id name="Id" column="COD_PERSON" />
<property name="Name" column="NAME" />
<property name="AuditField1" column="AUDITFIELD1" insert="false"
update="false" />
<property name="AuditField2" column="AUDITFIELD2" insert="false"
update="false" />
<property name="AuditField3" column="AUDITFIELD3" insert="false"
update="false" />
<sql-insert check="none">begin PKG_PERSONS.insert_sp(:p0,:p1);
end;</sql-insert>
</class>
I had to redefine the parameter's order, because Id property is send at
last position:
create or replace package body PKG_PERSONS is
procedure insert_sp(pname persons.name%type,
pcod_person persons.cod_person%type
) is
begin
insert into persons(cod_person, name) values(pcod_person, pname);
end;
and that's it, bye.
--
You received this message because you are subscribed to the Google Groups
"nhusers" group.
To view this discussion on the web visit
https://groups.google.com/d/msg/nhusers/-/XgM-Sl2htkgJ.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/nhusers?hl=en.