001package de.deepamehta.core.service;
002
003import de.deepamehta.core.Association;
004import de.deepamehta.core.Topic;
005import de.deepamehta.core.Type;
006import de.deepamehta.core.model.AssociationDefinitionModel;
007
008
009
010public interface TypeStorage {
011
012    AssociationDefinitionModel createAssociationDefinition(Association assoc);
013
014    AssociationDefinitionModel fetchAssociationDefinition(Association assoc);
015
016    // ---
017
018    Topic fetchParentType(Association assoc);
019
020    Topic fetchChildType(Association assoc);
021
022    // ---
023
024    // Removes an association from memory and rebuilds the sequence in DB. Note: the underlying
025    // association is *not* removed from DB.
026    // This method is called (by the Type Editor plugin's preDeleteAssociation() hook) when the
027    // deletion of an association that represents an association definition is imminent.
028    void removeAssociationDefinitionFromMemoryAndRebuildSequence(Type type, String childTypeUri);
029}