public class Neo4jSession extends Object implements Session
| Constructor and Description |
|---|
Neo4jSession(MetaData metaData,
Driver driver) |
| Modifier and Type | Method and Description |
|---|---|
Transaction |
beginTransaction()
Begin a new transaction.
|
void |
clear() |
MappingContext |
context() |
long |
countEntitiesOfType(Class<?> entity)
Counts all the node entities of the specified type.
|
void |
debug(String msg) |
<T> void |
delete(T object) |
<T> void |
deleteAll(Class<T> type) |
<T> T |
doInTransaction(GraphCallback<T> graphCallback)
Deprecated.
|
String |
entityType(String name) |
void |
error(String msg) |
Transaction |
getTransaction()
Get the existing transaction if available
|
void |
info(String msg) |
<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,
Collection<Long> ids,
Pagination paging) |
<T> Collection<T> |
loadAll(Class<T> type,
Collection<Long> ids,
Pagination paging,
int depth) |
<T> Collection<T> |
loadAll(Class<T> type,
Collection<Long> ids,
SortOrder sortOrder) |
<T> Collection<T> |
loadAll(Class<T> type,
Collection<Long> ids,
SortOrder sortOrder,
int depth) |
<T> Collection<T> |
loadAll(Class<T> type,
Collection<Long> ids,
SortOrder sortOrder,
Pagination pagination) |
<T> Collection<T> |
loadAll(Class<T> type,
Collection<Long> ids,
SortOrder sortOrder,
Pagination pagination,
int depth) |
<T> Collection<T> |
loadAll(Class<T> type,
Filter filter) |
<T> Collection<T> |
loadAll(Class<T> type,
Filter filter,
int depth) |
<T> Collection<T> |
loadAll(Class<T> type,
Filter filter,
Pagination pagination) |
<T> Collection<T> |
loadAll(Class<T> type,
Filter filter,
Pagination pagination,
int depth) |
<T> Collection<T> |
loadAll(Class<T> type,
Filters filters) |
<T> Collection<T> |
loadAll(Class<T> type,
Filters filters,
int depth) |
<T> Collection<T> |
loadAll(Class<T> type,
Filter filter,
SortOrder sortOrder) |
<T> Collection<T> |
loadAll(Class<T> type,
Filter filter,
SortOrder sortOrder,
int depth) |
<T> Collection<T> |
loadAll(Class<T> type,
Filter filter,
SortOrder sortOrder,
Pagination pagination) |
<T> Collection<T> |
loadAll(Class<T> type,
Filter filter,
SortOrder sortOrder,
Pagination pagination,
int depth) |
<T> Collection<T> |
loadAll(Class<T> type,
Filters filters,
Pagination pagination) |
<T> Collection<T> |
loadAll(Class<T> type,
Filters filters,
Pagination pagination,
int depth) |
<T> Collection<T> |
loadAll(Class<T> type,
Filters filters,
SortOrder sortOrder) |
<T> Collection<T> |
loadAll(Class<T> type,
Filters filters,
SortOrder sortOrder,
int depth) |
<T> Collection<T> |
loadAll(Class<T> type,
Filters filters,
SortOrder sortOrder,
Pagination pagination) |
<T> Collection<T> |
loadAll(Class<T> type,
Filters filters,
SortOrder sortOrder,
Pagination pagination,
int depth) |
<T> Collection<T> |
loadAll(Class<T> type,
int depth) |
<T> Collection<T> |
loadAll(Class<T> type,
Pagination paging) |
<T> Collection<T> |
loadAll(Class<T> type,
Pagination paging,
int depth) |
<T> Collection<T> |
loadAll(Class<T> type,
SortOrder sortOrder) |
<T> Collection<T> |
loadAll(Class<T> type,
SortOrder sortOrder,
int depth) |
<T> Collection<T> |
loadAll(Class<T> type,
SortOrder sortOrder,
Pagination pagination) |
<T> Collection<T> |
loadAll(Class<T> type,
SortOrder sortOrder,
Pagination pagination,
int depth) |
<T> Collection<T> |
loadAll(Collection<T> objects) |
<T> Collection<T> |
loadAll(Collection<T> objects,
int depth) |
<T> Collection<T> |
loadAll(Collection<T> objects,
Pagination pagination) |
<T> Collection<T> |
loadAll(Collection<T> objects,
Pagination pagination,
int depth) |
<T> Collection<T> |
loadAll(Collection<T> objects,
SortOrder sortOrder) |
<T> Collection<T> |
loadAll(Collection<T> objects,
SortOrder sortOrder,
int depth) |
<T> Collection<T> |
loadAll(Collection<T> objects,
SortOrder sortOrder,
Pagination pagination) |
<T> Collection<T> |
loadAll(Collection<T> objects,
SortOrder sortOrder,
Pagination pagination,
int depth) |
MetaData |
metaData() |
void |
purgeDatabase() |
<T> Iterable<T> |
query(Class<T> type,
String cypher,
Map<String,?> parameters)
Given a cypher statement this method will return a collection of domain objects that is hydrated to
the default level or a collection of scalars (depending on the parametrized type).
|
Result |
query(String cypher,
Map<String,?> parameters)
Given a cypher statement this method will return a Result object containing a collection of Map's which represent Neo4j
objects as properties, along with query statistics if applicable.
|
Result |
query(String cypher,
Map<String,?> parameters,
boolean readOnly)
Given a cypher statement this method will return a Result object containing a collection of Map's which represent Neo4j
objects as properties, along with query statistics if applicable.
|
<T> T |
queryForObject(Class<T> type,
String cypher,
Map<String,?> parameters)
Given a cypher statement this method will return a domain object that is hydrated to the
default level or a scalar (depending on the parametrized type).
|
QueryStatements |
queryStatementsFor(Class type) |
Request |
requestHandler() |
Long |
resolveGraphIdFor(Object possibleEntity)
Resolve the graph id for a possible entity
|
<T> void |
save(T object) |
<T> void |
save(T object,
int depth) |
void |
setDriver(Driver driver) |
DefaultTransactionManager |
transactionManager() |
void |
warn(String msg) |
public <T> T load(Class<T> type, Long id)
load in interface Capability.LoadOnepublic <T> T load(Class<T> type, Long id, int depth)
load in interface Capability.LoadOnepublic <T> Collection<T> loadAll(Class<T> type)
loadAll in interface Capability.LoadByTypepublic <T> Collection<T> loadAll(Class<T> type, int depth)
loadAll in interface Capability.LoadByTypepublic <T> Collection<T> loadAll(Class<T> type, Pagination paging)
loadAll in interface Capability.LoadByTypepublic <T> Collection<T> loadAll(Class<T> type, Pagination paging, int depth)
loadAll in interface Capability.LoadByTypepublic <T> Collection<T> loadAll(Class<T> type, SortOrder sortOrder)
loadAll in interface Capability.LoadByTypepublic <T> Collection<T> loadAll(Class<T> type, SortOrder sortOrder, int depth)
loadAll in interface Capability.LoadByTypepublic <T> Collection<T> loadAll(Class<T> type, SortOrder sortOrder, Pagination pagination)
loadAll in interface Capability.LoadByTypepublic <T> Collection<T> loadAll(Class<T> type, SortOrder sortOrder, Pagination pagination, int depth)
loadAll in interface Capability.LoadByTypepublic <T> Collection<T> loadAll(Class<T> type, Filter filter)
loadAll in interface Capability.LoadByTypepublic <T> Collection<T> loadAll(Class<T> type, Filter filter, int depth)
loadAll in interface Capability.LoadByTypepublic <T> Collection<T> loadAll(Class<T> type, Filter filter, SortOrder sortOrder)
loadAll in interface Capability.LoadByTypepublic <T> Collection<T> loadAll(Class<T> type, Filter filter, SortOrder sortOrder, int depth)
loadAll in interface Capability.LoadByTypepublic <T> Collection<T> loadAll(Class<T> type, Filter filter, Pagination pagination)
loadAll in interface Capability.LoadByTypepublic <T> Collection<T> loadAll(Class<T> type, Filter filter, Pagination pagination, int depth)
loadAll in interface Capability.LoadByTypepublic <T> Collection<T> loadAll(Class<T> type, Filter filter, SortOrder sortOrder, Pagination pagination)
loadAll in interface Capability.LoadByTypepublic <T> Collection<T> loadAll(Class<T> type, Filter filter, SortOrder sortOrder, Pagination pagination, int depth)
loadAll in interface Capability.LoadByTypepublic <T> Collection<T> loadAll(Class<T> type, Filters filters)
loadAll in interface Capability.LoadByTypepublic <T> Collection<T> loadAll(Class<T> type, Filters filters, int depth)
loadAll in interface Capability.LoadByTypepublic <T> Collection<T> loadAll(Class<T> type, Filters filters, SortOrder sortOrder)
loadAll in interface Capability.LoadByTypepublic <T> Collection<T> loadAll(Class<T> type, Filters filters, SortOrder sortOrder, int depth)
loadAll in interface Capability.LoadByTypepublic <T> Collection<T> loadAll(Class<T> type, Filters filters, Pagination pagination)
loadAll in interface Capability.LoadByTypepublic <T> Collection<T> loadAll(Class<T> type, Filters filters, Pagination pagination, int depth)
loadAll in interface Capability.LoadByTypepublic <T> Collection<T> loadAll(Class<T> type, Filters filters, SortOrder sortOrder, Pagination pagination)
loadAll in interface Capability.LoadByTypepublic <T> Collection<T> loadAll(Class<T> type, Filters filters, SortOrder sortOrder, Pagination pagination, int depth)
loadAll in interface Capability.LoadByTypepublic <T> Collection<T> loadAll(Class<T> type, Collection<Long> ids)
loadAll in interface Capability.LoadByIdspublic <T> Collection<T> loadAll(Class<T> type, Collection<Long> ids, int depth)
loadAll in interface Capability.LoadByIdspublic <T> Collection<T> loadAll(Class<T> type, Collection<Long> ids, SortOrder sortOrder)
loadAll in interface Capability.LoadByIdspublic <T> Collection<T> loadAll(Class<T> type, Collection<Long> ids, SortOrder sortOrder, int depth)
loadAll in interface Capability.LoadByIdspublic <T> Collection<T> loadAll(Class<T> type, Collection<Long> ids, Pagination paging)
loadAll in interface Capability.LoadByIdspublic <T> Collection<T> loadAll(Class<T> type, Collection<Long> ids, Pagination paging, int depth)
loadAll in interface Capability.LoadByIdspublic <T> Collection<T> loadAll(Class<T> type, Collection<Long> ids, SortOrder sortOrder, Pagination pagination)
loadAll in interface Capability.LoadByIdspublic <T> Collection<T> loadAll(Class<T> type, Collection<Long> ids, SortOrder sortOrder, Pagination pagination, int depth)
loadAll in interface Capability.LoadByIdspublic <T> Collection<T> loadAll(Collection<T> objects)
loadAll in interface Capability.LoadByInstancespublic <T> Collection<T> loadAll(Collection<T> objects, int depth)
loadAll in interface Capability.LoadByInstancespublic <T> Collection<T> loadAll(Collection<T> objects, SortOrder sortOrder)
loadAll in interface Capability.LoadByInstancespublic <T> Collection<T> loadAll(Collection<T> objects, SortOrder sortOrder, int depth)
loadAll in interface Capability.LoadByInstancespublic <T> Collection<T> loadAll(Collection<T> objects, Pagination pagination)
loadAll in interface Capability.LoadByInstancespublic <T> Collection<T> loadAll(Collection<T> objects, Pagination pagination, int depth)
loadAll in interface Capability.LoadByInstancespublic <T> Collection<T> loadAll(Collection<T> objects, SortOrder sortOrder, Pagination pagination)
loadAll in interface Capability.LoadByInstancespublic <T> Collection<T> loadAll(Collection<T> objects, SortOrder sortOrder, Pagination pagination, int depth)
loadAll in interface Capability.LoadByInstancespublic <T> T queryForObject(Class<T> type, String cypher, Map<String,?> parameters)
Capability.ExecuteQueriesqueryForObject in interface Capability.ExecuteQueriesT - A domain object or scalar.type - The type that should be returned from the query.cypher - The parametrizable cypher to execute.parameters - Any scalar parameters to attach to the cypher.public Result query(String cypher, Map<String,?> parameters)
Capability.ExecuteQueriesquery in interface Capability.ExecuteQueriescypher - The parametrisable cypher to execute.parameters - Any parameters to attach to the cypher.Result containing an Iterable map representing query results and QueryStatistics if applicable.public Result query(String cypher, Map<String,?> parameters, boolean readOnly)
Capability.ExecuteQueriesquery in interface Capability.ExecuteQueriescypher - The parametrisable cypher to execute.parameters - Any parameters to attach to the cypher.readOnly - true if the query is readOnly, false otherwiseResult of Iterables with each entry representing a neo4j object's properties.public <T> Iterable<T> query(Class<T> type, String cypher, Map<String,?> parameters)
Capability.ExecuteQueriesquery in interface Capability.ExecuteQueriesT - A domain object or scalar.type - The type that should be returned from the query.cypher - The parametrizable cypher to execute.parameters - Any parameters to attach to the cypher.public long countEntitiesOfType(Class<?> entity)
Capability.ExecuteQueriescountEntitiesOfType in interface Capability.ExecuteQueriesentity - The Class denoting the type of entity to countpublic void purgeDatabase()
purgeDatabase in interface Capability.Deletepublic void clear()
clear in interface Capability.Deletepublic <T> void delete(T object)
delete in interface Capability.Deletepublic <T> void deleteAll(Class<T> type)
deleteAll in interface Capability.Deletepublic <T> void save(T object)
save in interface Capability.Savepublic <T> void save(T object,
int depth)
save in interface Capability.Savepublic Transaction beginTransaction()
Capability.TransactionsbeginTransaction in interface Capability.Transactions@Deprecated public <T> T doInTransaction(GraphCallback<T> graphCallback)
Capability.TransactionsGraphCallback in the scope of this Session, giving fine-grained control over
behaviour.doInTransaction in interface Capability.TransactionsT - The type of object returned from applying this callbackgraphCallback - The GraphCallback to executeGraphCallbackpublic Transaction getTransaction()
Capability.TransactionsgetTransaction in interface Capability.Transactionspublic Long resolveGraphIdFor(Object possibleEntity)
Capability.GraphIdresolveGraphIdFor in interface Capability.GraphIdpossibleEntity - the possible entityCapability.GraphId or null if either the object is not an entity or the id is null.public QueryStatements queryStatementsFor(Class type)
public MappingContext context()
public MetaData metaData()
public void setDriver(Driver driver)
public Request requestHandler()
public DefaultTransactionManager transactionManager()
public void info(String msg)
public void warn(String msg)
public void debug(String msg)
public void error(String msg)
Copyright © 2016 Neo Technology, Inc.. All rights reserved.