Hi all, I'm using postgreSQL and have the following function:
Create or replace FUNCTION update_my_entity(my_entity_array my_entity[] ) RETURNS INTEGER AS $procedure$ declare v_row my_entity; declare v_cnt int4; BEGIN FOR v_cnt IN array_lower(my_entity_array, 1) .. array_upper(my_entity_array, 1) LOOP
v_row := my_entity_array[v_cnt]; update my_entity set my_entity.status = v_row.status where my_entity.vm_guid = v_row.vm_guid; END LOOP;
my_entity is a pgsql type that I defined. It has an equivalent Java class named MyEntity and I would like to update an array of MyEntity objects using hibernate.
I would like to know if invocation of stored procedures/functions that receive arrays of types (not just array of primitives or their matching classes or of strings) is possible in Hibernate. In addition, will I have to map MyEntity to my_entity using a dialect that extends HIbernate's postgreSQL hibernate (or define a custom type somehow).
Thanks for the help!
|