Spring Data Graph

org.springframework.data.neo4j.support
Class GraphDatabaseContext

java.lang.Object
  extended by org.springframework.data.neo4j.support.GraphDatabaseContext

public class GraphDatabaseContext
extends Object

Mediator class for the graph related services like the GraphDatabaseService, the used TypeRepresentationStrategy, entity instantiators for nodes and relationships as well as a spring conversion service. It delegates the appropriate methods to those services. The services are not intended to be accessible from outside.

Since:
13.09.2010
Author:
Michael Hunger

Field Summary
static String DEFAULT_NODE_INDEX_NAME
           
static String DEFAULT_RELATIONSHIP_INDEX_NAME
           
 
Constructor Summary
GraphDatabaseContext()
           
 
Method Summary
 org.neo4j.graphdb.Transaction beginTx()
          Delegates to GraphDatabaseService
<T extends GraphBacked<? extends org.neo4j.graphdb.PropertyContainer>>
long
count(Class<T> entityClass)
           
<S extends org.neo4j.graphdb.PropertyContainer,T extends GraphBacked<S>>
T
createEntityFromState(S state, Class<T> type)
           
<S extends org.neo4j.graphdb.PropertyContainer,T extends GraphBacked<S>>
T
createEntityFromStoredType(S state)
           
 org.neo4j.graphdb.Node createNode()
          Delegates to GraphDatabaseService
<T extends GraphBacked<? extends org.neo4j.graphdb.PropertyContainer>>
org.neo4j.helpers.collection.ClosableIterable<T>
findAll(Class<T> entityClass)
           
 Iterable<? extends org.neo4j.graphdb.Node> getAllNodes()
          Delegates to GraphDatabaseService
 ConversionService getConversionService()
           
 org.neo4j.graphdb.GraphDatabaseService getGraphDatabaseService()
           
<S extends org.neo4j.graphdb.PropertyContainer,T extends GraphBacked<S>>
org.neo4j.graphdb.index.Index<S>
getIndex(Class<T> type)
           
<S extends org.neo4j.graphdb.PropertyContainer,T extends GraphBacked<S>>
org.neo4j.graphdb.index.Index<S>
getIndex(Class<T> type, String indexName)
           
<S extends org.neo4j.graphdb.PropertyContainer,T extends GraphBacked<S>>
org.neo4j.graphdb.index.Index<S>
getIndex(Class<T> type, String indexName, boolean fullText)
           
 org.neo4j.graphdb.Node getNodeById(long nodeId)
          Delegates to GraphDatabaseService
 NodeTypeRepresentationStrategy getNodeTypeRepresentationStrategy()
           
 org.neo4j.graphdb.Node getReferenceNode()
          Delegates to GraphDatabaseService
 org.neo4j.graphdb.Relationship getRelationshipById(long id)
          Delegates to GraphDatabaseService
 RelationshipTypeRepresentationStrategy getRelationshipTypeRepresentationStrategy()
           
 javax.validation.Validator getValidator()
           
<S extends org.neo4j.graphdb.PropertyContainer,T extends GraphBacked<S>>
void
postEntityCreation(S node, Class<T> entityClass)
           
<S extends org.neo4j.graphdb.PropertyContainer,T extends GraphBacked<S>>
T
projectTo(GraphBacked<S> entity, Class<T> targetType)
           
 void removeNodeEntity(NodeBacked entity)
           
 void removeRelationshipEntity(RelationshipBacked entity)
           
 void setConversionService(ConversionService conversionService)
           
 void setGraphDatabaseService(org.neo4j.graphdb.GraphDatabaseService graphDatabaseService)
           
 void setNodeTypeRepresentationStrategy(NodeTypeRepresentationStrategy nodeTypeRepresentationStrategy)
           
 void setRelationshipTypeRepresentationStrategy(RelationshipTypeRepresentationStrategy relationshipTypeRepresentationStrategy)
           
 void setValidator(javax.validation.Validator validatorFactory)
           
 boolean transactionIsRunning()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_NODE_INDEX_NAME

public static final String DEFAULT_NODE_INDEX_NAME
See Also:
Constant Field Values

DEFAULT_RELATIONSHIP_INDEX_NAME

public static final String DEFAULT_RELATIONSHIP_INDEX_NAME
See Also:
Constant Field Values
Constructor Detail

GraphDatabaseContext

public GraphDatabaseContext()
Method Detail

getIndex

public <S extends org.neo4j.graphdb.PropertyContainer,T extends GraphBacked<S>> org.neo4j.graphdb.index.Index<S> getIndex(Class<T> type)

getIndex

public <S extends org.neo4j.graphdb.PropertyContainer,T extends GraphBacked<S>> org.neo4j.graphdb.index.Index<S> getIndex(Class<T> type,
                                                                                                                          String indexName)

getIndex

public <S extends org.neo4j.graphdb.PropertyContainer,T extends GraphBacked<S>> org.neo4j.graphdb.index.Index<S> getIndex(Class<T> type,
                                                                                                                          String indexName,
                                                                                                                          boolean fullText)

transactionIsRunning

public boolean transactionIsRunning()
Returns:
true if a transaction manager is available and a transaction is currently running

findAll

public <T extends GraphBacked<? extends org.neo4j.graphdb.PropertyContainer>> org.neo4j.helpers.collection.ClosableIterable<T> findAll(Class<T> entityClass)

count

public <T extends GraphBacked<? extends org.neo4j.graphdb.PropertyContainer>> long count(Class<T> entityClass)

createEntityFromStoredType

public <S extends org.neo4j.graphdb.PropertyContainer,T extends GraphBacked<S>> T createEntityFromStoredType(S state)

createEntityFromState

public <S extends org.neo4j.graphdb.PropertyContainer,T extends GraphBacked<S>> T createEntityFromState(S state,
                                                                                                        Class<T> type)

projectTo

public <S extends org.neo4j.graphdb.PropertyContainer,T extends GraphBacked<S>> T projectTo(GraphBacked<S> entity,
                                                                                            Class<T> targetType)

postEntityCreation

public <S extends org.neo4j.graphdb.PropertyContainer,T extends GraphBacked<S>> void postEntityCreation(S node,
                                                                                                        Class<T> entityClass)

removeNodeEntity

public void removeNodeEntity(NodeBacked entity)

removeRelationshipEntity

public void removeRelationshipEntity(RelationshipBacked entity)

createNode

public org.neo4j.graphdb.Node createNode()
Delegates to GraphDatabaseService


getNodeById

public org.neo4j.graphdb.Node getNodeById(long nodeId)
Delegates to GraphDatabaseService


getReferenceNode

public org.neo4j.graphdb.Node getReferenceNode()
Delegates to GraphDatabaseService


getAllNodes

public Iterable<? extends org.neo4j.graphdb.Node> getAllNodes()
Delegates to GraphDatabaseService


beginTx

public org.neo4j.graphdb.Transaction beginTx()
Delegates to GraphDatabaseService


getRelationshipById

public org.neo4j.graphdb.Relationship getRelationshipById(long id)
Delegates to GraphDatabaseService


getGraphDatabaseService

public org.neo4j.graphdb.GraphDatabaseService getGraphDatabaseService()

setGraphDatabaseService

public void setGraphDatabaseService(org.neo4j.graphdb.GraphDatabaseService graphDatabaseService)

getNodeTypeRepresentationStrategy

public NodeTypeRepresentationStrategy getNodeTypeRepresentationStrategy()

setNodeTypeRepresentationStrategy

public void setNodeTypeRepresentationStrategy(NodeTypeRepresentationStrategy nodeTypeRepresentationStrategy)

getRelationshipTypeRepresentationStrategy

public RelationshipTypeRepresentationStrategy getRelationshipTypeRepresentationStrategy()

setRelationshipTypeRepresentationStrategy

public void setRelationshipTypeRepresentationStrategy(RelationshipTypeRepresentationStrategy relationshipTypeRepresentationStrategy)

getConversionService

public ConversionService getConversionService()

setConversionService

public void setConversionService(ConversionService conversionService)

getValidator

public javax.validation.Validator getValidator()

setValidator

public void setValidator(javax.validation.Validator validatorFactory)

Spring Data Graph

Copyright © 2011 SpringSource. All Rights Reserved.