|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.jboss.dna.connector.store.jpa.Model org.jboss.dna.connector.store.jpa.model.basic.BasicModel
public class BasicModel
Database model that stores node properties as opaque records and children as transparent records. Large property values are stored separately.
The set of tables used in this model includes:
This database model contains two tables that are used in an efficient mechanism to find all of the nodes in the subgraph below a certain node. This process starts by creating a record for the subgraph query, and then proceeds by executing a join to find all the children of the top-level node, and inserting them into the database (in a working area associated with the subgraph query). Then, another join finds all the children of those children and inserts them into the same working area. This continues until the maximum depth has been reached, or until there are no more children (whichever comes first). All of the nodes in the subgraph are then represented by records in the working area, and can be used to quickly and efficient work with the subgraph nodes. When finished, the mechanism deletes the records in the working area associated with the subgraph query.
This subgraph query mechanism is extremely efficient, performing one join/insert statement per level of the subgraph, and is completely independent of the number of nodes in the subgraph. For example, consider a subgraph of node A, where A has 10 children, and each child contains 10 children, and each grandchild contains 10 children. This subgraph has a total of 1111 nodes (1 root + 10 children + 10*10 grandchildren + 10*10*10 great-grandchildren). Finding the nodes in this subgraph would normally require 1 query per node (in other words, 1111 queries). But with this subgraph query mechanism, all of the nodes in the subgraph can be found with 1 insert plus 4 additional join/inserts.
This mechanism has the added benefit that the set of nodes in the subgraph are kept in a working area in the database, meaning they don't have to be pulled into memory.
Subgraph queries are used to efficiently process a number of different requests, including ReadBranchRequest
,
DeleteBranchRequest
, MoveBranchRequest
, and CopyBranchRequest
. Processing each of these kinds of
requests requires knowledge of the subgraph, and in fact all but the ReadBranchRequest
need to know the complete
subgraph.
Constructor Summary | |
---|---|
BasicModel()
|
Method Summary | |
---|---|
void |
configure(org.hibernate.ejb.Ejb3Configuration configurator)
Configure the entity class that will be used by JPA to store information in the database. |
RequestProcessor |
createRequestProcessor(String sourceName,
ExecutionContext context,
javax.persistence.EntityManager entityManager,
UUID rootNodeUuid,
String nameOfDefaultWorkspace,
String[] predefinedWorkspaceNames,
long largeValueMinimumSizeInBytes,
boolean creatingWorkspacesAllowed,
boolean compressData,
boolean enforceReferentialIntegrity)
|
Methods inherited from class org.jboss.dna.connector.store.jpa.Model |
---|
equals, getDescription, getDescription, getName, hashCode, toString |
Methods inherited from class java.lang.Object |
---|
getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public BasicModel()
Method Detail |
---|
public RequestProcessor createRequestProcessor(String sourceName, ExecutionContext context, javax.persistence.EntityManager entityManager, UUID rootNodeUuid, String nameOfDefaultWorkspace, String[] predefinedWorkspaceNames, long largeValueMinimumSizeInBytes, boolean creatingWorkspacesAllowed, boolean compressData, boolean enforceReferentialIntegrity)
createRequestProcessor
in class Model
Model.createRequestProcessor(String, ExecutionContext, EntityManager, UUID, String,
String[], long, boolean, boolean, boolean)
public void configure(org.hibernate.ejb.Ejb3Configuration configurator)
configure
in class Model
configurator
- the Hibernate Ejb3Configuration
component; never null
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |