public class DatabaseNetwork extends AbstractNetwork
MAX_SIZE, MAX_TEXT
Constructor and Description |
---|
DatabaseNetwork(javax.persistence.EntityManager entityManager,
boolean isShortTerm) |
Modifier and Type | Method and Description |
---|---|
void |
addVertex(Vertex vertex)
Add the existing vertex to the network.
|
java.util.List<Vertex> |
allActive()
Return all active vertices.
|
void |
clear()
Clear all vertices from the network.
|
int |
countAll()
Return all vertices.
|
int |
countAllLike(java.lang.String filter)
Return all vertices matching the filter.
|
int |
executeNativeQuery(java.lang.String sql)
Execute and commit the native query.
|
int |
executeQuery(java.lang.String jpql)
Execute and commit the update query.
|
java.util.List<Vertex> |
findAll()
Return all vertices.
|
java.util.List<Vertex> |
findAll(int pageSize,
int page)
Return all vertices.
|
java.util.List<Vertex> |
findAllInstances(Vertex type,
Vertex relationship,
java.util.Calendar start)
Find all relationships related to the vertex or of the vertex type.
|
java.util.List<Vertex> |
findAllLike(java.lang.String filter)
Return all vertices matching the filter.
|
java.util.List<Vertex> |
findAllLike(java.lang.String filter,
int pageSize,
int page)
Return all vertices matching the filter.
|
java.util.List<Vertex> |
findAllQuery(java.lang.String jpql)
Return all vertices matching the JPQL query.
|
java.util.List<Vertex> |
findAllQuery(java.lang.String jpql,
int max)
Return all vertices matching the JPQL query.
|
java.util.List<Vertex> |
findAllQuery(java.lang.String jpql,
java.util.Map parameters,
int pageSize,
int page)
Return all vertices matching the JPQL query.
|
java.util.List<Relationship> |
findAllRelationshipsTo(Vertex vertex)
Find all relationships related to the vertex or of the vertex relationship type.
|
java.util.List<Relationship> |
findAllRelationshipsTo(Vertex vertex,
Vertex type)
Find all relationships related to the vertex by the vertex type.
|
java.util.List<Relationship> |
findAllRelationshipsTo(Vertex vertex,
Vertex type,
java.util.Date date)
Find all relationships related to the vertex by the vertex type, created after the date.
|
Vertex |
findByData(java.lang.Object data)
Return the vertex with the given data.
|
Vertex |
findById(java.lang.Number id)
Return the vertex with the given name.
|
Vertex |
findByName(java.lang.String name)
Return the vertex with the given data.
|
java.util.List |
findByNativeQuery(java.lang.String sql,
java.lang.Class type,
int max)
Execute the native SQL query.
|
Data |
findData(Data data)
Return the lob data.
|
javax.persistence.criteria.CriteriaBuilder |
getCriteriaBuilder()
Return a query builder.
|
javax.persistence.EntityManager |
getEntityManager() |
Network |
getParent()
Return the parent network.
|
void |
merge(Network network)
Merge the vertices and relations of the network into this network.
|
void |
removeProperty(java.lang.String propertyName)
Remove the property setting to the current transaction.
|
void |
removeRelationship(Relationship relationship)
Remove the relationship from the network.
|
void |
removeVertex(Vertex vertex)
Remove the vertex from the network.
|
void |
removeVertexAndReferences(Vertex vertex)
Remove the vertex and all references to it from the network.
|
void |
resetSize() |
void |
resume()
Resume the network after a save.
|
void |
save()
Commit memory to the database.
|
void |
saveProperty(java.lang.String propertyName,
java.lang.String value,
boolean startup)
Save the property setting to the current transaction.
|
java.util.List |
search(javax.persistence.criteria.CriteriaQuery criteria,
int page,
int max)
Execute the criteria query.
|
void |
setEntityManager(javax.persistence.EntityManager entityManager) |
void |
setHints(javax.persistence.Query query) |
void |
setParent(Network parent)
Set the parent network.
|
int |
size()
Return the total number of vertices stored.
|
associateCaseInsensitivity, associateCaseInsensitivity, checkReduction, clone, createAnonymousSpeaker, createFormula, createFragment, createInstance, createInstance, createMeta, createName, createNewObject, createObject, createParagraph, createParagraph, createPattern, createPattern, createPrimitive, createSentence, createSentence, createSentence, createSentence, createSpeaker, createTemplate, createTemporyVertex, createTimestamp, createUniqueSpeaker, createVertex, createVertex, createVertex, createWord, getBot, getVerticesByData, importMerge, importVertex, isReadOnly, isShortTerm, merge, parseFragment, setBot, setShortTerm, toString
public DatabaseNetwork(javax.persistence.EntityManager entityManager, boolean isShortTerm)
public javax.persistence.EntityManager getEntityManager()
public void setEntityManager(javax.persistence.EntityManager entityManager)
public void resume()
public int executeNativeQuery(java.lang.String sql)
public int executeQuery(java.lang.String jpql)
public void save()
public void resetSize()
public void clear()
Network
public void addVertex(Vertex vertex)
addVertex
in interface Network
addVertex
in class AbstractNetwork
public void saveProperty(java.lang.String propertyName, java.lang.String value, boolean startup)
saveProperty
in interface Network
saveProperty
in class AbstractNetwork
public void removeProperty(java.lang.String propertyName)
removeProperty
in interface Network
removeProperty
in class AbstractNetwork
public Network getParent()
Network
public void setParent(Network parent)
Network
public int size()
Network
public void removeVertex(Vertex vertex)
public void removeVertexAndReferences(Vertex vertex)
public void removeRelationship(Relationship relationship)
removeRelationship
in interface Network
removeRelationship
in class AbstractNetwork
public java.util.List<Vertex> allActive()
public void setHints(javax.persistence.Query query)
public java.util.List<Vertex> findAll()
public java.util.List<Vertex> findAll(int pageSize, int page)
public java.util.List<Vertex> findAllLike(java.lang.String filter)
public java.util.List<Vertex> findAllLike(java.lang.String filter, int pageSize, int page)
public java.util.List<Vertex> findAllQuery(java.lang.String jpql, java.util.Map parameters, int pageSize, int page)
public java.util.List<Vertex> findAllQuery(java.lang.String jpql)
public int countAll()
public int countAllLike(java.lang.String filter)
public java.util.List<Vertex> findAllQuery(java.lang.String jpql, int max)
public java.util.List findByNativeQuery(java.lang.String sql, java.lang.Class type, int max)
public java.util.List<Relationship> findAllRelationshipsTo(Vertex vertex)
public java.util.List<Relationship> findAllRelationshipsTo(Vertex vertex, Vertex type)
public java.util.List<Relationship> findAllRelationshipsTo(Vertex vertex, Vertex type, java.util.Date date)
public javax.persistence.criteria.CriteriaBuilder getCriteriaBuilder()
public java.util.List<Vertex> findAllInstances(Vertex type, Vertex relationship, java.util.Calendar start)
public java.util.List search(javax.persistence.criteria.CriteriaQuery criteria, int page, int max)
public Vertex findByData(java.lang.Object data)
public Vertex findByName(java.lang.String name)
public Vertex findById(java.lang.Number id)
public void merge(Network network)
merge
in interface Network
merge
in class AbstractNetwork