org.melati.poem
Interface IntegrityFix

Package class diagram package IntegrityFix
All Known Implementing Classes:
StandardIntegrityFix

public interface IntegrityFix

Class representing what to do about references to a Persistent which is about to be deleted. Three canned IntegrityFix policies are provided: StandardIntegrityFix.delete, which simply deletes all referring objects, StandardIntegrityFix.clear, which NULLs out all references, and StandardIntegrityFix.prevent, which prevents deletion if there are any references which would be left dangling.

Author:
WilliamC At paneris.org

Method Summary
 String getName()
          Integrity fixes are set in the DSD by name.
 Enumeration<Persistent> referencesTo(Persistent referee, Column column, Enumeration<Persistent> refs, Map<Column,IntegrityFix> referenceFixOfColumn)
          Do something about references from a given column to a Persistent which is about to be deleted.
 

Method Detail

referencesTo

Enumeration<Persistent> referencesTo(Persistent referee,
                                     Column column,
                                     Enumeration<Persistent> refs,
                                     Map<Column,IntegrityFix> referenceFixOfColumn)
Do something about references from a given column to a Persistent which is about to be deleted. Called via Persistent.delete(Map), this gives the application programmer fine-grained control over how referential integrity is maintained.

Parameters:
referee - The object which is about to be deleted.
column - A column which refers to referee's table: column.getType() is a ReferencePoemType with targetTable() == referee.getTable().
refs - All the Persistents of which column actually points to referee.
referenceFixOfColumn - The column-to-IntegrityFix mapping passed into Persistent.delete(Map).
Returns:
Either a list of the Persistents from refs which constitute reasons why the referee can't be deleted or the EmptyEnumeration if there are no references or all refs have been cleared or deleted.

getName

String getName()
Integrity fixes are set in the DSD by name.

Returns:
the name


Copyright © 2000-2010 PanEris. All Rights Reserved.