I have the following types:
create or replace type Film_ty as object(
create or replace type Entertainment_ty as object(
create or replace type Spot_ty under Entertainment_ty (
create or replace type Trailer_ty under Entertainment_ty (
of_film REF Film_ty,
I created the object table for Film_ty and Entertainment_ty using "create table entertainment of Entertainment_ty" and "create table film of Film_ty" . I didn't create any collection or object table for Trailer_ty, because I read on the "Object Oriented Oracle" book that I don't have to do it if I want a mutual-exclusive inheritance relation. Now, I want to delete the trailer of a given film. How can I do such a thing if I can't access to the reference in the entertainment table, with something like "entertainment.of_film "?
I also tried a simple query of selection: "select value(e) from entertainment e;" The result is "[owner.Trailer_ty]". I can't find a way to access to the data stored in the object table entertainment referred to the Trailer_ty type.
Can you help me to solve it, please??
The question that comes to mind is why do all of this superfluous nonsense. What is it that you expect to gain from using an OO concept? Is this just for learning or are you doing something "real"? While you can create OO in a relational database, there are other options out there. Most OO databases failed miserably because the designer did not understand the consequences of using OO.
I would assume that the OO db book has examples of how to get your answer. Another resource would be:
It's for an university's exam and it supposed to use OO. In the book I used, there are a lot of example but none about my problem, all of them never refer to the sub-type, just do query on the table created. I tried, and I'm still trying to find a solution on different resources, including that you suggest to me.