Class DefaultRelationModel
java.lang.Object
ch.tocco.nice2.model.entity.api.DefaultModelBase
ch.tocco.nice2.model.entity.api.DefaultRelationModel
- All Implemented Interfaces:
ModelElement, ModuleTracker, RelationModel
- Direct Known Subclasses:
RelationModelImpl
-
Nested Class Summary
Nested classes/interfaces inherited from interface RelationModel
RelationModel.DefaultComponentConfig -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected StringgetLink()getName()Get the reverse-relation.getSelector(String name) The source-entity.The source-entity.booleanbooleanTells if this model is the reverse-view or a relation.booleanbooleanisToMany()voidputSelector(String name, Selector selector) voidvoidsetMany(boolean many) voidvoidsetRequired(boolean required) voidsetReverse(boolean reverse) voidsetReverseRelation(RelationModel reverse) voidsetSourceEntity(EntityModel sourceType) voidsetTargetEntity(EntityModel targetType) voidsetValidator(AndGroupValidator validator) Sets the primary validator which may contain real validation validators and other groups.Methods inherited from class DefaultModelBase
toStringMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface ModuleTracker
addExtendingModule, getDefiningModule, getExtendingModules, setDefiningModuleMethods inherited from interface RelationModel
addDocumentation, getDefaultComponentConfig, getDefaultValue, getDeleteBehavior, getDisplayOrder, getDocumentation, getLabel, isPropagatingLock, isSystemRelation, setAsSystemRelation, setDefaultComponentConfig, setDefaultValue, setDeleteBehavior, setDisplayOrder, setLabel, setPropagatingLock
-
Constructor Details
-
DefaultRelationModel
public DefaultRelationModel()
-
-
Method Details
-
getName
- Specified by:
getNamein interfaceRelationModel- Overrides:
getNamein classDefaultModelBase- Returns:
- The name of the Relation, for example "relPrincipalAddress".
-
getSourceEntity
Description copied from interface:RelationModelThe source-entity.Example: relation from 'Address' to 'Event' it's the 'Address'.
- Specified by:
getSourceEntityin interfaceRelationModel
-
getTargetEntity
Description copied from interface:RelationModelThe source-entity.Example: relation from 'Address' to 'Event' it's the 'Event'.
- Specified by:
getTargetEntityin interfaceRelationModel
-
isToMany
public boolean isToMany()- Specified by:
isToManyin interfaceRelationModel- Returns:
- Tells whether this is a to-one or a to-many relation.
-
isTargetRequired
public boolean isTargetRequired()- Specified by:
isTargetRequiredin interfaceRelationModel
-
getLink
- Specified by:
getLinkin interfaceRelationModel
-
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
-
isReverse
public boolean isReverse()Description copied from interface:RelationModelTells if this model is the reverse-view or a relation.- Specified by:
isReversein interfaceRelationModel- Returns:
- true if reverse-view
-
getAdditionalToStringInfo
- Overrides:
getAdditionalToStringInfoin classDefaultModelBase
-
setSourceEntity
- Specified by:
setSourceEntityin interfaceRelationModel- Parameters:
sourceType- the source-entity, non-null- See Also:
-
setTargetEntity
- Specified by:
setTargetEntityin interfaceRelationModel- Parameters:
targetType- the target-entity, non-null- See Also:
-
setMany
public void setMany(boolean many) - Specified by:
setManyin interfaceRelationModel- Parameters:
many- true/false- See Also:
-
setRequired
public void setRequired(boolean required) - Specified by:
setRequiredin interfaceRelationModel- Parameters:
required- true/false- See Also:
-
setLink
- Specified by:
setLinkin interfaceRelationModel- Parameters:
link- the link, non-null- See Also:
-
setReverseRelation
- Specified by:
setReverseRelationin interfaceRelationModel- Parameters:
reverse- the the reverse relation.- See Also:
-
setReverse
public void setReverse(boolean reverse) - Specified by:
setReversein interfaceRelationModel- Parameters:
reverse- the reverse relation- See Also:
-
setName
- Specified by:
setNamein interfaceRelationModel- Overrides:
setNamein classDefaultModelBase- Parameters:
name- The name of the relation.- See Also:
-
putSelector
- Specified by:
putSelectorin interfaceRelationModel
-
getSelector
- Specified by:
getSelectorin interfaceRelationModel
-
getSelectors
- Specified by:
getSelectorsin interfaceRelationModel
-
hasNonEmptyValidator
public boolean hasNonEmptyValidator()- Specified by:
hasNonEmptyValidatorin interfaceRelationModel- Returns:
- Tells if this field model has a validator, a GroupValidator to be precise, which has at least one entry.
- See Also:
-
getValidator
- Specified by:
getValidatorin interfaceRelationModel- Returns:
- Returns the outermost group validator which may be empty.
- See Also:
-
setValidator
Description copied from interface:RelationModelSets the primary validator which may contain real validation validators and other groups.Method for the startup process.
- Specified by:
setValidatorin interfaceRelationModel- Parameters:
validator- The group validator.
-