use of org.structr.api.graph.RelationshipType in project structr by structr.
the class AbstractNode method getRelationships.
@Override
public final <A extends NodeInterface, B extends NodeInterface, S extends Source, T extends Target, R extends Relation<A, B, S, T>> Iterable<R> getRelationships(final Class<R> type) {
final RelationshipFactory<R> factory = new RelationshipFactory<>(securityContext);
final R template = getRelationshipForType(type);
final Direction direction = template.getDirectionForType(entityType);
final RelationshipType relType = template;
return new IterableAdapter<>(dbNode.getRelationships(direction, relType), factory);
}
use of org.structr.api.graph.RelationshipType in project structr by structr.
the class AbstractNode method getRelationshipsAsSuperUser.
protected final <A extends NodeInterface, B extends NodeInterface, S extends Source, T extends Target, R extends Relation<A, B, S, T>> Iterable<R> getRelationshipsAsSuperUser(final Class<R> type) {
final RelationshipFactory<R> factory = new RelationshipFactory<>(SecurityContext.getSuperUserInstance());
final R template = getRelationshipForType(type);
final Direction direction = template.getDirectionForType(entityType);
final RelationshipType relType = template;
return new IterableAdapter<>(dbNode.getRelationships(direction, relType), factory);
}
Aggregations