Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: Getting reference from a newly inserted object

Re: Getting reference from a newly inserted object

From: Jim Kennedy <jim>
Date: Sun, 8 Jan 2006 08:36:48 -0800
Message-ID: <H9mdnTp9urK2olzeRVn-hQ@comcast.com>

"jerry" <jerry82006chen_at_gmail.com> wrote in message news:1136652303.652595.287600_at_f14g2000cwb.googlegroups.com...
> Thanks for your reply and helpful suggestions
> To Jim:
> I think the problem is not the constraints between tables. The reason
> why I choose object-relational mapping is the consideration about the
> flexibility of further modification. If I use a lot of constraints and
> make all of them fullfil third normal form, the flexibility of my
> database will become poor and complexity is also increased. But by
> using orbject in Oracle, the constraints is maintainted by DBMS with
> OID. Now my problem is how to get object reference just after I insert
> an object from a JAVA program through JDBC.
> To Daniel:
> I use Oracle designer and JPublish to generate the architecture of my
> program.
> the associate DDL is as follows:
>
>
> PROMPT Creating Object Type 'MyObj1'
> CREATE OR REPLACE TYPE MyObj1 AS OBJECT
> (
> PROPERTY1_LIST MyObj2_List
> )
>
> PROMPT Creating Object Type 'MyObj2'
> CREATE OR REPLACE TYPE MyObj2 AS OBJECT
> (
> Title VARCHAR(20)
> )
>
> PROMPT Creating Collection Type 'MyObj2_List'
> CREATE OR REPLACE TYPE MyObj2_List AS TABLE OF REF MyObj2
>
> PROMPT Creating Table 'TB_MyObj1'
> CREATE TABLE TB_MyObj1 OF MyObj1
> NESTED TABLE MyObj2_LIST STORE AS TB_MyObj1_NT90
> /
> PROMPT Creating Table 'TB_MyObj2'
> CREATE TABLE TB_MyObj2OF MyObj2
> /
>

You should read Tom Kyte's books. I really don't think you should be using objects for this. You are going to run into all sorts of problems. (space, performance, maint. considerations) Objects are very valuable in pl/sql but you are going to be disappointed. You would use a ref to get the object, but it adds a lot of complexity to the design. Jim Received on Sun Jan 08 2006 - 10:36:48 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US