I'm trying to figure out how to implement object composition using pl/sql object types. Here is my super simple example.
CREATE OR REPLACE TYPE PERSON FORCE AUTHID DEFINER UNDER MYSCHEMA.BASE_OBJECT (
student ND_COMMON_ADMIN.STUDENT
) NOT FINAL;
CREATE OR REPLACE TYPE STUDENT FORCE AUTHID DEFINER UNDER MYSCHEMA.BASE_OBJECT (
person ND_COMMON_ADMIN.PERSON,
application_checklist ND_COMMON_ADMIN.APPLICATION_CHECKLIST
) NOT FINAL;
You can see that person (the owner object) contains the student object. You can also see that student contains a person object(otherwise, student would not have access to person's data... right?)
PL/SQL however, doesn't like that these objects reference each other and throws the following error:
Error: ORA-04055: Aborted: "PERSON" formed a non-REF mutually-dependent cycle with "STUDENT".
So, if anyone could give me advice on how I can have student be a part of person via composition, but also have student be able to tell which person object it is a part of, I would greatly appreciate it.
Thanks.