T - public interface Repository<T extends Base>
| Modifier and Type | Method and Description |
|---|---|
de.whitefrog.frogr.persistence.ModelCache |
cache() |
boolean |
contains(T entity) |
T |
createModel(org.neo4j.graphdb.PropertyContainer node)
Create appropriate the model for a neo4j property container.
|
T |
createModel(org.neo4j.graphdb.PropertyContainer node,
FieldList fields)
Create appropriate the model for a neo4j property container and fetch some fields.
|
void |
dispose()
Dispose method, will be called by the owning service on shutdown.
|
T |
fetch(Base model,
boolean refetch,
FieldList fields)
Fetch fields from database for a model.
|
T |
fetch(Base model,
FieldList fields)
Fetch fields from database for a model.
|
T |
fetch(Base model,
String... fields)
Fetch fields from database for a model.
|
T |
find(long id,
String... fields)
Find a entity by ID.
|
T |
findByUuid(String uuid,
String... fields)
Find a entity by UUID
|
Class<?> |
getModelClass()
Get the model class
|
String |
getType()
Get the type name for the model class.
|
org.neo4j.graphdb.GraphDatabaseService |
graph()
Get the database instance associated with the controller
|
void |
initialize() |
de.whitefrog.frogr.persistence.Persistence |
persistence() |
QueryBuilder |
queryBuilder()
Query builder instance to use.
|
String |
queryIdentifier()
Identifier used in queries.
|
T |
refetch(Base model,
FieldList fields)
Fetch fields from database for a model, even if already fetched.
|
T |
refetch(Base model,
String... fields)
Fetch fields from database for a model, even if already fetched.
|
de.whitefrog.frogr.persistence.Relationships |
relationships() |
void |
remove(T model)
Delete a model
|
void |
save(SaveContext<T> context)
Save the model inside the passed SaveContext.
|
void |
save(T... entities)
Save some entities.
|
void |
save(T model)
Save a model
|
Search |
search()
Get a search provider.
|
Service |
service()
Reference to the service the repository is assigned to.
|
void |
sort(List<T> list,
List<SearchParameter.OrderBy> orderBy)
Sort a list like you would in a database call.
|
boolean contains(T entity)
de.whitefrog.frogr.persistence.ModelCache cache()
T createModel(org.neo4j.graphdb.PropertyContainer node)
node - The property container to useT createModel(org.neo4j.graphdb.PropertyContainer node, FieldList fields)
node - The property container to usefields - Field list to fetch from property containervoid dispose()
T fetch(Base model, String... fields)
model - The model to usefields - The fields to fetchT refetch(Base model, String... fields)
model - The model to usefields - The fields to fetchT fetch(Base model, FieldList fields)
model - The model to usefields - The fields to fetch as FieldListT refetch(Base model, FieldList fields)
model - The model to usefields - The fields to fetch as FieldListT fetch(Base model, boolean refetch, FieldList fields)
model - The model to userefetch - If true, fields will be fetched, even if they were already beforefields - The fields to fetch as FieldListT find(long id, String... fields)
id - The id of the entity to look forfields - Fields to fetch, not requiredT findByUuid(String uuid, String... fields)
uuid - The uuid of the entity to look forfields - Fields to fetch, not requiredString getType()
Class<?> getModelClass()
org.neo4j.graphdb.GraphDatabaseService graph()
void initialize()
QueryBuilder queryBuilder()
String queryIdentifier()
void remove(T model)
model - Model to deletevoid save(T model)
model - model to savevoid save(T... entities)
entities - Entities to save.void save(SaveContext<T> context)
context - Must contain the model to saveSearch search()
Service service()
de.whitefrog.frogr.persistence.Persistence persistence()
de.whitefrog.frogr.persistence.Relationships relationships()
void sort(List<T> list, List<SearchParameter.OrderBy> orderBy)
list - List of models to sortorderBy - Sorting conditionsCopyright © 2018. All rights reserved.