Re: Foreign key not set

2005-10-26 Thread Jean-Yves Sironneau
I can not keep trying right now, but i will tomorrow, the visible difference i see is that of storing the user i use the way : Transaction tx = getImplementation().newTransaction(); tx.begin(); db.makePersistent(o); tx.commit(); But the collections of roles is modif

Re: Foreign key not set

2005-10-26 Thread Armin Waibel
Hi again, a correction of my previous post (I don't realized that you use the odmg-api). In the new upcoming version you have to set auto-update="none" and auto-delete="none" or "object" when using the odmg-api. regards, Armin Jean-Yves Sironneau wrote: i'am getting the same er

Re: Foreign key not set

2005-10-26 Thread Jean-Yves Sironneau
So i still don't get it, the workaround is to not use anonymous foreign key and to set the userId myself... As i don' t know in OJB where the anonymous key is supposed to be set i can't really try to find the bug for now, but i'll try to take a look. Thanks for your help. Jean-Yves Sironn

Re: Foreign key not set

2005-10-26 Thread Armin Waibel
Jean-Yves Sironneau wrote: i'am getting the same error. i'am going to try to do it with a non abstract class maybe it can be that. I setup a similar test Implementation odmg = OJB.getInstance(); Database db = odmg.newDatabase(); db.open(null, Database.OPEN_READ_WRITE); BookShelf bookShelf =

Re: Foreign key not set

2005-10-26 Thread Jean-Yves Sironneau
i'am getting the same error. i'am going to try to do it with a non abstract class maybe it can be that. Armin Waibel wrote: Could you try to set auto-update="link" in 1:n reference of User and run your test again: regards Armin Jean-Yves Sironneau wrote: here is the extract o

Re: Foreign key not set

2005-10-26 Thread Armin Waibel
Could you try to set auto-update="link" in 1:n reference of User and run your test again: regards Armin Jean-Yves Sironneau wrote: here is the extract of the repository file : Oups i think i forgot to explain that Role is an abstract class, and that Viewer inherits from Role,

Re: Foreign key not set

2005-10-26 Thread Jean-Yves Sironneau
here is the extract of the repository file : Oups i think i forgot to explain that Role is an abstract class, and that Viewer inherits from Role, Author from Viewer and Admin from Author here are the classes too : public class Viewer extends Role { public Viewer(DocumentBase base) {

Re: Foreign key not set

2005-10-26 Thread Armin Waibel
Hi Jean-Yves, in User the 1:n reference the auto-update setting is undefined and by default OJB use 'link' for 1:n relations, thus I would expect that the FK in Admin will be set. Could you post the generated repository.xml for User, Admin, Role? regards Armin Jean-Yves Sironneau wrote: Hel

Foreign key not set

2005-10-26 Thread Jean-Yves Sironneau
Hello, I'am having trouble trying to find out what i am doing wrong, i have a class user and a class role and a user has a collection of roles, this kind of schema is working for other classes with the same kind of relationship but not for this one. OJB is trying to insert a null value in th