Class RelationModelImpl
java.lang.Object
ch.tocco.nice2.model.entity.api.DefaultModelBase
ch.tocco.nice2.model.entity.api.DefaultRelationModel
ch.tocco.nice2.model.entity.api.relations.RelationModelImpl
- All Implemented Interfaces:
 ModelElement,ModuleTracker,RelationModel
- 
Nested Class Summary
Nested classes/interfaces inherited from interface ch.tocco.nice2.model.entity.api.RelationModel
RelationModel.DefaultComponentConfig - 
Constructor Summary
Constructors - 
Method Summary
Modifier and TypeMethodDescriptionvoidaddDocumentation(String definingModule, String documentation) Adds documentation for theRelationModel, contributed by the definingAppModule.voidaddExtendingModule(String moduleName) Returns the name of the nice2 module, where this model element is defined.intReturns the number of display priority.Returns the content of the documentation element of theRelationModeltag as aLinkedHashMap, divided by theAppModules extending the baseRelationModeland contributing the documentation.Returns a list of nice2 module names, that have contributed to this model element.getLabel()The label of this relationGet the reverse-relation.The source-entity.The source-entity.booleanIf theRelationModel.getSourceEntity()is locked, does this lock propagate over the relation to all target-entities?booleanvoidsetAsSystemRelation(boolean systemRelation) mark the relation as generated by the system system relation are ignored in GenerateMissingFormModelProvidervoidsetDefaultComponentConfig(RelationModel.DefaultComponentConfig componentConfig) set the default component config for this relationvoidvoidsetDefiningModule(String name) voidsetDeleteBehavior(DeleteBehavior deleteBehavior) voidsetDisplayOrder(int displayOrder) voidsetLabel(DisplayValue label) voidsetPropagatingLock(boolean isPropagatingLock) voidsetReverseRelation(RelationModel reverse) voidsetSourceEntity(EntityModel sourceType) voidsetTargetEntity(EntityModel targetType) Methods inherited from class ch.tocco.nice2.model.entity.api.DefaultRelationModel
getAdditionalToStringInfo, getLink, getName, getSelector, getSelectors, getValidator, hasNonEmptyValidator, isReverse, isTargetRequired, isToMany, putSelector, setLink, setMany, setName, setRequired, setReverse, setValidatorMethods inherited from class ch.tocco.nice2.model.entity.api.DefaultModelBase
toStringMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface ch.tocco.nice2.model.entity.api.RelationModel
getLink, getName, getSelector, getSelectors, getValidator, hasNonEmptyValidator, isReverse, isTargetRequired, isToMany, putSelector, setLink, setMany, setName, setRequired, setReverse, setValidator 
- 
Constructor Details
- 
RelationModelImpl
public RelationModelImpl() 
 - 
 - 
Method Details
- 
getLabel
Description copied from interface:RelationModelThe label of this relation- Specified by:
 getLabelin interfaceRelationModel- Returns:
 - .
 
 - 
setLabel
- Specified by:
 setLabelin interfaceRelationModel- Parameters:
 label- the label, non-null
 - 
getDocumentation
Description copied from interface:RelationModelReturns the content of the documentation element of theRelationModeltag as aLinkedHashMap, divided by theAppModules extending the baseRelationModeland contributing the documentation. The contents of the map are ordered according to the loading sequence of theAppModules.- Specified by:
 getDocumentationin interfaceRelationModel- Returns:
 - The 
LinkedHashMapcontaing theRelationModel's documentation tag. 
 - 
addDocumentation
Description copied from interface:RelationModelAdds documentation for theRelationModel, contributed by the definingAppModule.- Specified by:
 addDocumentationin interfaceRelationModel- Parameters:
 definingModule- the string representation of theAppModulecontributing the documentationdocumentation- the documentation for theRelationModel
 - 
setReverseRelation
- Specified by:
 setReverseRelationin interfaceRelationModel- Overrides:
 setReverseRelationin classDefaultRelationModel- Parameters:
 reverse- the the reverse relation.- See Also:
 
 - 
getExtendingModules
Description copied from interface:ModuleTrackerReturns a list of nice2 module names, that have contributed to this model element.- Specified by:
 getExtendingModulesin interfaceModuleTracker
 - 
addExtendingModule
- Specified by:
 addExtendingModulein interfaceModuleTracker
 - 
getDefiningModule
Description copied from interface:ModuleTrackerReturns the name of the nice2 module, where this model element is defined.- Specified by:
 getDefiningModulein interfaceModuleTracker
 - 
setDefiningModule
- Specified by:
 setDefiningModulein interfaceModuleTracker
 - 
setPropagatingLock
public void setPropagatingLock(boolean isPropagatingLock) - Specified by:
 setPropagatingLockin interfaceRelationModel- Parameters:
 isPropagatingLock- do the related entitis get locked, if the source-entity is locked?
 - 
getSourceEntity
Description copied from interface:RelationModelThe source-entity.Example: relation from 'Address' to 'Event' it's the 'Address'.
- Specified by:
 getSourceEntityin interfaceRelationModel- Overrides:
 getSourceEntityin classDefaultRelationModel
 - 
getTargetEntity
Description copied from interface:RelationModelThe source-entity.Example: relation from 'Address' to 'Event' it's the 'Event'.
- Specified by:
 getTargetEntityin interfaceRelationModel- Overrides:
 getTargetEntityin classDefaultRelationModel
 - 
getDeleteBehavior
- Specified by:
 getDeleteBehaviorin interfaceRelationModel- Returns:
 - Returns a description how entities behave when they are deleted.
 
 - 
getDisplayOrder
public int getDisplayOrder()Description copied from interface:RelationModelReturns the number of display priority. The lower the higher ;-)- Specified by:
 getDisplayOrderin interfaceRelationModel- Returns:
 - -1 means don't display, 0 means no config set (fall back to defaults), 
>=1otherwise. 
 - 
setDisplayOrder
public void setDisplayOrder(int displayOrder) - Specified by:
 setDisplayOrderin interfaceRelationModel
 - 
setSourceEntity
- Specified by:
 setSourceEntityin interfaceRelationModel- Overrides:
 setSourceEntityin classDefaultRelationModel- Parameters:
 sourceType- the source-entity, non-null- See Also:
 
 - 
setTargetEntity
- Specified by:
 setTargetEntityin interfaceRelationModel- Overrides:
 setTargetEntityin classDefaultRelationModel- Parameters:
 targetType- the target-entity, non-null- See Also:
 
 - 
getReverse
Description copied from interface:RelationModelGet the reverse-relation.For example the relation is 'Address' to 'Event' called 'relSubscribedTo'. This getter will the return the reverse-relation, 'Event' to 'Address' called 'relSubcribers'
So in the end, the call "relation.getReverse().getReverse()" will return 'relation'. Its circular referncing.
- Specified by:
 getReversein interfaceRelationModel- Overrides:
 getReversein classDefaultRelationModel
 - 
isPropagatingLock
public boolean isPropagatingLock()Description copied from interface:RelationModelIf theRelationModel.getSourceEntity()is locked, does this lock propagate over the relation to all target-entities?- Specified by:
 isPropagatingLockin interfaceRelationModel- Returns:
 - .
 
 - 
setDeleteBehavior
- Specified by:
 setDeleteBehaviorin interfaceRelationModel- Parameters:
 deleteBehavior- set the deletion-behavior, non-null
 - 
setDefaultValue
- Specified by:
 setDefaultValuein interfaceRelationModel
 - 
getDefaultValue
- Specified by:
 getDefaultValuein interfaceRelationModel
 - 
isSystemRelation
public boolean isSystemRelation()- Specified by:
 isSystemRelationin interfaceRelationModel- Returns:
 - true if the relation is marked as generated by the system
 
 - 
setAsSystemRelation
public void setAsSystemRelation(boolean systemRelation) Description copied from interface:RelationModelmark the relation as generated by the system system relation are ignored in GenerateMissingFormModelProvider- Specified by:
 setAsSystemRelationin interfaceRelationModel
 - 
setDefaultComponentConfig
Description copied from interface:RelationModelset the default component config for this relation- Specified by:
 setDefaultComponentConfigin interfaceRelationModel
 - 
getDefaultComponentConfig
- Specified by:
 getDefaultComponentConfigin interfaceRelationModel
 
 -