I have complex objects which are returned from an oracle db through a pl/sql routine. Normally I would create the necessary wrapper objects with jdeveloper. But the wrapper objects created by jdeveloper have one problem - once they are loaded into java I can only read them - Modifying them on any level below the first one results in memory loss.
Is there another way to do this? I read Hibernate documentation but I couldn't find any hint on how to do this.
My workaround for now is to simply create new instances of the wrapper objects and refill them with the changed data. This a very error prone approach.
Ok, so I need the rules you outlined. But how do I proceed further? After all I have to feed the PL/SQL routine with a oracle specific wrapper object or can I do it elsewhise? E.g. call the PL/SQL routine with my own objects?
I always thought due to the array like nature of PL/SQL this shouldn't be done by the progammer.
"The object graph consists of custom oracle types."
a custom Oracle type is not a Ref Cursor, so it breaks the rule.
Now, there is a way to map to some custom Oracle types, but it requires using a third party JDBC driver for Oracle, well there is another solution that is out there if you must use custom Oracle types, but it still requires adapter classes. That is JPublisher from Oracle. Personally, I would run as far away as possible from it, but sometimes you don't have a choice.
create or replace TYPE Anlage_obj AS OBJECT (Code_AL Float, Gruppe VARCHAR2(200), Typ VARCHAR2(200), PREIS FLOAT, Kapazitaet FLOAT, Einheit VARCHAR2(15), Bezug VARCHAR2(15), AFA FLOAT, Zinsen FLOAT, Wartungskosten FLOAT, Berechnen Float, Teilanlagen Teilanlagen_Obj);
I can only use JPublisher(JDeveloper) which has the problem above which I outlined in my first post.
That means I'm out of luck here! Hibernate won't work, JPublisher doesn't work -> I will have to do it the ugly way.
I'm disappointed that this is not possible. I mean creating structured oracle data types is clearly a clean and simple approach to delivering complex structured data from an Oracle db. That's clearly another point on my endless list "why big corporate products suck". [ June 05, 2007: Message edited by: Pete Neu ]