Search in sources :

Example 1 with NodeQueryStatements

use of org.neo4j.ogm.session.request.strategy.impl.NodeQueryStatements in project neo4j-ogm by neo4j.

the class Neo4jSession method queryStatementsFor.

// 
// These helper methods for the delegates are deliberately NOT defined on the Session interface
// 
public <T, ID extends Serializable> QueryStatements<ID> queryStatementsFor(Class<T> type, int depth) {
    final FieldInfo fieldInfo = metaData.classInfo(type.getName()).primaryIndexField();
    String primaryIdName = fieldInfo != null ? fieldInfo.property() : null;
    if (metaData.isRelationshipEntity(type.getName())) {
        return new RelationshipQueryStatements<>(primaryIdName, loadRelationshipClauseBuilder(depth));
    } else {
        return new NodeQueryStatements<>(primaryIdName, loadNodeClauseBuilder(depth));
    }
}
Also used : RelationshipQueryStatements(org.neo4j.ogm.session.request.strategy.impl.RelationshipQueryStatements) NodeQueryStatements(org.neo4j.ogm.session.request.strategy.impl.NodeQueryStatements) FieldInfo(org.neo4j.ogm.metadata.FieldInfo)

Aggregations

FieldInfo (org.neo4j.ogm.metadata.FieldInfo)1 NodeQueryStatements (org.neo4j.ogm.session.request.strategy.impl.NodeQueryStatements)1 RelationshipQueryStatements (org.neo4j.ogm.session.request.strategy.impl.RelationshipQueryStatements)1