Cascading deletes are implemented using standard ADO.NET functionality built into DataSet and therefore only delete what is in memory. You can either change your EntityObject parent class to force all objects into memory on delete or add code to the SQL gen to enable cascades in the db.
Arjen described a solution for the first approach:
I added the following to the NeoSupport.vtl in the base class:
#if($entity.ToManyRelationships.Count > 0)
public override void Delete() {
#foreach($rel in $entity.ToManyRelationships)
${rel.DotNetName}.Touch();
#end
base.Delete();
}
#end
Jonathan had the fix for the second:
I had to add the following to NeoSchemaGen.xslt (line 43, within the ALTER TABLE block, immediately after the REFERENCES section, but prior to semi-colon):
<if test="@onDelete='cascade'"> ON DELETE CASCADE </if>
NEO Attribute Injection
A simply solution to complete the sql-statements for 'ON UPDATE' and 'ON DELETE' after neo has createt the schema.sql and befor sqlserver proccesses the schema.sql: neoai.exe
You write normal the schema.xml an creates the db with makeschema.bat:
Have fun!
Stephan
