Re: Cayenne Tutorial: INSERT on table 'PAINTING' caused a violation of foreign key constraint

2010-10-26 Thread Mike Kienenberger
Can you open an issue on this so we don't forget about it and can correct the problem? Thanks! https://issues.apache.org/jira/secure/CreateIssue!default.jspa project Cayenne On Tue, Oct 26, 2010 at 3:27 PM, caden whitaker wrote: > Hah! Okay yeah now it makes sense, I had to think about it from

Re: Cayenne Tutorial: INSERT on table 'PAINTING' caused a violation of foreign key constraint

2010-10-26 Thread Borut Bolčina
I am glad it helped, I think I tripped on this one years ago also :-) -Borut 2010/10/26 caden whitaker > Hah! Okay yeah now it makes sense, I had to think about it from a database > perspective. First I made my ID names more descriptive and then I could > totally see the problem. > > Here's whe

CayenneDataObject serialization

2010-10-26 Thread Bruno René Santos
Hello all, Is there any way to serialize a cayenneDataObject, in order to send it to a web service? Thanx

Re: Cayenne Tutorial: INSERT on table 'PAINTING' caused a violation of foreign key constraint

2010-10-26 Thread caden whitaker
Hah! Okay yeah now it makes sense, I had to think about it from a database perspective. First I made my ID names more descriptive and then I could totally see the problem. Here's where I got mixed up in the tutorials It shows in the picture that it is mapping to an ArtistID column, but it never te

Re: Cayenne Tutorial: INSERT on table 'PAINTING' caused a violation of foreign key constraint

2010-10-26 Thread Borut Bolčina
I see ALTER TABLE PAINTING ADD FOREIGN KEY (ID) REFERENCES ARTIST (ID). Do you have artist_id attribute (column) which is artist FK in PAINTING table? It seems you have id of PAINTING which is PK also as FK. Please check that. Cheers, Borut 2010/10/26 caden whitaker > Hey Mike, > > I was thinki

Re: Cayenne Tutorial: INSERT on table 'PAINTING' caused a violation of foreign key constraint

2010-10-26 Thread caden whitaker
Hey Mike, I was thinking the same thing, so I removed the code, now it looks like this: ObjectContext context = DataContext.createDataContext(); Artist picasso = context.newObject(Artist.class); picasso.setName("Pablo Picasso"); Painting girl = co

Re: Cayenne Tutorial: INSERT on table 'PAINTING' caused a violation of foreign key constraint

2010-10-26 Thread Mike Kienenberger
In fact, this could be the problem. By calling it twice, you will get two of each object in each relationship. This might be causing your foreign key constraint error. On Tue, Oct 26, 2010 at 1:02 PM, Borut Bolčina wrote: > Hi, > > how did you create your database (show us the create statements

Re: Cayenne Tutorial: INSERT on table 'PAINTING' caused a violation of foreign key constraint

2010-10-26 Thread caden whitaker
Hello Borut, Thank you for the fast reply! And I will update the call to remove those two unnecessary lines. Here is the stacktrace showing the creation statements: Oct 26, 2010 11:09:41 AM org.apache.cayenne.conf.RuntimeLoadDelegate startedLoading INFO: started configuration loading. Oct 26, 201

Re: Cayenne Tutorial: INSERT on table 'PAINTING' caused a violation of foreign key constraint

2010-10-26 Thread Borut Bolčina
Hi, how did you create your database (show us the create statements)? Which database are you using? Foreign key constraints are optional, but you need them if you want to reverse engineer the database, so that relationships in the modeler are created. Also, in your unit test, you are setting

Cayenne Tutorial: INSERT on table 'PAINTING' caused a violation of foreign key constraint

2010-10-26 Thread caden whitaker
Hey all, Running through the tutorials, I know what that error means, but I don't think I've done anything wrong. Can someone take a quick look at this xml/object set and tell me what I did wrong? Any help would be greatly appreciated. Mapping.xml http://cayenne.apache.org/schema/3.0/modelMap";

Re: Cayenne Source

2010-10-26 Thread Andrei Veprev
Also, If you use maven and maven plugin for eclipse, you can just right click on project in project explorer and select Maven->Dowload Sources. On 26 October 2010 13:28, Andrus Adamchik wrote: > You can download the official 3.0.1 source from here: > > http://www.apache.org/dyn/closer.cgi/cayenne

Re: Cayenne Source

2010-10-26 Thread Andrus Adamchik
You can download the official 3.0.1 source from here: http://www.apache.org/dyn/closer.cgi/cayenne/cayenne-3.0.1-src.tar.gz Andrus On Oct 26, 2010, at 1:17 PM, Bruno René Santos wrote: > Hello all, > > I have downloaded the cayenne 3.0.1 source from the SVN to use as autocomplete > source on

Cayenne Source

2010-10-26 Thread Bruno René Santos
Hello all, I have downloaded the cayenne 3.0.1 source from the SVN to use as autocomplete source on eclipse. But the source code does not match with the binary code in terms of lines, I mean the breakpoints do not land on the correct place... I'm using the java files in here : [My path]\cayenne.3.