|
Spring Data Graph | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface TypeRepresentationStrategy<S extends org.neo4j.graphdb.PropertyContainer,T extends GraphBacked<S>>
Strategy to handle representation of java types in the graph. Possible implementation are type/class nodes (forming an inheritance chain) that is linked to from the instance and keeps a count of the instances. Another approach could use indexing and a type property on the instance fields. Contains a callback on entity creation that can setup the type representation. The finder methods are delegated to for the appropriate calls for the strategy set for the datastore.
| Method Summary | ||
|---|---|---|
long |
count(Class<? extends T> entityClass)
|
|
|
createEntity(S state)
Instantiate the entity given its state. |
|
|
createEntity(S state,
Class<U> type)
Instantiate the entity given its state. |
|
|
findAll(Class<U> clazz)
|
|
|
getJavaType(S state)
|
|
void |
postEntityCreation(S state,
Class<? extends T> type)
Callback for setting up and/or storing type information after creation. |
|
void |
preEntityRemoval(S state)
Callback for cleaning up type information before removal. |
|
|
projectEntity(S state,
Class<U> type)
Instantiate the entity of the given type, with the given state as backing state. |
|
| Method Detail |
|---|
void postEntityCreation(S state,
Class<? extends T> type)
state - Backing state of entity being createdtype - Type of entity being created<U extends T> org.neo4j.helpers.collection.ClosableIterable<U> findAll(Class<U> clazz)
clazz - Type whose instances should be iterated over
long count(Class<? extends T> entityClass)
entityClass -
<U extends T> Class<U> getJavaType(S state)
state -
void preEntityRemoval(S state)
state - Backing state of entity being removed
<U extends T> U createEntity(S state)
throws IllegalStateException
U - Helper parameter for castless usestate - Backing state of entity to be instantiated
IllegalStateException - If the strategy is unable to infer any type from the state
<U extends T> U createEntity(S state,
Class<U> type)
throws IllegalStateException,
IllegalArgumentException
IllegalArgumentException is thrown.
state - Backing state of entity to be instantiatedtype - Type of entity to be instantiated
IllegalStateException - If the strategy is unable to infer any type from the state
IllegalArgumentException - If the specified type does not match the inferred type
<U extends T> U projectEntity(S state,
Class<U> type)
state - Backing state of entity to be instantiatedtype - Type of entity to be instantiated
|
Spring Data Graph | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||