Spring Data Graph

org.springframework.data.neo4j.support.typerepresentation
Class NoopRelationshipTypeRepresentationStrategy

java.lang.Object
  extended by org.springframework.data.neo4j.support.typerepresentation.NoopRelationshipTypeRepresentationStrategy
All Implemented Interfaces:
RelationshipTypeRepresentationStrategy, TypeRepresentationStrategy<org.neo4j.graphdb.Relationship,RelationshipBacked>

public class NoopRelationshipTypeRepresentationStrategy
extends Object
implements RelationshipTypeRepresentationStrategy


Constructor Summary
NoopRelationshipTypeRepresentationStrategy()
           
 
Method Summary
 long count(Class<? extends RelationshipBacked> entityClass)
           
<U extends RelationshipBacked>
U
createEntity(org.neo4j.graphdb.Relationship state)
          Instantiate the entity given its state.
<U extends RelationshipBacked>
U
createEntity(org.neo4j.graphdb.Relationship state, Class<U> type)
          Instantiate the entity given its state.
<U extends RelationshipBacked>
org.neo4j.helpers.collection.ClosableIterable<U>
findAll(Class<U> clazz)
           
 Class<? extends RelationshipBacked> getJavaType(org.neo4j.graphdb.Relationship state)
           
 void postEntityCreation(org.neo4j.graphdb.Relationship state, Class<? extends RelationshipBacked> type)
          Callback for setting up and/or storing type information after creation.
 void preEntityRemoval(org.neo4j.graphdb.Relationship state)
          Callback for cleaning up type information before removal.
<U extends RelationshipBacked>
U
projectEntity(org.neo4j.graphdb.Relationship state, Class<U> type)
          Instantiate the entity of the given type, with the given state as backing state.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NoopRelationshipTypeRepresentationStrategy

public NoopRelationshipTypeRepresentationStrategy()
Method Detail

postEntityCreation

public void postEntityCreation(org.neo4j.graphdb.Relationship state,
                               Class<? extends RelationshipBacked> type)
Description copied from interface: TypeRepresentationStrategy
Callback for setting up and/or storing type information after creation.

Specified by:
postEntityCreation in interface TypeRepresentationStrategy<org.neo4j.graphdb.Relationship,RelationshipBacked>
Parameters:
state - Backing state of entity being created
type - Type of entity being created

findAll

public <U extends RelationshipBacked> org.neo4j.helpers.collection.ClosableIterable<U> findAll(Class<U> clazz)
Specified by:
findAll in interface TypeRepresentationStrategy<org.neo4j.graphdb.Relationship,RelationshipBacked>
Parameters:
clazz - Type whose instances should be iterated over
Returns:
lazy Iterable over all instances of the given type

count

public long count(Class<? extends RelationshipBacked> entityClass)
Specified by:
count in interface TypeRepresentationStrategy<org.neo4j.graphdb.Relationship,RelationshipBacked>
Returns:
number of instances of this class contained in the graph

preEntityRemoval

public void preEntityRemoval(org.neo4j.graphdb.Relationship state)
Description copied from interface: TypeRepresentationStrategy
Callback for cleaning up type information before removal. If state does not have any state associated, doesn't do anything.

Specified by:
preEntityRemoval in interface TypeRepresentationStrategy<org.neo4j.graphdb.Relationship,RelationshipBacked>
Parameters:
state - Backing state of entity being removed

getJavaType

public Class<? extends RelationshipBacked> getJavaType(org.neo4j.graphdb.Relationship state)
Specified by:
getJavaType in interface TypeRepresentationStrategy<org.neo4j.graphdb.Relationship,RelationshipBacked>
Returns:
java type that of the node entity of this node

createEntity

public <U extends RelationshipBacked> U createEntity(org.neo4j.graphdb.Relationship state)
Description copied from interface: TypeRepresentationStrategy
Instantiate the entity given its state. The type of the entity is inferred by the strategy from the state.

Specified by:
createEntity in interface TypeRepresentationStrategy<org.neo4j.graphdb.Relationship,RelationshipBacked>
Type Parameters:
U - Helper parameter for castless use
Parameters:
state - Backing state of entity to be instantiated
Returns:
Entity instance

createEntity

public <U extends RelationshipBacked> U createEntity(org.neo4j.graphdb.Relationship state,
                                                     Class<U> type)
Description copied from interface: TypeRepresentationStrategy
Instantiate the entity given its state. The type of the desired entity is also specified. If the type is not compatible with what the strategy can infer from the state, IllegalArgumentException is thrown.

Specified by:
createEntity in interface TypeRepresentationStrategy<org.neo4j.graphdb.Relationship,RelationshipBacked>
Parameters:
state - Backing state of entity to be instantiated
type - Type of entity to be instantiated
Returns:
Entity instance

projectEntity

public <U extends RelationshipBacked> U projectEntity(org.neo4j.graphdb.Relationship state,
                                                      Class<U> type)
Description copied from interface: TypeRepresentationStrategy
Instantiate the entity of the given type, with the given state as backing state. No checking is done by the strategy.

Specified by:
projectEntity in interface TypeRepresentationStrategy<org.neo4j.graphdb.Relationship,RelationshipBacked>
Parameters:
state - Backing state of entity to be instantiated
type - Type of entity to be instantiated
Returns:
Entity instance.

Spring Data Graph

Copyright © 2011 SpringSource. All Rights Reserved.