Package org.restheart.mongodb.metadata
Class Relationship
java.lang.Object
org.restheart.mongodb.metadata.Relationship
- Author:
- Andrea Di Cesare <andrea@softinstigate.com>
-
Nested Class Summary
Nested Classes -
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionRelationship(String rel, String type, String role, String targetDb, String targetCollection, String referenceField) Relationship(String rel, Relationship.TYPE type, Relationship.ROLE role, String targetDb, String targetCollection, String referenceField) -
Method Summary
Modifier and TypeMethodDescriptionstatic List<Relationship>getFromJson(org.bson.BsonDocument collProps) getRel()getRelationshipLink(MongoRequest request, String dbName, String collName, org.bson.BsonDocument data) getRole()getType()
-
Field Details
-
RELATIONSHIPS_ELEMENT_NAME
- See Also:
-
REL_ELEMENT_NAME
- See Also:
-
TYPE_ELEMENT_NAME
- See Also:
-
ROLE_ELEMENT_NAME
- See Also:
-
TARGET_DB_ELEMENT_NAME
- See Also:
-
TARGET_COLLECTION_ELEMENT_NAME
- See Also:
-
REF_ELEMENT_NAME
- See Also:
-
-
Constructor Details
-
Relationship
public Relationship(String rel, Relationship.TYPE type, Relationship.ROLE role, String targetDb, String targetCollection, String referenceField) - Parameters:
rel-type-role-targetDb-targetCollection-referenceField-
-
Relationship
public Relationship(String rel, String type, String role, String targetDb, String targetCollection, String referenceField) throws InvalidMetadataException - Parameters:
rel-type-role-targetDb-targetCollection-referenceField-- Throws:
InvalidMetadataException
-
-
Method Details
-
getFromJson
public static List<Relationship> getFromJson(org.bson.BsonDocument collProps) throws InvalidMetadataException - Parameters:
collProps-- Returns:
- Throws:
InvalidMetadataException
-
getRelationshipLink
public String getRelationshipLink(MongoRequest request, String dbName, String collName, org.bson.BsonDocument data) throws IllegalArgumentException, UnsupportedDocumentIdException - Parameters:
request-dbName-collName-data-- Returns:
- Throws:
IllegalArgumentExceptionUnsupportedDocumentIdException
-
getRel
- Returns:
- the rel
-
getType
- Returns:
- the type
-
getRole
- Returns:
- the role
-
getTargetDb
- Returns:
- the targetDb
-
getTargetCollection
- Returns:
- the targetCollection
-
getReferenceField
- Returns:
- the referenceField
-