db-ojb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jakob Braeuchi <jbraeu...@gmx.ch>
Subject Re: MtoN-Testcases fail
Date Sat, 03 Jan 2004 13:38:20 GMT
hi armin,

ojb creates the role on inserting the project. on inserting the person

storing project:
1.) INSERT INTO PROJECT (ID,TITLE,DESCRIPTION) VALUES 
('10','testInsertAndDelete_21073135938250','')

storing person 1:
2.) INSERT INTO PERSON (ID,FIRSTNAME,LASTNAME) VALUES 
('11','testInsertAndDelete_21073135938250','')
3.) DELETE FROM PERSON_PROJECT WHERE PROJECT_ID='10'
4.) INSERT INTO PERSON_PROJECT (PERSON_ID,PROJECT_ID) VALUES ('11','10')

storing person 2:
5.) INSERT INTO PERSON (ID,FIRSTNAME,LASTNAME) VALUES 
('12','testInsertAndDelete_21073136478468','')
6.) DELETE FROM PERSON_PROJECT WHERE PROJECT_ID='10'
7.) INSERT INTO PERSON_PROJECT (PERSON_ID,PROJECT_ID) VALUES ('12','10')

as you can see the m:n implementors for the project are always deleted 
because the project is not associated with a person. this happens in the 
recursion store(), storeCollections(), store() when the person is stored.

if (cds.isMtoNRelation())
{
   if (cds.getCascadeStore())
   {
    (steps 3 and 6)
    store(otherObj);
    currentMtoNKeys = mtoNBroker.getMtoNImplementor(cds, obj);
   }
   (steps 4 and 7)
   mtoNBroker.storeMtoNImplementor(cds, obj, otherObj, currentMtoNKeys); }

i recently inserted the line currentMtoNKeys = ... after 
store(otherObject). because we had integrity violations.

jakob

Armin Waibel wrote:
> Hi Jakob,
> 
> Jakob Braeuchi wrote:
> 
>> hi all, armin
>>
>> there are two new testcases failing in class MtoNMapping 
>> testInsertWithIndirectionTable and testInsertWithIndirectionTable_2.
>> imo these cases fail because we do not have persons in the project !
>> and thus the m:n implementors for the project are deleted.
>>
> hmm, but in class-descriptor for Person a collection-descriptor with 
> auto-update true for Project classes is set. OK I don't have persons in 
> the project object, but why should this prevent creation of Roles. One 
> Role(entry in indirection table) was created, the second not?
> 
> This test creates (store two new Person objects with same new Project 
> object) --->
> one new Project (in PERSON table) OK
> two new Persons (in PROJECT table) OK
> one new Role (in PERSON_PROJECT table) ??
> 
> I checked in this test case because I assume it is a bug. Either I get 
> two Role entries or I get none entry. Why does OJB create one Role?
> 
> regards,
> Armin
> 
>> jakob
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: ojb-dev-unsubscribe@db.apache.org
>> For additional commands, e-mail: ojb-dev-help@db.apache.org
>>
>>
>>
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: ojb-dev-unsubscribe@db.apache.org
> For additional commands, e-mail: ojb-dev-help@db.apache.org
> 
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-dev-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-dev-help@db.apache.org


Mime
View raw message