public static interface Relationships.ReadWrite
| Modifier and Type | Method and Description |
|---|---|
void |
delete(String id)
Deletes an relationship with the provided id from the current position in the inventory traversal.
|
Single |
get(String id)
Tries to find a single relationship in the current position in the inventory traversal.
|
Multiple |
getAll(RelationFilter... filters)
Returns access interface to all relationships conforming to provided filters in the current position in the
inventory traversal.
|
default Single |
linkWith(Relationships.WellKnown name,
CanonicalPath targetOrSource,
Map<String,Object> properties) |
Single |
linkWith(String name,
CanonicalPath targetOrSource,
Map<String,Object> properties)
Creates a new relationship at the current position in the inventory traversal.
|
Relationships.Multiple |
named(Relationships.WellKnown name) |
Relationships.Multiple |
named(String name) |
void |
update(String id,
Relationship.Update update)
Updates the provided relationship on the current position in the inventory traversal.
|
Relationships.Multiple named(String name)
Relationships.Multiple named(Relationships.WellKnown name)
Single get(String id) throws EntityNotFoundException, RelationNotFoundException
id - the id of the relationship to find in the current traversal positionEntityNotFoundExceptionRelationNotFoundExceptionMultiple getAll(RelationFilter... filters)
filters - the (possibly empty) list of relationship filters to apply.Single linkWith(String name, CanonicalPath targetOrSource, Map<String,Object> properties) throws IllegalArgumentException
It is possible to have multiple relationships with the same name between 2 entities. These relationships will differ in their ids and can have different properties.
Note: please review the comments on the individual well-known relationships (
contains,
defines,
incorporates) for restrictions of usage,
especially what restrictions the relationships impose when deleting entities.
name - the name of the relationshiptargetOrSource - the the source/target entity (based on the chosen relationship direction) that the current
entity (based on the position in the inventory traversal) will be in the relationship withproperties - the properties of the newly created relationship or null if none specifiedIllegalArgumentException - if any of the parameters is nullEntityNotFoundException - if the current position in the inventory traversal doesn't evaluate to an
existing entity or if the provided other end of the relationship doesn't exist.default Single linkWith(Relationships.WellKnown name, CanonicalPath targetOrSource, Map<String,Object> properties) throws IllegalArgumentException
IllegalArgumentExceptionlinkWith(String, CanonicalPath, Map)void update(String id, Relationship.Update update) throws RelationNotFoundException
id - the id of the relationship to updateupdate - the updateRelationNotFoundException - if the relationship is not found in the databasevoid delete(String id) throws RelationNotFoundException
id - the id of the relationship to deleteRelationNotFoundException - if the relation with given id doesn't exist on the
current position in the inventory traversalCopyright © 2015 Red Hat, Inc.. All rights reserved.