cayenne-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ngong <mailingl...@august.de>
Subject Re: new to cayenne
Date Sat, 14 Jan 2012 09:44:07 GMT
Fair enough, Ari. 

(however, I tried to be as nice as possible, reduced the project to just a
few lines. Nothing extra in there, just the code producing the error.)

Yes, I went through the tutorial, step by step and I take it as a reference
while developing. It worked out fine. Thank you for that valueable
introduction.
(My goal is to take an existing schema ( http://ehour.nl/ http://ehour.nl/ )
of a time tracking application and add records to it that I collected with
my smart phone.)

To run my test that leads to the error I have Eclipse with m2e and mysql
installed.

Create a database:
mysql -u<user> -p<password>
mysql>CREATE DATABASE eHour;
mysql>quit

Import the tables:
mysql -u<user> -p<password> eHour <eh.dump

Run As: Maven generate-sources
Run As: Maven test

The pom.xml: &lt;a
href=&quot;http://paste.pocoo.org/show/534617/&quot;>http://paste.pocoo.org/show/534617/

The Cayenne xml:  http://paste.pocoo.org/show/534618/
http://paste.pocoo.org/show/534618/ 
The map.xml:  http://paste.pocoo.org/show/534619/
http://paste.pocoo.org/show/534619/ 
The Java code:  http://paste.pocoo.org/show/534620/
http://paste.pocoo.org/show/534620/ 

The code is very simple: It reads in all timesheet entries as of a certain
date (in order to make sure not to enter something twice, but that is
exchanged just by a printout here). 

The PK of a timesheet entry is made of two columns: a date and a FK of a
project assignment (actually a relation between a project and a user).

To make sure that a foreign record exists in the example here I just took a
project assignment from the first timesheet entry I had read in.

Commiting that newly created timesheet record leads to the error: 
http://paste.pocoo.org/show/534625/ http://paste.pocoo.org/show/534625/ 

With this consol output:  http://paste.pocoo.org/show/534627/
http://paste.pocoo.org/show/534627/ 



I am pretty sure that the source of my error is somthing simple I have
ovelooked. However, as I have no clue where to look and what to do next (I
googled and searched on Cayenne pages a lot) I provide you all information
that may be need. Sorry for the amount.

Kind Regards


Rolf




--
View this message in context: http://cayenne.195.n3.nabble.com/new-to-cayenne-tp3650719p3658627.html
Sent from the Cayenne - User mailing list archive at Nabble.com.

Mime
View raw message