public interface Session
Modifier and Type | Method and Description |
---|---|
Transaction |
beginTransaction() |
void |
clear() |
long |
countEntitiesOfType(Class<?> entity)
Counts all the node entities of the specified type.
|
<T> void |
delete(T object) |
<T> void |
deleteAll(Class<T> type) |
void |
execute(String jsonStatements) |
void |
execute(String cypher,
Map<String,Object> parameters)
This method allows a cypher statement with a modification statement to be executed.
|
<T> T |
load(Class<T> type,
Long id) |
<T> T |
load(Class<T> type,
Long id,
int depth) |
<T> Collection<T> |
loadAll(Class<T> type) |
<T> Collection<T> |
loadAll(Class<T> type,
Collection<Long> ids) |
<T> Collection<T> |
loadAll(Class<T> type,
Collection<Long> ids,
int depth) |
<T> Collection<T> |
loadAll(Class<T> type,
int depth) |
<T> Collection<T> |
loadAll(Collection<T> objects) |
<T> Collection<T> |
loadAll(Collection<T> objects,
int depth) |
<T> Collection<T> |
loadByProperty(Class<T> type,
Property<String,Object> property) |
<T> Collection<T> |
loadByProperty(Class<T> type,
Property<String,Object> property,
int depth) |
void |
purgeDatabase() |
<T> Iterable<T> |
query(Class<T> objectType,
String cypher,
Map<String,?> parameters)
Given a non modifying cypher statement this method will return a collection of domain objects that is hydrated to
the level specified in the given cypher query or a collection of scalars (depending on the parametrized type).
|
Iterable<Map<String,Object>> |
query(String cypher,
Map<String,?> parameters)
Given a non modifying cypher statement this method will return a collection of Map's which represent Neo4j
objects as properties.
|
<T> T |
queryForObject(Class<T> objectType,
String cypher,
Map<String,?> parameters)
Given a non modifying cypher statement this method will return a domain object that is hydrated to the
level specified in the given cypher query or a scalar (depending on the parametrized type).
|
<T> void |
save(T object) |
<T> void |
save(T object,
int depth) |
<T> Collection<T> loadAll(Class<T> type, Collection<Long> ids)
<T> Collection<T> loadAll(Class<T> type, Collection<Long> ids, int depth)
<T> Collection<T> loadAll(Class<T> type)
<T> Collection<T> loadAll(Class<T> type, int depth)
<T> Collection<T> loadAll(Collection<T> objects)
<T> Collection<T> loadAll(Collection<T> objects, int depth)
<T> Collection<T> loadByProperty(Class<T> type, Property<String,Object> property)
<T> Collection<T> loadByProperty(Class<T> type, Property<String,Object> property, int depth)
void execute(String jsonStatements)
void purgeDatabase()
void clear()
<T> void save(T object)
<T> void save(T object, int depth)
<T> void delete(T object)
<T> void deleteAll(Class<T> type)
Transaction beginTransaction()
<T> T queryForObject(Class<T> objectType, String cypher, Map<String,?> parameters)
T
- A domain object or scalar.objectType
- The type that should be returned from the query.cypher
- The parametrizable cypher to execute.parameters
- Any scalar parameters to attach to the cypher.RuntimeException
- If more than one object is found.<T> Iterable<T> query(Class<T> objectType, String cypher, Map<String,?> parameters)
T
- A domain object or scalar.objectType
- The type that should be returned from the query.cypher
- The parametrizable cypher to execute.parameters
- Any parameters to attach to the cypher.Iterable<Map<String,Object>> query(String cypher, Map<String,?> parameters)
void execute(String cypher, Map<String,Object> parameters)
Parameters may be scalars or domain objects themselves.
cypher
- The parametrisable cypher to execute.parameters
- Any parameters to attach to the cypher. These may be domain objects or scalars. Note that
if a complex domain object is provided only the properties of that object will be set.
If relationships of a provided object also need to be set then the cypher should reflect this
and further domain object parameters provided.Copyright © 2011-2014–2015 Pivotal Software, Inc.. All rights reserved.