Package com.xpn.xwiki.store
Class XWikiHibernateBaseStore
- java.lang.Object
-
- com.xpn.xwiki.internal.store.AbstractXWikiStore
-
- com.xpn.xwiki.store.XWikiHibernateBaseStore
-
- Direct Known Subclasses:
HibernateAttachmentRecycleBinStore
,HibernateAttachmentVersioningStore
,XWikiHibernateAttachmentStore
,XWikiHibernateRecycleBinStore
,XWikiHibernateStore
,XWikiHibernateVersioningStore
public class XWikiHibernateBaseStore extends com.xpn.xwiki.internal.store.AbstractXWikiStore
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interface
XWikiHibernateBaseStore.HibernateCallback<T>
Callback (closure) interface for operations in Hibernate.
-
Field Summary
Fields Modifier and Type Field Description protected com.xpn.xwiki.internal.store.hibernate.HibernateConfiguration
hibernateConfiguration
static String
HINT
The role hint of this component.protected org.xwiki.logging.LoggerManager
loggerManager
LoggerManager to suspend logging during normal faulty SQL operation.protected com.xpn.xwiki.internal.store.hibernate.HibernateStore
store
-
Constructor Summary
Constructors Constructor Description XWikiHibernateBaseStore()
Empty constructor needed for component manager.XWikiHibernateBaseStore(XWiki xwiki, XWikiContext context)
Deprecated.1.6M1.XWikiHibernateBaseStore(String hibpath)
Deprecated.1.6M1.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description boolean
beginTransaction(boolean withTransaction, XWikiContext context)
Deprecated.since 4.0M1, usebeginTransaction(SessionFactory, XWikiContext)
boolean
beginTransaction(XWikiContext context)
Begins a transaction if the context does not contains any.boolean
beginTransaction(org.hibernate.SessionFactory sfactory, boolean withTransaction, XWikiContext context)
Deprecated.since 4.0M1, usebeginTransaction(SessionFactory, XWikiContext)
boolean
beginTransaction(org.hibernate.SessionFactory sfactory, XWikiContext inputxcontext)
Begins a transaction with a specific SessionFactory.void
checkHibernate(XWikiContext context)
Initializes Hibernate.void
cleanUp(XWikiContext inputxcontext)
Cleanup all sessions Used at the shutdown timeprotected void
createHibernateSequenceIfRequired(String[] schemaSQL, String schemaName, org.hibernate.Session session)
Deprecated.since 11.5RC1String
dynamicMappingTableName(String className)
Return the name generated for a dynamic mapped object.void
endTransaction(XWikiContext inputxcontext, boolean commit)
Ends a transaction and close the session.void
endTransaction(XWikiContext context, boolean commit, boolean withTransaction)
Deprecated.since 4.0M1, useendTransaction(XWikiContext, boolean)
protected String
escapeSchema(String schema, XWikiContext context)
Escape schema name depending of the database engine.<T> T
execute(XWikiContext context, boolean bTransaction, boolean doCommit, XWikiHibernateBaseStore.HibernateCallback<T> cb)
Deprecated.<T> T
execute(XWikiContext inputxcontext, boolean doCommit, XWikiHibernateBaseStore.HibernateCallback<T> cb)
Execute method for operations in Hibernate.<T> T
executeRead(XWikiContext context, boolean bTransaction, XWikiHibernateBaseStore.HibernateCallback<T> cb)
Deprecated.<T> T
executeRead(XWikiContext context, XWikiHibernateBaseStore.HibernateCallback<T> cb)
Execute method for read-only operations in hibernate.<T> T
executeWrite(XWikiContext context, boolean bTransaction, XWikiHibernateBaseStore.HibernateCallback<T> cb)
Deprecated.<T> T
executeWrite(XWikiContext context, XWikiHibernateBaseStore.HibernateCallback<T> cb)
Execute method for read-write operations in Hibernate.<T> T
failSafeExecute(XWikiContext inputxcontext, boolean doCommit, XWikiHibernateBaseStore.HibernateCallback<T> cb)
Execute method for operations in hibernate in an independent session (but not closing the current one if any).<T> T
failSafeExecuteRead(XWikiContext context, XWikiHibernateBaseStore.HibernateCallback<T> cb)
Execute hibernate read-only operation in a independent session (but not closing the current one if any).<T> T
failSafeExecuteWrite(XWikiContext context, XWikiHibernateBaseStore.HibernateCallback<T> cb)
Execute hibernate read-only operation in a independent session (but not closing the current one if any).org.hibernate.cfg.Configuration
getConfiguration()
Map<String,String>
getConnections()
Deprecated.since 9.9RC1DatabaseMetaData
getDatabaseMetaData()
Retrieve metadata about the database used (name, version, etc).DatabaseProduct
getDatabaseProductName()
Retrieve the current database product name.DatabaseProduct
getDatabaseProductName(XWikiContext context)
Deprecated.since 4.0M1 usegetDatabaseProductName()
org.hibernate.dialect.Dialect
getDialect()
protected org.xwiki.context.Execution
getExecution()
We had to add this method because the Component Manager doesn't inject a field in the base class if a derived class defines a field with the same name.String
getHint()
protected org.hibernate.cfg.Configuration
getMapping(String className, String customMapping)
Deprecated.since 11.5RC1org.hibernate.boot.Metadata
getMetadata()
int
getNbConnections()
Deprecated.since 9.9RC1String
getPath()
Allows to get the current hibernate config file pathString
getSchemaFromWikiName(XWikiContext context)
Convert context's database in real database/schema name.protected String
getSchemaFromWikiName(String wikiName, DatabaseProduct databaseProduct, XWikiContext inputxcontext)
Convert wiki name in database/schema name.protected String
getSchemaFromWikiName(String wikiId, XWikiContext inputxcontext)
Convert wiki name in database/schema name.String[]
getSchemaUpdateScript(org.hibernate.cfg.Configuration config, XWikiContext inputxcontext)
Deprecated.do nothing since 11.5RC1org.hibernate.Session
getSession(XWikiContext inputxcontext)
This get's the current session.org.hibernate.SessionFactory
getSessionFactory()
org.hibernate.Transaction
getTransaction(XWikiContext inputxcontext)
Allows to get the current transaction from the context This is set in beginTransactionprotected boolean
isInSchemaMode()
protected boolean
isVirtual(XWikiContext context)
Deprecated.Virtual mode is on by default, starting with XWiki 5.0M2.protected String
makeMapping(String className, String customMapping)
Build a new XML string to define the provided mapping.void
setDatabase(org.hibernate.Session session, XWikiContext inputxcontext)
Virtual Wikis Allows to switch database connectionvoid
setNbConnections(int nbConnections)
Deprecated.since 9.9RC1void
setPath(String hibpath)
Allows to set the current hibernate config file pathvoid
setSession(org.hibernate.Session session, XWikiContext inputxcontext)
Allows to set the current session in the context This is set in beginTransactionvoid
setSessionFactory(org.hibernate.SessionFactory sessionFactory)
Deprecated.does not do anything since 11.5RC1void
setTransaction(org.hibernate.Transaction transaction, XWikiContext inputxcontext)
Allows to set the current transaction This is set in beginTransactionvoid
shutdownHibernate(XWikiContext inputxcontext)
Deprecated.automatically done when theHibernateSessionFactory
component is disposedvoid
updateSchema(BaseClass bclass, XWikiContext inputxcontext)
Custom Mapping This function update the schema based on the dynamic custom mapping provided by the classvoid
updateSchema(XWikiContext inputxcontext)
Allows to update the schema to match the hibernate mappingvoid
updateSchema(XWikiContext inputxcontext, boolean force)
Allows to update the schema to match the hibernate mappingvoid
updateSchema(String[] createSQL, XWikiContext inputxcontext)
Deprecated.since 11.5RC1
-
-
-
Field Detail
-
HINT
public static final String HINT
The role hint of this component.- Since:
- 9.0RC1
- See Also:
- Constant Field Values
-
loggerManager
@Inject protected org.xwiki.logging.LoggerManager loggerManager
LoggerManager to suspend logging during normal faulty SQL operation.
-
store
@Inject protected com.xpn.xwiki.internal.store.hibernate.HibernateStore store
-
hibernateConfiguration
@Inject protected com.xpn.xwiki.internal.store.hibernate.HibernateConfiguration hibernateConfiguration
-
-
Constructor Detail
-
XWikiHibernateBaseStore
@Deprecated public XWikiHibernateBaseStore(XWiki xwiki, XWikiContext context)
Deprecated.1.6M1. Use ComponentManager.lookup(String) instead.THis allows to initialize our storage engine. The hibernate config file path is taken from xwiki.cfg or directly in the WEB-INF directory.- Parameters:
xwiki
-context
-
-
XWikiHibernateBaseStore
@Deprecated public XWikiHibernateBaseStore(String hibpath)
Deprecated.1.6M1. Use ComponentManager.lookup(String) instead.Initialize the storage engine with a specific path This is used for tests.- Parameters:
hibpath
-
-
XWikiHibernateBaseStore
public XWikiHibernateBaseStore()
Empty constructor needed for component manager.
-
-
Method Detail
-
getHint
public String getHint()
-
getPath
public String getPath()
Allows to get the current hibernate config file path
-
setPath
public void setPath(String hibpath)
Allows to set the current hibernate config file path- Parameters:
hibpath
-
-
getDatabaseMetaData
public DatabaseMetaData getDatabaseMetaData()
Retrieve metadata about the database used (name, version, etc).Note that the database metadata is not cached and it's retrieved at each call. If all you need is the database product name you should use
getDatabaseProductName()
instead, which is cached.- Returns:
- the database meta data or null if an error occurred
- Since:
- 6.1M1
-
getDatabaseProductName
public DatabaseProduct getDatabaseProductName()
Retrieve the current database product name.Note that the database product name is cached for improved performances.
- Returns:
- the database product name, see
DatabaseProduct
- Since:
- 4.0M1
-
getDatabaseProductName
@Deprecated public DatabaseProduct getDatabaseProductName(XWikiContext context)
Deprecated.since 4.0M1 usegetDatabaseProductName()
- Returns:
- the database product name
-
getSession
public org.hibernate.Session getSession(XWikiContext inputxcontext)
This get's the current session. This is set in beginTransaction- Parameters:
inputxcontext
-
-
setSession
public void setSession(org.hibernate.Session session, XWikiContext inputxcontext)
Allows to set the current session in the context This is set in beginTransaction- Parameters:
session
-inputxcontext
-
-
getTransaction
public org.hibernate.Transaction getTransaction(XWikiContext inputxcontext)
Allows to get the current transaction from the context This is set in beginTransaction- Parameters:
inputxcontext
-
-
setTransaction
public void setTransaction(org.hibernate.Transaction transaction, XWikiContext inputxcontext)
Allows to set the current transaction This is set in beginTransaction- Parameters:
transaction
-inputxcontext
-
-
shutdownHibernate
@Deprecated public void shutdownHibernate(XWikiContext inputxcontext) throws org.hibernate.HibernateException
Deprecated.automatically done when theHibernateSessionFactory
component is disposedAllows to shut down the hibernate configuration Closing all pools and connections- Parameters:
inputxcontext
-- Throws:
org.hibernate.HibernateException
-
updateSchema
public void updateSchema(XWikiContext inputxcontext) throws org.hibernate.HibernateException
Allows to update the schema to match the hibernate mapping- Parameters:
inputxcontext
-- Throws:
org.hibernate.HibernateException
-
updateSchema
public void updateSchema(XWikiContext inputxcontext, boolean force) throws org.hibernate.HibernateException
Allows to update the schema to match the hibernate mapping- Parameters:
inputxcontext
-force
- defines wether or not to force the update despite the xwiki.cfg settings- Throws:
org.hibernate.HibernateException
-
getSchemaFromWikiName
protected String getSchemaFromWikiName(String wikiName, DatabaseProduct databaseProduct, XWikiContext inputxcontext)
Convert wiki name in database/schema name.- Parameters:
wikiName
- the wiki name to convert.databaseProduct
- the database engine type.inputxcontext
- the XWiki context.- Returns:
- the database/schema name.
- Since:
- 1.1.2, 1.2M2
-
getSchemaFromWikiName
protected String getSchemaFromWikiName(String wikiId, XWikiContext inputxcontext)
Convert wiki name in database/schema name.Need hibernate to be initialized.
- Parameters:
wikiId
- the wiki name to convert.inputxcontext
- the XWiki context.- Returns:
- the database/schema name.
- Since:
- 1.1.2, 1.2M2
-
getSchemaFromWikiName
public String getSchemaFromWikiName(XWikiContext context)
Convert context's database in real database/schema name.Need hibernate to be initialized.
- Parameters:
context
- the XWiki context.- Returns:
- the database/schema name.
- Since:
- 1.1.2, 1.2M2
-
getSchemaUpdateScript
@Deprecated public String[] getSchemaUpdateScript(org.hibernate.cfg.Configuration config, XWikiContext inputxcontext) throws org.hibernate.HibernateException
Deprecated.do nothing since 11.5RC1This function gets the schema update scripts generated by comparing the current database with the current hibernate mapping config.- Parameters:
config
-inputxcontext
-- Throws:
org.hibernate.HibernateException
-
createHibernateSequenceIfRequired
@Deprecated protected void createHibernateSequenceIfRequired(String[] schemaSQL, String schemaName, org.hibernate.Session session)
Deprecated.since 11.5RC1In the Hibernate mapping file for XWiki we use a "native" generator for some tables (deleted document and deleted attachments for example - The reason we use generated ids and not custom computed ones is because we don't need to address rows from these tables). For a lot of database the Dialect uses an Identity Generator (when the DB supports it). PostgreSQL and Oracle don't support it and Hibernate defaults to a Sequence Generator which uses a sequence named "hibernate_sequence" by default. Hibernate will normally create such a sequence automatically when updating the schema (see #getSchemaUpdateScript). However the problem is that Hibernate maintains a cache of sequence names per catalog and will only generate the sequence creation SQL if the sequence is not in this cache. Since the main wiki is updated first the sequence named "hibernate_sequence" will be put in this cache, thus preventing subwikis to automatically create sequence with the same name (see also https://hibernate.atlassian.net/browse/HHH-1672). As a workaround, we create the required sequence here.- Parameters:
schemaSQL
- the list of SQL commands to execute to update the schema, possibly containing the "hibernate_sequence" sequence creationschemaName
- the schema name corresponding to the subwiki being updatedsession
- the Hibernate session, used to get the Dialect object- Since:
- 5.2RC1
-
updateSchema
@Deprecated public void updateSchema(String[] createSQL, XWikiContext inputxcontext) throws org.hibernate.HibernateException
Deprecated.since 11.5RC1Runs the update script on the current database- Parameters:
createSQL
-inputxcontext
-- Throws:
org.hibernate.HibernateException
-
updateSchema
public void updateSchema(BaseClass bclass, XWikiContext inputxcontext) throws XWikiException, org.hibernate.HibernateException
Custom Mapping This function update the schema based on the dynamic custom mapping provided by the class- Parameters:
bclass
-inputxcontext
-- Throws:
XWikiException
org.hibernate.HibernateException
-
checkHibernate
public void checkHibernate(XWikiContext context) throws org.hibernate.HibernateException
Initializes Hibernate.- Parameters:
context
-- Throws:
org.hibernate.HibernateException
-
isVirtual
@Deprecated protected boolean isVirtual(XWikiContext context)
Deprecated.Virtual mode is on by default, starting with XWiki 5.0M2.Checks if this xwiki setup is virtual meaning if multiple wikis can be accessed using the same database pool- Parameters:
context
- the XWiki context.- Returns:
- true if multi-wiki, false otherwise.
-
setDatabase
public void setDatabase(org.hibernate.Session session, XWikiContext inputxcontext) throws XWikiException
Virtual Wikis Allows to switch database connection- Parameters:
session
-inputxcontext
-- Throws:
XWikiException
-
escapeSchema
protected String escapeSchema(String schema, XWikiContext context)
Escape schema name depending of the database engine.- Parameters:
schema
- the schema name to escapecontext
- the XWiki context to get database engine identifier- Returns:
- the escaped version
-
beginTransaction
public boolean beginTransaction(XWikiContext context) throws XWikiException
Begins a transaction if the context does not contains any.- Parameters:
context
- the current XWikiContext- Returns:
- true if a new transaction has been created, false otherwise.
- Throws:
XWikiException
- if an error occurs while retrieving or creating a new session and transaction.
-
beginTransaction
@Deprecated public boolean beginTransaction(boolean withTransaction, XWikiContext context) throws XWikiException
Deprecated.since 4.0M1, usebeginTransaction(SessionFactory, XWikiContext)
Begins a transaction- Parameters:
withTransaction
- this argument is unusedcontext
- the current XWikiContext- Returns:
- true if a new transaction has been created, false otherwise.
- Throws:
XWikiException
- if an error occurs while retrieving or creating a new session and transaction.
-
beginTransaction
@Deprecated public boolean beginTransaction(org.hibernate.SessionFactory sfactory, boolean withTransaction, XWikiContext context) throws XWikiException
Deprecated.since 4.0M1, usebeginTransaction(SessionFactory, XWikiContext)
Begins a transaction with a specific SessionFactory.- Parameters:
sfactory
- the session factory used to begin a new session if none are availablewithTransaction
- this argument is unusedcontext
- the current XWikiContext- Returns:
- true if a new transaction has been created, false otherwise.
- Throws:
XWikiException
- if an error occurs while retrieving or creating a new session and transaction.
-
beginTransaction
public boolean beginTransaction(org.hibernate.SessionFactory sfactory, XWikiContext inputxcontext) throws XWikiException
Begins a transaction with a specific SessionFactory.- Parameters:
sfactory
- the session factory used to begin a new session if none are availableinputxcontext
- the current XWikiContext- Returns:
- true if a new transaction has been created, false otherwise.
- Throws:
XWikiException
- if an error occurs while retrieving or creating a new session and transaction.
-
endTransaction
@Deprecated public void endTransaction(XWikiContext context, boolean commit, boolean withTransaction) throws org.hibernate.HibernateException
Deprecated.since 4.0M1, useendTransaction(XWikiContext, boolean)
Ends a transaction and close the session.- Parameters:
context
- the current XWikiContextcommit
- should we commit or notwithTransaction
-- Throws:
org.hibernate.HibernateException
-
endTransaction
public void endTransaction(XWikiContext inputxcontext, boolean commit)
Ends a transaction and close the session.- Parameters:
inputxcontext
- the current XWikiContextcommit
- should we commit or not
-
cleanUp
public void cleanUp(XWikiContext inputxcontext)
Cleanup all sessions Used at the shutdown time- Parameters:
inputxcontext
-
-
getSessionFactory
public org.hibernate.SessionFactory getSessionFactory()
-
setSessionFactory
@Deprecated public void setSessionFactory(org.hibernate.SessionFactory sessionFactory)
Deprecated.does not do anything since 11.5RC1
-
getConfiguration
public org.hibernate.cfg.Configuration getConfiguration()
-
getMetadata
public org.hibernate.boot.Metadata getMetadata()
- Since:
- 11.5RC1
-
getConnections
@Deprecated public Map<String,String> getConnections()
Deprecated.since 9.9RC1
-
getNbConnections
@Deprecated public int getNbConnections()
Deprecated.since 9.9RC1
-
setNbConnections
@Deprecated public void setNbConnections(int nbConnections)
Deprecated.since 9.9RC1
-
dynamicMappingTableName
public String dynamicMappingTableName(String className)
Return the name generated for a dynamic mapped object.- Parameters:
className
- the classname of the object.- Returns:
- a name in the form xwikicustom_space_class
- Since:
- 4.0M1
-
getMapping
@Deprecated protected org.hibernate.cfg.Configuration getMapping(String className, String customMapping)
Deprecated.since 11.5RC1Build aConfiguration
containing the provide mapping. Before 4.0M1, this function was called makeMapping. In 4.0M1, it enter in conflict withmakeMapping(String, String)
- Parameters:
className
- the classname of the class to map.customMapping
- the custom mapping- Returns:
- a new
Configuration
containing this mapping alone. - Since:
- 4.0M1
-
makeMapping
protected String makeMapping(String className, String customMapping)
Build a new XML string to define the provided mapping. Since 4.0M1, the ids are longs, and a conditional mapping is made for Oracle.- Parameters:
className
- the name of the class to map.customMapping
- the custom mapping- Returns:
- a XML definition for the given mapping, using XWO_ID column for the object id.
-
execute
@Deprecated public <T> T execute(XWikiContext context, boolean bTransaction, boolean doCommit, XWikiHibernateBaseStore.HibernateCallback<T> cb) throws XWikiException
Deprecated.Execute method for operations in hibernate. spring like.- Parameters:
context
- - used everywhere.bTransaction
- - should store use old transaction(false) or create new (true)doCommit
- - should store commit changes(if any), or rollback it.cb
- - callback to execute- Returns:
XWikiHibernateBaseStore.HibernateCallback.doInHibernate(Session)
- Throws:
XWikiException
- if any error
-
failSafeExecute
public <T> T failSafeExecute(XWikiContext inputxcontext, boolean doCommit, XWikiHibernateBaseStore.HibernateCallback<T> cb)
Execute method for operations in hibernate in an independent session (but not closing the current one if any). Never throw any error, but there is no warranty that the operation has been completed successfully.- Parameters:
inputxcontext
- - used everywhere.doCommit
- - should store commit changes(if any), or rollback it.cb
- - callback to execute- Returns:
XWikiHibernateBaseStore.HibernateCallback.doInHibernate(Session)
, returns null if the callback throw an error.
-
execute
public <T> T execute(XWikiContext inputxcontext, boolean doCommit, XWikiHibernateBaseStore.HibernateCallback<T> cb) throws XWikiException
Execute method for operations in Hibernate.- Parameters:
inputxcontext
- - used everywhere.doCommit
- - should store commit changes(if any), or rollback it.cb
- - callback to execute- Returns:
XWikiHibernateBaseStore.HibernateCallback.doInHibernate(Session)
- Throws:
XWikiException
- if any error
-
executeRead
@Deprecated public <T> T executeRead(XWikiContext context, boolean bTransaction, XWikiHibernateBaseStore.HibernateCallback<T> cb) throws XWikiException
Deprecated.Execute method for read-only operations in hibernate. spring like.- Parameters:
context
- the current XWikiContextbTransaction
- this argument is unusedcb
- the callback to execute- Returns:
XWikiHibernateBaseStore.HibernateCallback.doInHibernate(Session)
- Throws:
XWikiException
- if any error- See Also:
execute(XWikiContext, boolean, HibernateCallback)
-
failSafeExecuteRead
public <T> T failSafeExecuteRead(XWikiContext context, XWikiHibernateBaseStore.HibernateCallback<T> cb)
Execute hibernate read-only operation in a independent session (but not closing the current one if any). Never throw any error, but there is no warranty that the operation has been completed successfully.- Parameters:
context
- the current XWikiContextcb
- the callback to execute- Returns:
XWikiHibernateBaseStore.HibernateCallback.doInHibernate(Session)
, returns null if the callback throw an error.- See Also:
failSafeExecute(XWikiContext, boolean, HibernateCallback)
-
executeRead
public <T> T executeRead(XWikiContext context, XWikiHibernateBaseStore.HibernateCallback<T> cb) throws XWikiException
Execute method for read-only operations in hibernate. spring like.- Parameters:
context
- - used everywhere.cb
- - callback to execute- Returns:
XWikiHibernateBaseStore.HibernateCallback.doInHibernate(Session)
- Throws:
XWikiException
- if any error- See Also:
execute(XWikiContext, boolean, HibernateCallback)
-
executeWrite
@Deprecated public <T> T executeWrite(XWikiContext context, boolean bTransaction, XWikiHibernateBaseStore.HibernateCallback<T> cb) throws XWikiException
Deprecated.Execute method for read-write operations in hibernate. spring like.- Parameters:
context
- the current XWikiContextbTransaction
- this argument is unusedcb
- the callback to execute- Returns:
XWikiHibernateBaseStore.HibernateCallback.doInHibernate(Session)
- Throws:
XWikiException
- if any error- See Also:
execute(XWikiContext, boolean, HibernateCallback)
-
failSafeExecuteWrite
public <T> T failSafeExecuteWrite(XWikiContext context, XWikiHibernateBaseStore.HibernateCallback<T> cb)
Execute hibernate read-only operation in a independent session (but not closing the current one if any). Never throw any error, but there is no warranty that the operation has been completed successfully.- Parameters:
context
- the current XWikiContextcb
- the callback to execute- Returns:
XWikiHibernateBaseStore.HibernateCallback.doInHibernate(Session)
- See Also:
execute(XWikiContext, boolean, HibernateCallback)
-
executeWrite
public <T> T executeWrite(XWikiContext context, XWikiHibernateBaseStore.HibernateCallback<T> cb) throws XWikiException
Execute method for read-write operations in Hibernate.- Parameters:
context
- the current XWikiContextcb
- the callback to execute- Returns:
XWikiHibernateBaseStore.HibernateCallback.doInHibernate(Session)
- Throws:
XWikiException
- if any error- See Also:
execute(XWikiContext, boolean, HibernateCallback)
-
isInSchemaMode
protected boolean isInSchemaMode()
- Returns:
- true if the user has configured Hibernate to use XWiki in schema mode (vs database mode)
- Since:
- 4.5M1
-
getExecution
protected org.xwiki.context.Execution getExecution()
We had to add this method because the Component Manager doesn't inject a field in the base class if a derived class defines a field with the same name.- Returns:
- the execution
- Since:
- 5.1M1
-
getDialect
public org.hibernate.dialect.Dialect getDialect()
- Returns:
- a singleton instance of the configured
Dialect
- Since:
- 8.4RC1
-
-