Delete list


I have a Class with a One-to-Many relationship:
Class TQuestionnaire
Class TQuestionnaireItem

In TQuestionnaire class there is a field:
    [ManyValuedAssociation([], CascadeTypeAll, 'FQuestionnaire')]
    FItems: Proxy<TList<TQuestionnaireItem>>;

And in TQuestionnaireItem class there is a field
    [Association([TAssociationProp.Lazy], [])]
    [JoinColumn('FId', [])]
    FQuestionnaire: Proxy<TQuestionnaire>;

I need to have a method to delete all the Items from a Questionnaire class.
I've tried to cycle the items and do Objectmanager.remove...,
I've tried to remove the list...

I receive always an access violation.

What is the correct way to remove all the child objects from a list (from manager and db)?

Basso Claudio

One more info:

the error is: "Cannot find mapping [Id] on class TObjectList<...TQuestionnaireItem>

You must not delete the list. You must delete each item individually and be sure to remove it form the list so you don't keep an invalid reference there:


Ok, thanks!