persistence: default values

Raoul Pierre <[email protected]> Wed, 15 Dec 2004 10:04:28 +0100
Newsgroups gmane.comp.java.keel.user
Message-ID <[email protected]>
Hello,

I'm stuck with persistence default values problem.

I'm working under Windows XP pro with Keel's build from 
http://j2eeguys.com/~Keel/, 01/12/04.

I used the CVS Manual to create hoj example and run it. Everything was fine.

Then I tried to create a new project with module "app-payroll". Again I 
went on the tutorial. Everything was fine until I put some persistent 
initial values in 
app-payroll/src/java/org/suite/payroll/entities/Worker.java, ie:

package org.suite.payroll.entities;

/**
 * Payroll Worker
 *
 * @persist.persistent
 *   schema="payroll"
 *   name="worker"
 *   descrip="Persistent worker"
 *   table="worker"
 *
 * @persist.record
 *   workerId="1"
 *   lastname="This is the first record"
 * @persist.record
 *   workerId="2"
 *   lastname="This is the second record"
 */

Before each test, I removed all the files from:
 %KEEL_HOME%/keel-build\deploy\jakarta-tomcat-5.0.28\bin\db
and run:
  ant clean-keel
  ant build-all
  ant tomcat-start

Then, with the URL
  http://localhost:8080/default/model.do?model=createdb

I got:

Unable to create database tables:Persistence exception
while creating default data for 'payroll.worker', adding
factory:default,name:payroll.worker,table_name:T_worker,
field_values:lastname=This is the first record
[...]

As soon as I  removed the 2 "persist.record", then everything run fine.

 From the Tomcat messages, it seems that the ids table is not created 
when default values are specified.

I compared app-hoj and app-payroll files and I was unabled to find the 
point.

Any help?

Regards

Pierre