Skip to Content
3
Former Member
Jul 04, 2014 at 03:12 PM

Referential integrity control

262 Views

As I know, by default, hybris kernel doesn't support referential integrity control (and doesn't create any foreign keys on database level). What's the reason, why? In some cases it’s very important to prevent deletion of parent record cause child records still exist (and cascade delete not required).

What tools / services could be useful to implement this functionality on base level independent of any further changes in type system?

Something like use case below:

  • before deletion of item we have to analyze all of relations where this item is described as "parent" (how to extract this info?)

  • then we search for child items in appropriate database tables and fields of every relations types described as "child"

  • if any of child items were found, break down of deletion of current "parent" item and raise an exeption.

?