Hi Thomas,

On 1 Oct 2007 at 9:54, Thomas Ramapuram wrote:

> You usually have a problem with CLEAN_INSERT if you have some kind of 
> recursive model.  (ie.  a table which has a relationship with itself).  
> I havent found any workaround this.  What I do is do not add this data 
> to the sample data.   The error I get is foreignKeyConstrain error.

The other way to fix this is to re-order your sample data.  AFAICT, the data 
is inserted in the database in the order it appears in sample-data.xml.  If you 
make sure that parent table data is inserted before the data in its related 
children, your CLEAN_INSERT should run smoothly.

The only downside to this approach is that you need to recheck sample-
data.xml any time you run an appfuse:gen task as I've found that it usually 
deletes the data for the associated DB table in sample-data.xml and adds it 
again to the end of that file, hence potentially breaking foreign key 
constraints.

HTH,
Rob Hills
Waikiki, Western Australia
Mobile +61 (412) 904-357
Fax: +61 (8) 9529-2137

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to