Ticket Q426950
Visible to All Users

XAF,XPO and "reverse" aggregated one-to-many relationship

created 13 years ago

Hi !

My problem is the next:
I've got 2 tables, the first table callled A - this is the parent table, the second table called B - this is the child table.
There is one-to-many relationship between two tables.

So, usually the users browse the parent table, and if they needed, delete the record.( If these tables have an aggregated relationship, in "delete" case the appropriate records will deleted in the child table too.)

In my situation the problem is reverse.
The users browse the child table, and delete the record(s). Till this point everthing is O.K.
BUT, if the users wanna delete from the parent table, the users can delete only way, when the parent record does not have a child record(s).

I hope, it was clear.

So, how can I resolve this problem with the simpliest way with XAF ?

Thanks for the help,
Best regards,

Zoltan

Answers

created 13 years ago (modified 13 years ago)

Hello Zoltan,
I am not sure that I understand your task correctly. Do you wish to deny the parent object deletion until all its children are deleted? If so, use our Validation Module - see Collection Validation.

    Comments (2)

      Hi Anatol !
      Yes, you are right.
      I have to deny parent deletion,- because the user delete the parent,- no aggregation between tables,- child record(s) will be orphan record(s).
      Thanks for the help
      Zoltan

      Anatol (DevExpress) 13 years ago

        Thank you for the clarification. I hope that you will find my suggestion helpful.

        Disclaimer: The information provided on DevExpress.com and affiliated web properties (including the DevExpress Support Center) is provided "as is" without warranty of any kind. Developer Express Inc disclaims all warranties, either express or implied, including the warranties of merchantability and fitness for a particular purpose. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.

        Confidential Information: Developer Express Inc does not wish to receive, will not act to procure, nor will it solicit, confidential or proprietary materials and information from you through the DevExpress Support Center or its web properties. Any and all materials or information divulged during chats, email communications, online discussions, Support Center tickets, or made available to Developer Express Inc in any manner will be deemed NOT to be confidential by Developer Express Inc. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.