|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface IManyToManyRelation
An interface of many-to-many relations which may have multiple source and target entities. The relation may be directed or bi-directional. In the former case the direction is from source entities to target entities.
Each relation has to satisfy the following condition:
Both source and target entities are properties of type PropertyType.REFERENCE_LIST. The names of the
properties are: IManyToManyRelation.Properties.SOURCE_ENTITIES, IManyToManyRelation.Properties.TARGET_ENTITIES and
IManyToManyRelation.Properties.DIRECTED
IGeneralDataSet,
IEntity| Nested Class Summary | |
|---|---|
static class |
IManyToManyRelation.Properties
Enumeration of property name constants. |
| Field Summary | |
|---|---|
static Type |
TYPE
The type of many-to-many relation elements. |
| Method Summary | |
|---|---|
void |
addSourceEntitiy(IEntity entity)
Adds a source entity associated with the relation. |
void |
addTargetEntitiy(IEntity entity)
Adds a target entity associated with the relation. |
List<? extends IEntity> |
getSourceEntities()
Returns source entities associated with the relation. |
IEntity |
getSourceEntitiy(int index)
Gets source entity associated with the relation with given index in the list. |
List<? extends IEntity> |
getTargetEntities()
Returns target entities associated with the relation. |
IEntity |
getTargetEntitiy(int index)
Gets target entity associated with the relation with given index in the list. |
Boolean |
isDirected()
Checks if given relation is directed (from source to target entities) or not (in that case it is bi-directional). |
boolean |
removeSourceEntitiy(IEntity entity)
Removes the specified source entity associated with the relation. |
boolean |
removeTargetEntitiy(IEntity entity)
Removes the specified target entity associated with the relation. |
void |
setDirected(Boolean directed)
Sets the directed flag. |
void |
setSourceEntities(List<? extends IEntity> entities)
Sets source entities associated with the relation. |
void |
setTargetEntities(List<? extends IEntity> entities)
Sets target entities associated with the relation. |
| Methods inherited from interface pl.edu.agh.cast.data.model.IElement |
|---|
getDataSet |
| Methods inherited from interface pl.edu.agh.cast.data.model.Identifiable |
|---|
getId, getType |
| Methods inherited from interface pl.edu.agh.cast.data.model.property.IPropertyContainer |
|---|
addProperty, getCustomProperties, getMetaPropertyManager, getPermanentProperties, getProperties, getProperty, getTransientProperties, matches, removeProperty, setProperty |
| Methods inherited from interface java.util.Observer |
|---|
update |
| Methods inherited from interface pl.edu.agh.cast.common.IValidatable |
|---|
isValid |
| Methods inherited from interface pl.edu.agh.cast.common.IDisposable |
|---|
dispose |
| Methods inherited from interface pl.edu.agh.cast.common.IReplicable |
|---|
replicate, replicateTo |
| Field Detail |
|---|
static final Type TYPE
| Method Detail |
|---|
@PropertyGetter(name="SOURCE_ENTITIES",
type=REFERENCE_LIST,
matchable=true)
List<? extends IEntity> getSourceEntities()
@PropertySetter(name="SOURCE_ENTITIES") void setSourceEntities(List<? extends IEntity> entities)
entities - collection containing at least one entity
IllegalArgumentException - when entity list is null or emptyIEntity getSourceEntitiy(int index)
index - index of entity in the source entities list
null if not present
void addSourceEntitiy(IEntity entity)
throws ModelException
entity - entity to add
IllegalArgumentException - when entity is null
ModelException - when entity is already the relation's source entityboolean removeSourceEntitiy(IEntity entity)
entity - entity to remove
true if the source entity was present and successfully removed
IllegalArgumentException - when entity is null
@PropertyGetter(name="TARGET_ENTITIES",
type=REFERENCE_LIST,
matchable=true)
List<? extends IEntity> getTargetEntities()
@PropertySetter(name="TARGET_ENTITIES") void setTargetEntities(List<? extends IEntity> entities)
entities - collection containing at least one entity
IllegalArgumentException - when entity list is null or emptyIEntity getTargetEntitiy(int index)
index - index of entity in the target entities list
null if not present
void addTargetEntitiy(IEntity entity)
throws ModelException
entity - entity to add
IllegalArgumentException - when entity is null
ModelException - when entity is already the relation's target entityboolean removeTargetEntitiy(IEntity entity)
entity - entity to remove
true if the target entity was present and successfully removed
IllegalArgumentException - when entity is null
@PropertyGetter(name="DIRECTED",
type=BOOLEAN,
matchable=true)
Boolean isDirected()
true if this relation is directed, false if it is bi-directional@PropertySetter(name="DIRECTED") void setDirected(Boolean directed)
directed - the flag
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||