|
Nuxeo Enterprise Platform 5.4 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.nuxeo.ecm.core.storage.sql.jdbc.JDBCConnection org.nuxeo.ecm.core.storage.sql.jdbc.JDBCRowMapper
public class JDBCRowMapper
A JDBCRowMapper
maps Row
s to and from a JDBC database.
Nested Class Summary |
---|
Nested classes/interfaces inherited from interface org.nuxeo.ecm.core.storage.sql.RowMapper |
---|
RowMapper.CopyHierarchyResult, RowMapper.RowBatch, RowMapper.RowUpdate |
Field Summary |
---|
Fields inherited from class org.nuxeo.ecm.core.storage.sql.jdbc.JDBCConnection |
---|
connection, logger |
Constructor Summary | |
---|---|
JDBCRowMapper(Model model,
SQLInfo sqlInfo,
javax.sql.XADataSource xadatasource,
ClusterNodeHandler clusterNodeHandler)
|
Method Summary | |
---|---|
void |
clearCache()
Clears the mapper's cache (if any) Called after a rollback, or a manual clear through RepositoryStatus MBean. |
RowMapper.CopyHierarchyResult |
copyHierarchy(java.io.Serializable sourceId,
java.lang.String typeName,
java.io.Serializable destParentId,
java.lang.String destName,
Row overwriteRow)
Copies the hierarchy starting from a given row to a new parent with a new name. |
java.util.List<Row> |
getProxyRows(java.io.Serializable searchId,
boolean byTarget,
java.io.Serializable parentId)
Finds proxies, maybe restricted to the children of a given parent. |
java.util.List<Row> |
getVersionRows(java.io.Serializable versionSeriesId)
Gets the list of version rows for all the versions in a given version series id. |
java.util.List<? extends RowId> |
read(java.util.Collection<RowId> rowIds)
Reads a set of rows for the given RowId s. |
Row |
readChildHierRow(java.io.Serializable parentId,
java.lang.String childName,
boolean complexProp)
Reads the hierarchy row for a child, given its parent id and the child name. |
java.util.List<Row> |
readChildHierRows(java.io.Serializable parentId,
boolean complexProp)
Reads the hierarchy rows for all the children of parent. |
java.io.Serializable[] |
readCollectionRowArray(RowId rowId)
Gets an array for a CollectionFragment from the database, given
its table name and id. |
Row |
readSimpleRow(RowId rowId)
Gets a row for a SimpleFragment from the database, given its
table name and id. |
Invalidations.InvalidationsPair |
receiveInvalidations()
Processes and returns the invalidations queued for processing by the cache (if any). |
void |
rollback(javax.transaction.xa.Xid xid)
Rollback the XA Resource. |
void |
sendInvalidations(Invalidations invalidations)
Post-transaction invalidations notification. |
void |
write(RowMapper.RowBatch batch)
Writes a set of rows. |
Methods inherited from class org.nuxeo.ecm.core.storage.sql.jdbc.JDBCConnection |
---|
close, getIdentification |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public JDBCRowMapper(Model model, SQLInfo sqlInfo, javax.sql.XADataSource xadatasource, ClusterNodeHandler clusterNodeHandler) throws StorageException
StorageException
Method Detail |
---|
public Invalidations.InvalidationsPair receiveInvalidations() throws StorageException
RowMapper
Called pre-transaction by session start or transactionless save;
receiveInvalidations
in interface RowMapper
null
StorageException
public void sendInvalidations(Invalidations invalidations) throws StorageException
RowMapper
Called post-transaction by session commit/rollback or transactionless save.
sendInvalidations
in interface RowMapper
invalidations
- the known invalidations to send to others, or
null
StorageException
public void clearCache()
RowMapper
Called after a rollback, or a manual clear through RepositoryStatus MBean.
clearCache
in interface RowMapper
public void rollback(javax.transaction.xa.Xid xid) throws javax.transaction.xa.XAException
RowMapper
This is in the RowMapper
interface because on rollback the cache
must be invalidated.
rollback
in interface RowMapper
javax.transaction.xa.XAException
public java.util.List<? extends RowId> read(java.util.Collection<RowId> rowIds) throws StorageException
RowMapper
RowId
s.
For each requested row, either a Row
is found and returned, or a
RowId
(not implementing Row
) is returned to signify an
absent row.
read
in interface RowMapper
rowIds
- the row ids (including their table name)
Row
s (or RowId
s if the row was
absent from the database). Order is not the same as the input
rowIds
StorageException
public void write(RowMapper.RowBatch batch) throws StorageException
RowMapper
write
in interface RowMapper
batch
- the set of rows and the operations to do on them
StorageException
public Row readSimpleRow(RowId rowId) throws StorageException
RowMapper
SimpleFragment
from the database, given its
table name and id. If the row doesn't exist, null
is returned.
readSimpleRow
in interface RowMapper
rowId
- the row id
null
StorageException
public java.io.Serializable[] readCollectionRowArray(RowId rowId) throws StorageException
RowMapper
CollectionFragment
from the database, given
its table name and id. If no rows are found, an empty array is returned.
readCollectionRowArray
in interface RowMapper
rowId
- the row id
StorageException
public Row readChildHierRow(java.io.Serializable parentId, java.lang.String childName, boolean complexProp) throws StorageException
RowMapper
readChildHierRow
in interface RowMapper
parentId
- the parent idchildName
- the child namecomplexProp
- whether to get complex properties (true
) or
regular children(false
)
null
StorageException
public java.util.List<Row> readChildHierRows(java.io.Serializable parentId, boolean complexProp) throws StorageException
RowMapper
Depending on the boolean complexProp, only the complex properties or only the regular children are returned.
readChildHierRows
in interface RowMapper
parentId
- the parent idcomplexProp
- whether to get complex properties (true
) or
regular children(false
)
StorageException
public java.util.List<Row> getVersionRows(java.io.Serializable versionSeriesId) throws StorageException
RowMapper
getVersionRows
in interface RowMapper
versionSeriesId
- the version series id
StorageException
public java.util.List<Row> getProxyRows(java.io.Serializable searchId, boolean byTarget, java.io.Serializable parentId) throws StorageException
RowMapper
getProxyRows
in interface RowMapper
searchId
- the id to look forbyTarget
- true
if the searchId is a proxy target id,
false
if the searchId is a version series idparentId
- the parent to which to restrict, if not null
StorageException
public RowMapper.CopyHierarchyResult copyHierarchy(java.io.Serializable sourceId, java.lang.String typeName, java.io.Serializable destParentId, java.lang.String destName, Row overwriteRow) throws StorageException
RowMapper
If the new parent is null
, then this is a version creation, which
doesn't recurse in regular children.
If overwriteRow
is passed, the copy is done onto this existing
node as its root (version restore) instead of creating a new node in the
parent.
copyHierarchy
in interface RowMapper
sourceId
- the id of row to copy (with children)typeName
- the type of the row to copy (to avoid refetching known
info)destParentId
- the new parent id, or null
destName
- the new nameoverwriteRow
- when not null
, the copy is done onto this
existing row, and the values are set in hierarchy
StorageException
|
Nuxeo Enterprise Platform 5.4 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |