|
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 org.nuxeo.ecm.core.storage.sql.jdbc.JDBCMapper
public class JDBCMapper
A JDBCMapper
maps objects to and from a JDBC database. It is specific
to a given database connection, as it computes statements.
The JDBCMapper
does the mapping according to the policy defined by a
Model
, and generates SQL statements recorded in the SQLInfo
.
Nested Class Summary |
---|
Nested classes/interfaces inherited from interface org.nuxeo.ecm.core.storage.sql.Mapper |
---|
Mapper.Identification |
Nested classes/interfaces inherited from interface org.nuxeo.ecm.core.storage.sql.RowMapper |
---|
RowMapper.CopyHierarchyResult, RowMapper.RowBatch, RowMapper.RowUpdate |
Field Summary | |
---|---|
static java.lang.String |
TEST_UPGRADE
|
static java.lang.String |
TEST_UPGRADE_VERSIONS
|
static java.util.Map<java.lang.String,java.io.Serializable> |
testProps
|
Fields inherited from class org.nuxeo.ecm.core.storage.sql.jdbc.JDBCConnection |
---|
connection, logger |
Fields inherited from interface org.nuxeo.ecm.core.storage.sql.Mapper |
---|
CLOSE, GET_IDENTIFICATION |
Fields inherited from interface javax.transaction.xa.XAResource |
---|
TMENDRSCAN, TMFAIL, TMJOIN, TMNOFLAGS, TMONEPHASE, TMRESUME, TMSTARTRSCAN, TMSUCCESS, TMSUSPEND, XA_OK, XA_RDONLY |
Constructor Summary | |
---|---|
JDBCMapper(Model model,
Session.PathResolver pathResolver,
SQLInfo sqlInfo,
javax.sql.XADataSource xadatasource,
ClusterNodeHandler clusterNodeHandler)
Creates a new Mapper. |
Method Summary | |
---|---|
void |
commit(javax.transaction.xa.Xid xid,
boolean onePhase)
|
void |
createClusterNode()
Informs the cluster that this node exists. |
void |
createDatabase()
Creates the necessary structures in the database. |
void |
end(javax.transaction.xa.Xid xid,
int flags)
|
void |
forget(javax.transaction.xa.Xid xid)
|
Invalidations |
getClusterInvalidations()
Gets the invalidations from other cluster nodes. |
java.io.Serializable |
getLastVersionId(java.io.Serializable versionSeriesId)
Gets the id of the last version given a version series id. |
java.io.Serializable |
getRootId(java.io.Serializable repositoryId)
Gets the root id for a given repository, if registered. |
int |
getTableSize(java.lang.String tableName)
|
int |
getTransactionTimeout()
|
java.io.Serializable |
getVersionIdByLabel(java.io.Serializable versionSeriesId,
java.lang.String label)
Gets the id of a version given a version series id and a label. |
void |
insertClusterInvalidations(Invalidations invalidations)
Inserts the invalidation rows for the other cluster nodes. |
boolean |
isSameRM(javax.transaction.xa.XAResource xares)
|
int |
prepare(javax.transaction.xa.Xid xid)
|
PartialList<java.io.Serializable> |
query(java.lang.String query,
QueryFilter queryFilter,
boolean countTotal)
Makes a NXQL query to the database. |
IterableQueryResult |
queryAndFetch(java.lang.String query,
java.lang.String queryType,
QueryFilter queryFilter,
java.lang.Object... params)
Makes a query to the database and returns an iterable (which must be closed when done). |
void |
rebuildReadAcls()
|
javax.transaction.xa.Xid[] |
recover(int flag)
|
void |
removeClusterNode()
Removes this node from the cluster. |
void |
setRootId(java.io.Serializable repositoryId,
java.io.Serializable id)
Records the newly generated root id for a given repository. |
boolean |
setTransactionTimeout(int seconds)
|
void |
start(javax.transaction.xa.Xid xid,
int flags)
|
void |
updateReadAcls()
|
Methods inherited from class org.nuxeo.ecm.core.storage.sql.jdbc.JDBCRowMapper |
---|
clearCache, copyHierarchy, getProxyRows, getVersionRows, read, readChildHierRow, readChildHierRows, readCollectionRowArray, readSimpleRow, receiveInvalidations, rollback, sendInvalidations, write |
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 |
Methods inherited from interface org.nuxeo.ecm.core.storage.sql.Mapper |
---|
close, getIdentification |
Methods inherited from interface org.nuxeo.ecm.core.storage.sql.RowMapper |
---|
clearCache, copyHierarchy, getProxyRows, getVersionRows, read, readChildHierRow, readChildHierRows, readCollectionRowArray, readSimpleRow, receiveInvalidations, rollback, sendInvalidations, write |
Methods inherited from interface javax.transaction.xa.XAResource |
---|
rollback |
Field Detail |
---|
public static java.util.Map<java.lang.String,java.io.Serializable> testProps
public static final java.lang.String TEST_UPGRADE
public static final java.lang.String TEST_UPGRADE_VERSIONS
Constructor Detail |
---|
public JDBCMapper(Model model, Session.PathResolver pathResolver, SQLInfo sqlInfo, javax.sql.XADataSource xadatasource, ClusterNodeHandler clusterNodeHandler) throws StorageException
model
- the modelpathResolver
- the path resolver (used for startswith queries)sqlInfo
- the sql infoxadatasource
- the XA datasource to use to get connectionsclusterNodeHandler
- the cluster node handler
StorageException
Method Detail |
---|
public int getTableSize(java.lang.String tableName)
getTableSize
in interface Mapper
public void createDatabase() throws StorageException
Mapper
createDatabase
in interface Mapper
StorageException
public void createClusterNode() throws StorageException
Mapper
createClusterNode
in interface Mapper
StorageException
public void removeClusterNode() throws StorageException
Mapper
removeClusterNode
in interface Mapper
StorageException
public void insertClusterInvalidations(Invalidations invalidations) throws StorageException
Mapper
insertClusterInvalidations
in interface Mapper
StorageException
public Invalidations getClusterInvalidations() throws StorageException
Mapper
getClusterInvalidations
in interface Mapper
StorageException
public java.io.Serializable getRootId(java.io.Serializable repositoryId) throws StorageException
Mapper
getRootId
in interface Mapper
repositoryId
- the repository id, usually 0
StorageException
public void setRootId(java.io.Serializable repositoryId, java.io.Serializable id) throws StorageException
Mapper
setRootId
in interface Mapper
repositoryId
- the repository id, usually 0id
- the root id
StorageException
public java.io.Serializable getVersionIdByLabel(java.io.Serializable versionSeriesId, java.lang.String label) throws StorageException
Mapper
getVersionIdByLabel
in interface Mapper
versionSeriesId
- the version series idlabel
- the label
null
if not found
StorageException
public java.io.Serializable getLastVersionId(java.io.Serializable versionSeriesId) throws StorageException
Mapper
getLastVersionId
in interface Mapper
versionSeriesId
- the version series id
null
if not found
StorageException
public PartialList<java.io.Serializable> query(java.lang.String query, QueryFilter queryFilter, boolean countTotal) throws StorageException
Mapper
query
in interface Mapper
query
- the queryqueryFilter
- the query filtercountTotal
- if true
, count the total size without
limit/offset
StorageException
public IterableQueryResult queryAndFetch(java.lang.String query, java.lang.String queryType, QueryFilter queryFilter, java.lang.Object... params) throws StorageException
Mapper
queryAndFetch
in interface Mapper
query
- the queryqueryType
- the query typequeryFilter
- the query filterparams
- optional query-type-dependent parameters
StorageException
public void updateReadAcls() throws StorageException
updateReadAcls
in interface Mapper
StorageException
public void rebuildReadAcls() throws StorageException
rebuildReadAcls
in interface Mapper
StorageException
public void start(javax.transaction.xa.Xid xid, int flags) throws javax.transaction.xa.XAException
start
in interface javax.transaction.xa.XAResource
javax.transaction.xa.XAException
public void end(javax.transaction.xa.Xid xid, int flags) throws javax.transaction.xa.XAException
end
in interface javax.transaction.xa.XAResource
javax.transaction.xa.XAException
public int prepare(javax.transaction.xa.Xid xid) throws javax.transaction.xa.XAException
prepare
in interface javax.transaction.xa.XAResource
javax.transaction.xa.XAException
public void commit(javax.transaction.xa.Xid xid, boolean onePhase) throws javax.transaction.xa.XAException
commit
in interface javax.transaction.xa.XAResource
javax.transaction.xa.XAException
public void forget(javax.transaction.xa.Xid xid) throws javax.transaction.xa.XAException
forget
in interface javax.transaction.xa.XAResource
javax.transaction.xa.XAException
public javax.transaction.xa.Xid[] recover(int flag) throws javax.transaction.xa.XAException
recover
in interface javax.transaction.xa.XAResource
javax.transaction.xa.XAException
public boolean setTransactionTimeout(int seconds) throws javax.transaction.xa.XAException
setTransactionTimeout
in interface javax.transaction.xa.XAResource
javax.transaction.xa.XAException
public int getTransactionTimeout() throws javax.transaction.xa.XAException
getTransactionTimeout
in interface javax.transaction.xa.XAResource
javax.transaction.xa.XAException
public boolean isSameRM(javax.transaction.xa.XAResource xares) throws javax.transaction.xa.XAException
isSameRM
in interface javax.transaction.xa.XAResource
javax.transaction.xa.XAException
|
Nuxeo Enterprise Platform 5.4 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |