Thanks Thomas I get it now. So, if A now becomes: id: integer name: String
I can create 2 Bs with name as "Test". The IDs will still be different. Then, when I delete one B, I assume Castor will remove the first row in table_A with "Test"? Great stuff. Thanks Keith > -----Original Message----- > From: Thomas Yip [mailto:[EMAIL PROTECTED]] > Sent: Saturday, 6 October 2001 6:26 a.m. > To: [EMAIL PROTECTED] > Subject: Re: [castor-dev] extends... > > > > > > -----Original Message----- > >From: Keith Chew SL [mailto:[EMAIL PROTECTED]] > >Sent: Friday, October 05, 2001 5:55 AM > >To: [EMAIL PROTECTED] > >Subject: [castor-dev] extends... > > > >Hi > > > >Say I have object B which extends object A: > > > >Object A (maps to table_A) attribute: > >name: String > > > >Object B (maps to table_B) attributes: > >subject: String > > > >When I create B and fill in all the attributes, castor will > write them into > >table_B and table_A: > >B objB = new B(); > >objB.setName("Test"); > >objB.setSubject("Subject 1"); > >create(objB); > > > >When I add another B: > >B objB = new B(); > >objB.setName("Test"); > >objB.setSubject("Subject 2"); > >create(objB); > > > >If I were to delete one of the B object, how does castor know when to > delete > >"Test" from table_A because both the B's have "Test" as the name? > > If "name" is the identity, Castor will not let you to create B at all. > It second creation will result in DuplicateIdentityException. > > > Thomas > > ----------------------------------------------------------- > If you wish to unsubscribe from this mailing, send mail to > [EMAIL PROTECTED] with a subject of: > unsubscribe castor-dev > > > ----------------------------------------------------------- If you wish to unsubscribe from this mailing, send mail to [EMAIL PROTECTED] with a subject of: unsubscribe castor-dev
