Package org.restheart.mongodb.metadata
Class Relationship
- java.lang.Object
-
- org.restheart.mongodb.metadata.Relationship
-
public class Relationship extends Object
- Author:
- Andrea Di Cesare <andrea@softinstigate.com>
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classRelationship.ROLEstatic classRelationship.TYPE
-
Field Summary
Fields Modifier and Type Field Description static StringREF_ELEMENT_NAMEstatic StringREL_ELEMENT_NAMEstatic StringRELATIONSHIPS_ELEMENT_NAMEstatic StringROLE_ELEMENT_NAMEstatic StringTARGET_COLLECTION_ELEMENT_NAMEstatic StringTARGET_DB_ELEMENT_NAMEstatic StringTYPE_ELEMENT_NAME
-
Constructor Summary
Constructors Constructor Description Relationship(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
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static List<Relationship>getFromJson(org.bson.BsonDocument collProps)StringgetReferenceField()StringgetRel()StringgetRelationshipLink(MongoRequest request, String dbName, String collName, org.bson.BsonDocument data)Relationship.ROLEgetRole()StringgetTargetCollection()StringgetTargetDb()Relationship.TYPEgetType()
-
-
-
Field Detail
-
RELATIONSHIPS_ELEMENT_NAME
public static final String RELATIONSHIPS_ELEMENT_NAME
- See Also:
- Constant Field Values
-
REL_ELEMENT_NAME
public static final String REL_ELEMENT_NAME
- See Also:
- Constant Field Values
-
TYPE_ELEMENT_NAME
public static final String TYPE_ELEMENT_NAME
- See Also:
- Constant Field Values
-
ROLE_ELEMENT_NAME
public static final String ROLE_ELEMENT_NAME
- See Also:
- Constant Field Values
-
TARGET_DB_ELEMENT_NAME
public static final String TARGET_DB_ELEMENT_NAME
- See Also:
- Constant Field Values
-
TARGET_COLLECTION_ELEMENT_NAME
public static final String TARGET_COLLECTION_ELEMENT_NAME
- See Also:
- Constant Field Values
-
REF_ELEMENT_NAME
public static final String REF_ELEMENT_NAME
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
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 Detail
-
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
public String getRel()
- Returns:
- the rel
-
getType
public Relationship.TYPE getType()
- Returns:
- the type
-
getRole
public Relationship.ROLE getRole()
- Returns:
- the role
-
getTargetDb
public String getTargetDb()
- Returns:
- the targetDb
-
getTargetCollection
public String getTargetCollection()
- Returns:
- the targetCollection
-
getReferenceField
public String getReferenceField()
- Returns:
- the referenceField
-
-