Title: RE: [castor-dev] 1:1 creation problem TC24

Thanks Bruce,

So by your explanation, I could add depends="jdo.TestMaster" to the mapping for TestGroup and I should be able to just call create() for the TestMaster object which contains the TestGroup. 

<class name="jdo.TestGroup"  depends="jdo.TestMaster"  access="shared" identity="id">

JDO would then recognize the dependent relationship and create the entry in the test_group table. ( all above references of course are to the test suite ).   There wouldn't be a need to independently call _db.create(group).

I've tried to do this, and the group is never inserted.  Am I missing something?

I've also noticed that removing the depends attribute from the TestDetail mapping has no effect on the outcome of the test.

Thanks again for your help,

Mark

 -----Original Message-----
From:   Bruce Snyder [mailto:[EMAIL PROTECTED]]
Sent:   Saturday, February 02, 2002 3:54 PM
To:     [EMAIL PROTECTED]
Subject:        Re: [castor-dev] 1:1 creation problem TC24

This one time, at band camp, Mark Koch said:

MK >Why does Castor require that the group be "created" independently?   Why
MK >doesn't _db.create(master) take care of the creation and insert.

Mark,

The answer is in the mapping descriptor for each class:

<class name="jdo.TestDetail" depends="jdo.TestMaster" access="shared" identity="id">
                             ^^^^^^^^^^^^^^^^^^^^^^^^
but see also:

<class name="jdo.TestGroup" access="shared" identity="id">

Notice that TestDetail is defined as being dependent upon TestMaster
whereas TestGroup is not. Digging further, you'll notice that
TestDetail2 and TestDetail3 are defined as being dependent upon
TestDetail.

Bruce
--

perl -e 'print unpack("u30","<0G)U8V4\@4VYY9&5R\"F9E<G)E=\$\!F<FEI+F-O;0\`\`");'

-----------------------------------------------------------
If you wish to unsubscribe from this mailing, send mail to
[EMAIL PROTECTED] with a subject of:
        unsubscribe castor-dev

Reply via email to