abstract class AttachedType extends AttachedTopic implements Type
Modifier and Type | Class and Description |
---|---|
private class |
AttachedType.JSONWrapper |
Modifier and Type | Field and Description |
---|---|
private SequencedHashMap<String,AssociationDefinition> |
assocDefs |
private Logger |
logger |
private ViewConfiguration |
viewConfig |
dms
Constructor and Description |
---|
AttachedType(TypeModel model,
EmbeddedService dms) |
Modifier and Type | Method and Description |
---|---|
private void |
_addAssocDef(AssociationDefinitionModel model) |
private void |
_addAssocDefBefore(AssociationDefinitionModel model,
String beforeChildTypeUri) |
private void |
_removeAssocDef(String childTypeUri) |
private void |
_removeFromTypeCache()
Removes this type from type cache and adds a DELETE TYPE directive to the given set of directives.
|
Type |
addAssocDef(AssociationDefinitionModel assocDef) |
Type |
addAssocDefBefore(AssociationDefinitionModel assocDef,
String beforeChildTypeUri) |
private void |
addDeleteTypeDirective() |
void |
addIndexMode(IndexMode indexMode) |
void |
delete()
Deletes 1) this DeepaMehta object's child topics (recursively) which have an underlying association definition of
type "Composition Definition" and 2) deletes all the remaining direct associations of this DeepaMehta object.
|
private AssociationDefinitionModel |
firstAssocDef() |
(package private) abstract List<? extends DeepaMehtaObject> |
getAllInstances() |
AssociationDefinition |
getAssocDef(String childTypeUri) |
Collection<AssociationDefinition> |
getAssocDefs() |
String |
getDataTypeUri() |
(package private) abstract Directive |
getDeleteTypeDirective() |
List<IndexMode> |
getIndexModes() |
List<String> |
getLabelConfig() |
TypeModel |
getModel() |
ViewConfiguration |
getViewConfig() |
Object |
getViewConfig(String typeUri,
String settingUri) |
boolean |
hasAssocDef(String childTypeUri) |
private boolean |
hasSequenceChanged(Collection<AssociationDefinitionModel> newAssocDefs) |
private boolean |
hasUriChanged(String newUri) |
private void |
indexAllInstances(IndexMode indexMode) |
protected void |
initAssocDefs() |
private void |
initViewConfig() |
private AssociationDefinitionModel |
lastAssocDef()
Returns the last association definition of this type or
null if there are no association definitions. |
(package private) abstract void |
putInTypeCache() |
Type |
removeAssocDef(String childTypeUri) |
(package private) void |
removeAssocDefFromMemoryAndRebuildSequence(String childTypeUri) |
(package private) abstract void |
removeFromTypeCache() |
void |
setDataTypeUri(String dataTypeUri) |
void |
setLabelConfig(List<String> labelConfig) |
private void |
storeDataTypeUri(String dataTypeUri) |
void |
update(TypeModel model) |
void |
updateAssocDef(AssociationDefinitionModel assocDef)
Note: in contrast to the other "update" methods this one updates the memory only, not the DB!
If you want to update memory and DB use
AssociationDefinition.update(de.deepamehta.core.model.AssociationDefinitionModel) . |
private void |
updateAssocDefs(Collection<AssociationDefinitionModel> newAssocDefs) |
private void |
updateDataTypeUri(String newDataTypeUri) |
private void |
updateLabelConfig(List<String> newLabelConfig) |
private void |
updateSequence(Collection<AssociationDefinitionModel> newAssocDefs) |
_update, className, fetchRelatedTopic, fetchRelatedTopics, getAssociation, getAssociations, getRelatedAssociation, getRelatedAssociations, getRelatedTopics, getType, getUpdateDirective, loadChildTopics, loadChildTopics, removeProperty, setProperty, storeTypeUri, storeUri, update, updateChildTopics
equals, getChildTopics, getDatabaseVendorObject, getId, getProperty, getRelatedTopic, getRelatedTopics, getRelatedTopics, getSimpleValue, getTypeUri, getUri, hashCode, hasProperty, setChildTopics, setSimpleValue, setSimpleValue, setSimpleValue, setSimpleValue, setSimpleValue, setTypeUri, setUri, toJSON, toString, update, updateChildTopic, updateChildTopics
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
loadChildTopics, loadChildTopics, update
getAssociation, getAssociations, getChildTopics, getDatabaseVendorObject, getId, getProperty, getRelatedAssociation, getRelatedAssociations, getRelatedTopic, getRelatedTopics, getRelatedTopics, getRelatedTopics, getSimpleValue, getTypeUri, getUri, hasProperty, removeProperty, setChildTopics, setProperty, setSimpleValue, setSimpleValue, setSimpleValue, setSimpleValue, setSimpleValue, setTypeUri, setUri, update, updateChildTopic, updateChildTopics
toJSON
private SequencedHashMap<String,AssociationDefinition> assocDefs
private ViewConfiguration viewConfig
AttachedType(TypeModel model, EmbeddedService dms)
public void delete()
AttachedDeepaMehtaObject
Note: deletion of the object itself is up to the subclasses.
delete
in interface DeepaMehtaObject
delete
in class AttachedTopic
public String getDataTypeUri()
getDataTypeUri
in interface Type
public void setDataTypeUri(String dataTypeUri)
setDataTypeUri
in interface Type
public List<IndexMode> getIndexModes()
getIndexModes
in interface Type
public void addIndexMode(IndexMode indexMode)
addIndexMode
in interface Type
public Collection<AssociationDefinition> getAssocDefs()
getAssocDefs
in interface Type
public AssociationDefinition getAssocDef(String childTypeUri)
getAssocDef
in interface Type
public boolean hasAssocDef(String childTypeUri)
hasAssocDef
in interface Type
public Type addAssocDef(AssociationDefinitionModel assocDef)
addAssocDef
in interface Type
public Type addAssocDefBefore(AssociationDefinitionModel assocDef, String beforeChildTypeUri)
addAssocDefBefore
in interface Type
beforeChildTypeUri
- the assoc def before the assoc def is inserted into the sequence.
If null
the assoc def is appended at the end.public void updateAssocDef(AssociationDefinitionModel assocDef)
Type
AssociationDefinition.update(de.deepamehta.core.model.AssociationDefinitionModel)
.
This method is here to support a special case: the user retypes an association which results in a changed type definition. In this case the DB is already up-to-date and only the type's memory representation must be updated. So, here the DB update is the *cause* for a necessary memory-update. Normally the situation is vice-versa: the DB update is the necessary *effect* of a memory-update.
### TODO: get rid of this peculiar situation and remove this method. This might be achieved by using
the PRE_UPDATE_ASSOCIATION hook instead the POST_UPDATE_ASSOCIATION hook in the Type Editor module.
On pre-update we would perform a regular AssociationDefinition.update(de.deepamehta.core.model.AssociationDefinitionModel)
and suppress further
processing by returning false.
updateAssocDef
in interface Type
assocDef
- the new association definition.
Note: in contrast to the other "update" methods this one does not support partial updates.
That is all association definition fields must be initialized.public Type removeAssocDef(String childTypeUri)
removeAssocDef
in interface Type
public List<String> getLabelConfig()
getLabelConfig
in interface Type
public void setLabelConfig(List<String> labelConfig)
setLabelConfig
in interface Type
public ViewConfiguration getViewConfig()
getViewConfig
in interface Type
public Object getViewConfig(String typeUri, String settingUri)
getViewConfig
in interface Type
public TypeModel getModel()
getModel
in interface DeepaMehtaObject
getModel
in interface Topic
getModel
in interface Type
getModel
in class AttachedTopic
abstract void putInTypeCache()
abstract void removeFromTypeCache()
abstract Directive getDeleteTypeDirective()
abstract List<? extends DeepaMehtaObject> getAllInstances()
void removeAssocDefFromMemoryAndRebuildSequence(String childTypeUri)
private boolean hasUriChanged(String newUri)
private void updateDataTypeUri(String newDataTypeUri)
private void storeDataTypeUri(String dataTypeUri)
private void indexAllInstances(IndexMode indexMode)
private void updateAssocDefs(Collection<AssociationDefinitionModel> newAssocDefs)
private void updateSequence(Collection<AssociationDefinitionModel> newAssocDefs)
private boolean hasSequenceChanged(Collection<AssociationDefinitionModel> newAssocDefs)
private void updateLabelConfig(List<String> newLabelConfig)
private AssociationDefinitionModel lastAssocDef()
null
if there are no association definitions.
### TODO: move to class TypeModel?private AssociationDefinitionModel firstAssocDef()
protected void initAssocDefs()
private void _addAssocDef(AssociationDefinitionModel model)
private void _addAssocDefBefore(AssociationDefinitionModel model, String beforeChildTypeUri)
beforeChildTypeUri
- the assoc def before the assoc def is inserted into the sequence.
If null
the assoc def is appended at the end.private void _removeAssocDef(String childTypeUri)
private void initViewConfig()
private void _removeFromTypeCache()
private void addDeleteTypeDirective()
Copyright © 2015. All Rights Reserved.