EntitySpaces Trial Version - not sure how to tell the version, but the GettingStarted PDF is dated Nov 19, 2007
MyGeneration Version - 1.2.0.7
Database - Oracle 10g
I've been evaluating the EntitySpaces trial version. So far, the experience has been great - I really love how easy this is to get up and running! I was involved at my company getting a persistence layer working in Java (pre-Hibernate), and I can attest to how much work it is to get right!
That said, I'm having some difficulty with the hierarchy data model in regards to deleting records. Your online documentation says that the model is smart enough to delete records in the correct order, so as to not raise any constraint violations. I want to make sure I'm doing this correctly. I have a table PrimerGroup that is related one-to-many to a table PrimerGroupPair. It is also related one-to-many to a table AssayPrimerGroup. To delete a PrimerGroup, I am employing the following code:
Code:
1 PrimerGroup primerGroup = primerGroupCollection.FindByPrimaryKey(4);
2 primerGroup.PrimerGroupPairCollectionByPrimerGroupId.MarkAllAsDeleted();
3 primerGroup.AssayPrimerGroupCollectionByPrimerGroupId.MarkAllAsDeleted();
4 primerGroup.MarkAsDeleted();
5 primerGroupCollection.Save();
When the save happens, I'm running into a child record found constraint violation in my PrimerGroupPair table. If the Save() call on line 5 is trying to delete the primerGroup record BEFORE all the primerGroupPair records, then I can see where this would happen. Am I doing something wrong?