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
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addDocumentation
(String definingModule, String documentation) Adds documentation for theRelationModel
, contributed by the definingAppModule
.void
addExtendingModule
(String moduleName) Returns the name of the nice2 module, where this model element is defined.int
Returns the number of display priority.Returns the content of the documentation element of theRelationModel
tag as aLinkedHashMap
, divided by theAppModule
s extending the baseRelationModel
and 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.boolean
If theRelationModel.getSourceEntity()
is locked, does this lock propagate over the relation to all target-entities?boolean
void
setAsSystemRelation
(boolean systemRelation) mark the relation as generated by the system system relation are ignored in GenerateMissingFormModelProvidervoid
setDefaultComponentConfig
(RelationModel.DefaultComponentConfig componentConfig) set the default component config for this relationvoid
void
setDefiningModule
(String name) void
setDeleteBehavior
(DeleteBehavior deleteBehavior) void
setDisplayOrder
(int displayOrder) void
setLabel
(DisplayValue label) void
setPropagatingLock
(boolean isPropagatingLock) void
setReverseRelation
(RelationModel reverse) void
setSourceEntity
(EntityModel sourceType) void
setTargetEntity
(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, setValidator
Methods inherited from class ch.tocco.nice2.model.entity.api.DefaultModelBase
toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods 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:RelationModel
The label of this relation- Specified by:
getLabel
in interfaceRelationModel
- Returns:
- .
-
setLabel
- Specified by:
setLabel
in interfaceRelationModel
- Parameters:
label
- the label, non-null
-
getDocumentation
Description copied from interface:RelationModel
Returns the content of the documentation element of theRelationModel
tag as aLinkedHashMap
, divided by theAppModule
s extending the baseRelationModel
and contributing the documentation. The contents of the map are ordered according to the loading sequence of theAppModule
s.- Specified by:
getDocumentation
in interfaceRelationModel
- Returns:
- The
LinkedHashMap
containg theRelationModel
's documentation tag.
-
addDocumentation
Description copied from interface:RelationModel
Adds documentation for theRelationModel
, contributed by the definingAppModule
.- Specified by:
addDocumentation
in interfaceRelationModel
- Parameters:
definingModule
- the string representation of theAppModule
contributing the documentationdocumentation
- the documentation for theRelationModel
-
setReverseRelation
- Specified by:
setReverseRelation
in interfaceRelationModel
- Overrides:
setReverseRelation
in classDefaultRelationModel
- Parameters:
reverse
- the the reverse relation.- See Also:
-
getExtendingModules
Description copied from interface:ModuleTracker
Returns a list of nice2 module names, that have contributed to this model element.- Specified by:
getExtendingModules
in interfaceModuleTracker
-
addExtendingModule
- Specified by:
addExtendingModule
in interfaceModuleTracker
-
getDefiningModule
Description copied from interface:ModuleTracker
Returns the name of the nice2 module, where this model element is defined.- Specified by:
getDefiningModule
in interfaceModuleTracker
-
setDefiningModule
- Specified by:
setDefiningModule
in interfaceModuleTracker
-
setPropagatingLock
public void setPropagatingLock(boolean isPropagatingLock) - Specified by:
setPropagatingLock
in interfaceRelationModel
- Parameters:
isPropagatingLock
- do the related entitis get locked, if the source-entity is locked?
-
getSourceEntity
Description copied from interface:RelationModel
The source-entity.Example: relation from 'Address' to 'Event' it's the 'Address'.
- Specified by:
getSourceEntity
in interfaceRelationModel
- Overrides:
getSourceEntity
in classDefaultRelationModel
-
getTargetEntity
Description copied from interface:RelationModel
The source-entity.Example: relation from 'Address' to 'Event' it's the 'Event'.
- Specified by:
getTargetEntity
in interfaceRelationModel
- Overrides:
getTargetEntity
in classDefaultRelationModel
-
getDeleteBehavior
- Specified by:
getDeleteBehavior
in interfaceRelationModel
- Returns:
- Returns a description how entities behave when they are deleted.
-
getDisplayOrder
public int getDisplayOrder()Description copied from interface:RelationModel
Returns the number of display priority. The lower the higher ;-)- Specified by:
getDisplayOrder
in interfaceRelationModel
- Returns:
- -1 means don't display, 0 means no config set (fall back to defaults),
>=1
otherwise.
-
setDisplayOrder
public void setDisplayOrder(int displayOrder) - Specified by:
setDisplayOrder
in interfaceRelationModel
-
setSourceEntity
- Specified by:
setSourceEntity
in interfaceRelationModel
- Overrides:
setSourceEntity
in classDefaultRelationModel
- Parameters:
sourceType
- the source-entity, non-null- See Also:
-
setTargetEntity
- Specified by:
setTargetEntity
in interfaceRelationModel
- Overrides:
setTargetEntity
in classDefaultRelationModel
- Parameters:
targetType
- the target-entity, non-null- See Also:
-
getReverse
Description copied from interface:RelationModel
Get 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:
getReverse
in interfaceRelationModel
- Overrides:
getReverse
in classDefaultRelationModel
-
isPropagatingLock
public boolean isPropagatingLock()Description copied from interface:RelationModel
If theRelationModel.getSourceEntity()
is locked, does this lock propagate over the relation to all target-entities?- Specified by:
isPropagatingLock
in interfaceRelationModel
- Returns:
- .
-
setDeleteBehavior
- Specified by:
setDeleteBehavior
in interfaceRelationModel
- Parameters:
deleteBehavior
- set the deletion-behavior, non-null
-
setDefaultValue
- Specified by:
setDefaultValue
in interfaceRelationModel
-
getDefaultValue
- Specified by:
getDefaultValue
in interfaceRelationModel
-
isSystemRelation
public boolean isSystemRelation()- Specified by:
isSystemRelation
in interfaceRelationModel
- Returns:
- true if the relation is marked as generated by the system
-
setAsSystemRelation
public void setAsSystemRelation(boolean systemRelation) Description copied from interface:RelationModel
mark the relation as generated by the system system relation are ignored in GenerateMissingFormModelProvider- Specified by:
setAsSystemRelation
in interfaceRelationModel
-
setDefaultComponentConfig
Description copied from interface:RelationModel
set the default component config for this relation- Specified by:
setDefaultComponentConfig
in interfaceRelationModel
-
getDefaultComponentConfig
- Specified by:
getDefaultComponentConfig
in interfaceRelationModel
-