|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.modeshape.graph.connector.map.MapRepository
org.modeshape.connector.store.jpa.model.simple.SimpleJpaRepository
public class SimpleJpaRepository
Implementation of MapRepository
for the Simple JPA connector model
. This class exposes a map of
workspace names to workspaces
and each workspace provides a logical mapping of node UUIDs to nodes
. The JpaNode
class functions as an adapter between the persistent entity for nodes
and the
map repository interface for nodes
.
This class differs slightly from the other MapRepository
implementations in that it exists only within the lifetime of
a single EntityManager
(which itself is opened and closed within the lifetime of a single SimpleJpaConnection
.
The other map repository implementations all outlive any particular connection and generally survive for the lifetime of the
ModeShape server.
Nested Class Summary | |
---|---|
protected class |
SimpleJpaRepository.JpaNode
Adapter between the persistent entity for nodes and the map repository interface for
nodes . |
protected class |
SimpleJpaRepository.LargeValueSerializer
|
protected class |
SimpleJpaRepository.Workspace
This class provides a logical mapping of UUIDs to nodes within a named workspace. |
Field Summary | |
---|---|
protected boolean |
compressData
|
protected ExecutionContext |
context
|
protected boolean |
creatingWorkspacesAllowed
|
protected String |
dialect
|
protected javax.persistence.EntityManager |
entityManager
|
protected long |
minimumSizeOfLargeValuesInBytes
|
protected NameFactory |
nameFactory
|
protected Namespaces |
namespaceEntities
|
protected PathFactory |
pathFactory
|
protected Workspaces |
workspaceEntities
|
Fields inherited from class org.modeshape.graph.connector.map.MapRepository |
---|
rootNodeUuid |
Constructor Summary | |
---|---|
SimpleJpaRepository(String sourceName,
UUID rootNodeUuid,
javax.persistence.EntityManager entityManager,
ExecutionContext context,
boolean compressData,
boolean creatingWorkspacesAllowed,
long minimumSizeOfLargeValuesInBytes,
String dialect)
|
|
SimpleJpaRepository(String sourceName,
UUID rootNodeUuid,
String defaultWorkspaceName,
String[] predefinedWorkspaceNames,
javax.persistence.EntityManager entityManager,
ExecutionContext context,
boolean compressData,
boolean creatingWorkspacesAllowed,
long minimumSizeOfLargeValuesInBytes,
String dialect)
|
Method Summary | |
---|---|
protected boolean |
collectGarbage()
Collect and remove all records that are no longer needed in the database. |
protected MapWorkspace |
createWorkspace(ExecutionContext context,
String name)
Creates a new workspace with the given name containing only a root node. |
MapWorkspace |
getWorkspace(String name)
Returns the workspace with the given name |
Set<String> |
getWorkspaceNames()
Returns a list of the names of the currently created workspaces |
MapRepositoryTransaction |
startTransaction(boolean readonly)
Begin a transaction, hinting whether the transaction will be used only to read the content. |
Methods inherited from class org.modeshape.graph.connector.map.MapRepository |
---|
createWorkspace, createWorkspace, destroyWorkspace, getDefaultWorkspaceName, getRootNodeUuid, getSourceName, initialize |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected final javax.persistence.EntityManager entityManager
protected final Workspaces workspaceEntities
protected final Namespaces namespaceEntities
protected final ExecutionContext context
protected final PathFactory pathFactory
protected final NameFactory nameFactory
protected final boolean compressData
protected final boolean creatingWorkspacesAllowed
protected final long minimumSizeOfLargeValuesInBytes
protected final String dialect
Constructor Detail |
---|
public SimpleJpaRepository(String sourceName, UUID rootNodeUuid, String defaultWorkspaceName, String[] predefinedWorkspaceNames, javax.persistence.EntityManager entityManager, ExecutionContext context, boolean compressData, boolean creatingWorkspacesAllowed, long minimumSizeOfLargeValuesInBytes, String dialect)
public SimpleJpaRepository(String sourceName, UUID rootNodeUuid, javax.persistence.EntityManager entityManager, ExecutionContext context, boolean compressData, boolean creatingWorkspacesAllowed, long minimumSizeOfLargeValuesInBytes, String dialect)
Method Detail |
---|
protected MapWorkspace createWorkspace(ExecutionContext context, String name)
MapRepository
This method does NOT automatically add the newly created workspace to the workspace map
or check to
see if a workspace already exists in this repository with the same name.
createWorkspace
in class MapRepository
context
- the context in which the workspace is to be createdname
- the name of the workspace
public MapWorkspace getWorkspace(String name)
MapRepository
getWorkspace
in class MapRepository
name
- the name of the workspace to return
public Set<String> getWorkspaceNames()
MapRepository
getWorkspaceNames
in class MapRepository
public MapRepositoryTransaction startTransaction(boolean readonly)
committed
or
rolled back
.
startTransaction
in class MapRepository
readonly
- true if the transaction will not modify any content, or false if changes are to be made
MapRepository.startTransaction(boolean)
protected boolean collectGarbage()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |