@Component @Named(value="hibernate") @Singleton public class XWikiHibernateStore extends XWikiHibernateBaseStore implements XWikiStoreInterface, org.xwiki.component.phase.Initializable
XWikiHibernateBaseStore.HibernateCallback<T>
hibernateConfiguration, HINT, loggerManager, store
Constructor and Description |
---|
XWikiHibernateStore()
Empty constructor needed for component manager.
|
XWikiHibernateStore(String hibpath)
Deprecated.
1.6M1. Use ComponentManager.lookup(XWikiStoreInterface.class) instead.
|
XWikiHibernateStore(XWikiContext context)
Deprecated.
1.6M1. Use ComponentManager.lookup(XWikiStoreInterface.class) instead.
|
XWikiHibernateStore(XWiki xwiki,
XWikiContext context)
Deprecated.
1.6M1. Use ComponentManager.lookup(XWikiStoreInterface.class) instead.
|
Modifier and Type | Method and Description |
---|---|
int |
countDocuments(String parametrizedSqlClause,
List<?> parameterValues,
XWikiContext context)
API allowing to count the total number of documents that would be returned by a parameterized query.
|
int |
countDocuments(String wheresql,
XWikiContext context)
API allowing to count the total number of documents that would be returned by a query.
|
protected String |
createSQLQuery(String queryPrefix,
String whereSQL) |
void |
createWiki(String wikiName,
XWikiContext inputxcontext)
Allows to create a new wiki database and initialize the default tables.
|
void |
deleteLinks(long docId,
XWikiContext inputxcontext,
boolean bTransaction) |
void |
deleteLock(XWikiLock lock,
XWikiContext inputxcontext,
boolean bTransaction) |
void |
deleteWiki(String wikiName,
XWikiContext inputxcontext)
Delete a wiki database.
|
void |
deleteXWikiCollection(BaseCollection object,
XWikiContext inputxcontext,
boolean bTransaction,
boolean evict)
Deprecated.
This is internal to XWikiHibernateStore and may be removed in the future.
|
void |
deleteXWikiDoc(XWikiDocument doc,
XWikiContext inputxcontext) |
protected void |
executeDeleteWikiStatement(Statement statement,
DatabaseProduct databaseProduct,
String escapedSchemaName)
Execute the SQL statement on the database to remove a wiki.
|
boolean |
exists(XWikiDocument doc,
XWikiContext inputxcontext)
Verifies if a wiki document exists
|
List<String> |
getClassList(XWikiContext inputxcontext) |
protected String |
getColumnsForSelectStatement(String whereSQL) |
void |
getContent(XWikiDocument doc,
StringBuffer buf) |
List<String> |
getCustomMappingPropertyList(BaseClass bclass) |
int |
getLimitSize(XWikiContext context,
Class<?> entityType,
String propertyName)
Get the limit size of a property.
|
QueryManager |
getQueryManager() |
List<String> |
getTranslationList(XWikiDocument doc,
XWikiContext context) |
void |
initialize() |
boolean |
injectCustomMapping(BaseClass doc1class) |
boolean |
injectCustomMapping(BaseClass doc1class,
XWikiContext inputxcontext) |
boolean |
injectCustomMapping(String className,
String customMapping,
XWikiContext inputxcontext) |
void |
injectCustomMappings(XWikiContext context) |
boolean |
injectCustomMappings(XWikiDocument doc,
XWikiContext inputxcontext) |
org.hibernate.SessionFactory |
injectCustomMappingsInSessionFactory(BaseClass bclass,
XWikiContext context) |
org.hibernate.SessionFactory |
injectCustomMappingsInSessionFactory(XWikiContext inputxcontext) |
void |
injectUpdatedCustomMappings(XWikiContext context) |
boolean |
isCustomMappingValid(BaseClass bclass,
String custommapping1) |
boolean |
isCustomMappingValid(BaseClass bclass,
String custommapping1,
XWikiContext context)
Deprecated.
|
boolean |
isWikiNameAvailable(String wikiName,
XWikiContext inputxcontext)
Indicate if the provided wiki name could be used to create a new wiki.
|
List<DocumentReference> |
loadBacklinks(DocumentReference documentReference,
boolean bTransaction,
XWikiContext inputxcontext) |
List<String> |
loadBacklinks(String fullName,
XWikiContext inputxcontext,
boolean bTransaction)
Deprecated.
since 2.2M2 use
loadBacklinks(DocumentReference, boolean, XWikiContext) |
List<XWikiLink> |
loadLinks(long docId,
XWikiContext inputxcontext,
boolean bTransaction) |
XWikiLock |
loadLock(long docId,
XWikiContext inputxcontext,
boolean bTransaction) |
void |
loadXWikiCollection(BaseCollection object,
XWikiContext context,
boolean bTransaction)
Deprecated.
This is internal to XWikiHibernateStore and may be removed in the future.
|
XWikiDocument |
loadXWikiDoc(XWikiDocument doc,
XWikiContext inputxcontext) |
void |
renameXWikiDoc(XWikiDocument doc,
DocumentReference newReference,
XWikiContext inputxcontext)
Atomic operation for renaming a document.
|
void |
saveLinks(XWikiDocument doc,
XWikiContext inputxcontext,
boolean bTransaction) |
void |
saveLock(XWikiLock lock,
XWikiContext inputxcontext,
boolean bTransaction) |
void |
saveXWikiCollection(BaseCollection object,
XWikiContext inputxcontext,
boolean bTransaction)
Deprecated.
This is internal to XWikiHibernateStore and may be removed in the future.
|
void |
saveXWikiDoc(XWikiDocument doc,
XWikiContext context) |
void |
saveXWikiDoc(XWikiDocument doc,
XWikiContext inputxcontext,
boolean bTransaction) |
List |
search(org.hibernate.query.Query query,
int nb,
int start,
XWikiContext inputxcontext) |
<T> List<T> |
search(String sql,
int nb,
int start,
List<?> parameterValues,
XWikiContext context)
Execute a reading request with parameters and return result.
|
<T> List<T> |
search(String sql,
int nb,
int start,
Object[][] whereParams,
List<?> parameterValues,
XWikiContext inputxcontext)
Execute a reading request with parameters and return result.
|
<T> List<T> |
search(String sql,
int nb,
int start,
Object[][] whereParams,
XWikiContext context)
Execute a reading request and return result.
|
<T> List<T> |
search(String sql,
int nb,
int start,
XWikiContext context)
Execute a reading request and return result.
|
List<DocumentReference> |
searchDocumentReferences(String parametrizedSqlClause,
int nb,
int start,
List<?> parameterValues,
XWikiContext context)
Search documents by passing HQL where clause values as parameters.
|
List<DocumentReference> |
searchDocumentReferences(String wheresql,
int nb,
int start,
String selectColumns,
XWikiContext context) |
List<DocumentReference> |
searchDocumentReferences(String wheresql,
int nb,
int start,
XWikiContext context) |
List<DocumentReference> |
searchDocumentReferences(String parametrizedSqlClause,
List<?> parameterValues,
XWikiContext context)
Same as
XWikiStoreInterface.searchDocumentReferences(String, int, int, List, XWikiContext) but returns all rows. |
List<DocumentReference> |
searchDocumentReferences(String wheresql,
XWikiContext context) |
List<XWikiDocument> |
searchDocuments(String wheresql,
boolean distinctbylanguage,
boolean customMapping,
boolean checkRight,
int nb,
int start,
List<?> parameterValues,
XWikiContext inputxcontext)
Search documents in the storing system.
|
List<XWikiDocument> |
searchDocuments(String wheresql,
boolean distinctbylanguage,
boolean customMapping,
boolean checkRight,
int nb,
int start,
XWikiContext context)
Search documents in the storing system.
|
List<XWikiDocument> |
searchDocuments(String wheresql,
boolean distinctbylanguage,
boolean customMapping,
int nb,
int start,
List<?> parameterValues,
XWikiContext context)
Search documents in the storing system.
|
List<XWikiDocument> |
searchDocuments(String wheresql,
boolean distinctbylanguage,
boolean customMapping,
int nb,
int start,
XWikiContext context)
Search documents in the storing system.
|
List<XWikiDocument> |
searchDocuments(String wheresql,
boolean distinctbylanguage,
boolean customMapping,
XWikiContext context)
Search documents in the storing system.
|
List<XWikiDocument> |
searchDocuments(String wheresql,
boolean distinctbylanguage,
int nb,
int start,
List<?> parameterValues,
XWikiContext context)
Search documents in the storing system.
|
List<XWikiDocument> |
searchDocuments(String wheresql,
boolean distinctbylanguage,
int nb,
int start,
XWikiContext context)
Search documents in the storing system.
|
List<XWikiDocument> |
searchDocuments(String wheresql,
boolean distinctbylanguage,
XWikiContext context)
Search documents in the storing system.
|
List<XWikiDocument> |
searchDocuments(String wheresql,
int nb,
int start,
List<?> parameterValues,
XWikiContext context)
Search documents in the storing system.
|
List<XWikiDocument> |
searchDocuments(String wheresql,
int nb,
int start,
XWikiContext context)
Search documents in the storing system.
|
List<XWikiDocument> |
searchDocuments(String wheresql,
List<?> parameterValues,
XWikiContext context)
Search documents in the storing system.
|
List<XWikiDocument> |
searchDocuments(String wheresql,
XWikiContext context)
Search documents in the storing system.
|
List<String> |
searchDocumentsNames(String parametrizedSqlClause,
int nb,
int start,
List<?> parameterValues,
XWikiContext context) |
List<String> |
searchDocumentsNames(String wheresql,
int nb,
int start,
String selectColumns,
XWikiContext context) |
List<String> |
searchDocumentsNames(String wheresql,
int nb,
int start,
XWikiContext context) |
List<String> |
searchDocumentsNames(String parametrizedSqlClause,
List<?> parameterValues,
XWikiContext context) |
List<String> |
searchDocumentsNames(String wheresql,
XWikiContext context) |
beginTransaction, beginTransaction, beginTransaction, beginTransaction, checkHibernate, cleanUp, createHibernateSequenceIfRequired, dynamicMappingTableName, endTransaction, endTransaction, escapeSchema, execute, execute, executeRead, executeRead, executeWrite, executeWrite, failSafeExecute, failSafeExecuteRead, failSafeExecuteWrite, getConfiguration, getConnections, getDatabaseMetaData, getDatabaseProductName, getDatabaseProductName, getDialect, getExecution, getHint, getMapping, getMetadata, getNbConnections, getPath, getSchemaFromWikiName, getSchemaFromWikiName, getSchemaFromWikiName, getSchemaUpdateScript, getSession, getSessionFactory, getTransaction, isInSchemaMode, isVirtual, makeMapping, setDatabase, setNbConnections, setPath, setSession, setSessionFactory, setTransaction, shutdownHibernate, updateSchema, updateSchema, updateSchema, updateSchema
getExecutionXContext, restoreExecutionXContext
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
cleanUp
@Deprecated public XWikiHibernateStore(XWiki xwiki, XWikiContext context)
xwiki
- context
- @Deprecated public XWikiHibernateStore(String hibpath)
hibpath
- @Deprecated public XWikiHibernateStore(XWikiContext context)
XWikiHibernateStore(XWiki, XWikiContext)
public XWikiHibernateStore()
public void initialize() throws org.xwiki.component.phase.InitializationException
initialize
in interface org.xwiki.component.phase.Initializable
org.xwiki.component.phase.InitializationException
public boolean isWikiNameAvailable(String wikiName, XWikiContext inputxcontext) throws XWikiException
XWikiStoreInterface
isWikiNameAvailable
in interface XWikiStoreInterface
wikiName
- the name of the wiki.inputxcontext
- the XWiki context.XWikiException
- error when looking if wiki name already used.public void createWiki(String wikiName, XWikiContext inputxcontext) throws XWikiException
XWikiStoreInterface
createWiki
in interface XWikiStoreInterface
wikiName
- the name of the new wiki.inputxcontext
- the XWiki context.XWikiException
- error when creating new wiki.public void deleteWiki(String wikiName, XWikiContext inputxcontext) throws XWikiException
XWikiStoreInterface
deleteWiki
in interface XWikiStoreInterface
wikiName
- the name of the wiki.inputxcontext
- the XWiki context.XWikiException
- error when deleting wiki database.protected void executeDeleteWikiStatement(Statement statement, DatabaseProduct databaseProduct, String escapedSchemaName) throws SQLException
statement
- the statement object on which to execute the wiki deletiondatabaseProduct
- the database typeescapedSchemaName
- the subwiki schema name being deletedSQLException
- in case of an error while deleting the sub wikipublic boolean exists(XWikiDocument doc, XWikiContext inputxcontext) throws XWikiException
exists
in interface XWikiStoreInterface
XWikiException
public void saveXWikiDoc(XWikiDocument doc, XWikiContext inputxcontext, boolean bTransaction) throws XWikiException
saveXWikiDoc
in interface XWikiStoreInterface
XWikiException
public void saveXWikiDoc(XWikiDocument doc, XWikiContext context) throws XWikiException
saveXWikiDoc
in interface XWikiStoreInterface
XWikiException
public void renameXWikiDoc(XWikiDocument doc, DocumentReference newReference, XWikiContext inputxcontext) throws XWikiException
saveXWikiDoc(XWikiDocument, XWikiContext, boolean)
and deleteXWikiDoc(XWikiDocument, XWikiContext, boolean)
. The idea here is that the document reference
has many impacts everywhere and it's actually safer to keep relying on existing save method. Now all the benefit
of this rename, is to call those methods in the same transaction when both old and new reference belong
to the same wiki (same database). If the references belong to different databases we are force to use two
transactions.renameXWikiDoc
in interface XWikiStoreInterface
doc
- the actual document instance to rename.newReference
- the new reference to use for renaming.inputxcontext
- the current context.XWikiException
- in case of problem during the rename.public XWikiDocument loadXWikiDoc(XWikiDocument doc, XWikiContext inputxcontext) throws XWikiException
loadXWikiDoc
in interface XWikiStoreInterface
XWikiException
public void deleteXWikiDoc(XWikiDocument doc, XWikiContext inputxcontext) throws XWikiException
deleteXWikiDoc
in interface XWikiStoreInterface
XWikiException
@Deprecated public void saveXWikiCollection(BaseCollection object, XWikiContext inputxcontext, boolean bTransaction) throws XWikiException
XWikiException
@Deprecated public void loadXWikiCollection(BaseCollection object, XWikiContext context, boolean bTransaction) throws XWikiException
XWikiException
@Deprecated public void deleteXWikiCollection(BaseCollection object, XWikiContext inputxcontext, boolean bTransaction, boolean evict) throws XWikiException
XWikiException
public XWikiLock loadLock(long docId, XWikiContext inputxcontext, boolean bTransaction) throws XWikiException
loadLock
in interface XWikiStoreInterface
XWikiException
public void saveLock(XWikiLock lock, XWikiContext inputxcontext, boolean bTransaction) throws XWikiException
saveLock
in interface XWikiStoreInterface
XWikiException
public void deleteLock(XWikiLock lock, XWikiContext inputxcontext, boolean bTransaction) throws XWikiException
deleteLock
in interface XWikiStoreInterface
XWikiException
public List<XWikiLink> loadLinks(long docId, XWikiContext inputxcontext, boolean bTransaction) throws XWikiException
loadLinks
in interface XWikiStoreInterface
XWikiException
public List<DocumentReference> loadBacklinks(DocumentReference documentReference, boolean bTransaction, XWikiContext inputxcontext) throws XWikiException
loadBacklinks
in interface XWikiStoreInterface
XWikiException
@Deprecated public List<String> loadBacklinks(String fullName, XWikiContext inputxcontext, boolean bTransaction) throws XWikiException
loadBacklinks(DocumentReference, boolean, XWikiContext)
loadBacklinks
in interface XWikiStoreInterface
XWikiException
public void saveLinks(XWikiDocument doc, XWikiContext inputxcontext, boolean bTransaction) throws XWikiException
saveLinks
in interface XWikiStoreInterface
XWikiException
public void deleteLinks(long docId, XWikiContext inputxcontext, boolean bTransaction) throws XWikiException
deleteLinks
in interface XWikiStoreInterface
XWikiException
public void getContent(XWikiDocument doc, StringBuffer buf)
public List<String> getClassList(XWikiContext inputxcontext) throws XWikiException
getClassList
in interface XWikiStoreInterface
XWikiException
public List<DocumentReference> searchDocumentReferences(String parametrizedSqlClause, List<?> parameterValues, XWikiContext context) throws XWikiException
XWikiStoreInterface
XWikiStoreInterface.searchDocumentReferences(String, int, int, List, XWikiContext)
but returns all rows.searchDocumentReferences
in interface XWikiStoreInterface
XWikiException
XWikiStoreInterface.searchDocumentReferences(String, int, int, java.util.List, com.xpn.xwiki.XWikiContext)
public List<String> searchDocumentsNames(String parametrizedSqlClause, List<?> parameterValues, XWikiContext context) throws XWikiException
searchDocumentsNames
in interface XWikiStoreInterface
XWikiException
public List<DocumentReference> searchDocumentReferences(String parametrizedSqlClause, int nb, int start, List<?> parameterValues, XWikiContext context) throws XWikiException
XWikiStoreInterface
Example:
#set($orphans = $xwiki.searchDocuments(" where doc.fullName <> ?1 and (doc.parent = ?2 or "
+ "(doc.parent = ?3 and doc.space = ?4))",
["${doc.fullName}as", ${doc.fullName}, ${doc.name}, ${doc.space}]))
searchDocumentReferences
in interface XWikiStoreInterface
parametrizedSqlClause
- the HQL where clause. For example: where doc.fullName
<> ?1 and (doc.parent = ?2 or (doc.parent = ?3 and doc.space = ?4))
nb
- the number of rows to return. If 0 then all rows are returnedstart
- the number of rows to skip. If 0 don't skip any rowparameterValues
- the where clause values that replace the question marks (?)context
- the XWiki context required for getting information about the execution contextXWikiException
- in case of error while performing the querypublic List<String> searchDocumentsNames(String parametrizedSqlClause, int nb, int start, List<?> parameterValues, XWikiContext context) throws XWikiException
searchDocumentsNames
in interface XWikiStoreInterface
XWikiException
public List<DocumentReference> searchDocumentReferences(String wheresql, XWikiContext context) throws XWikiException
searchDocumentReferences
in interface XWikiStoreInterface
XWikiException
public List<String> searchDocumentsNames(String wheresql, XWikiContext context) throws XWikiException
searchDocumentsNames
in interface XWikiStoreInterface
XWikiException
public List<DocumentReference> searchDocumentReferences(String wheresql, int nb, int start, XWikiContext context) throws XWikiException
searchDocumentReferences
in interface XWikiStoreInterface
XWikiException
public List<String> searchDocumentsNames(String wheresql, int nb, int start, XWikiContext context) throws XWikiException
searchDocumentsNames
in interface XWikiStoreInterface
XWikiException
public List<DocumentReference> searchDocumentReferences(String wheresql, int nb, int start, String selectColumns, XWikiContext context) throws XWikiException
searchDocumentReferences
in interface XWikiStoreInterface
XWikiException
public List<String> searchDocumentsNames(String wheresql, int nb, int start, String selectColumns, XWikiContext context) throws XWikiException
searchDocumentsNames
in interface XWikiStoreInterface
XWikiException
public <T> List<T> search(String sql, int nb, int start, XWikiContext context) throws XWikiException
XWikiStoreInterface
search
in interface XWikiStoreInterface
sql
- the HQL request clause. For example: where doc.fullName
<> ?1 and (doc.parent = ?2 or (doc.parent = ?3 and doc.space = ?4))
nb
- the number of rows to return. If 0 then all rows are returned.start
- the number of rows to skip. If 0 don't skip any row.context
- the XWiki context required for getting information about the execution context.XWikiException
- in case of error while performing the query.public <T> List<T> search(String sql, int nb, int start, List<?> parameterValues, XWikiContext context) throws XWikiException
XWikiStoreInterface
Execute query by passing HQL request values as parameters. This allows generating a Named HQL query which will automatically encode the passed values (like escaping single quotes). This API is recommended to be used over the other similar methods where the values are passed inside the where clause and for which you'll need to do the encoding/escaping yourself before calling them.
search
in interface XWikiStoreInterface
sql
- the HQL request.nb
- the number of rows to return. If 0 then all rows are returned.start
- the number of rows to skip. If 0 don't skip any row.parameterValues
- the where clause values that replace the question marks (?).context
- the XWiki context required for getting information about the execution context.XWikiException
- in case of error while performing the query.public <T> List<T> search(String sql, int nb, int start, Object[][] whereParams, XWikiContext context) throws XWikiException
XWikiStoreInterface
search
in interface XWikiStoreInterface
sql
- the HQL request.nb
- the number of rows to return. If 0 then all rows are returned.start
- the number of rows to skip. If 0 don't skip any row.whereParams
- if not null add to sql
a where clause based on a table of table containing field name,
field value and compared symbol (=
, >
, etc.).context
- the XWiki context required for getting information about the execution context.XWikiException
- in case of error while performing the query.public <T> List<T> search(String sql, int nb, int start, Object[][] whereParams, List<?> parameterValues, XWikiContext inputxcontext) throws XWikiException
XWikiStoreInterface
Execute query by passing HQL request values as parameters. This allows generating a Named HQL query which will automatically encode the passed values (like escaping single quotes). This API is recommended to be used over the other similar methods where the values are passed inside the where clause and for which you'll need to do the encoding/escaping yourself before calling them.
search
in interface XWikiStoreInterface
sql
- the HQL request.nb
- the number of rows to return. If 0 then all rows are returned.start
- the number of rows to skip. If 0 don't skip any row.whereParams
- if not null add to sql
a where clause based on a table of table containing field name,
field value and compared symbol (=
, >
, etc.).parameterValues
- the where clause values that replace the question marks (?).inputxcontext
- the XWiki context required for getting information about the execution context.XWikiException
- in case of error while performing the query.public List search(org.hibernate.query.Query query, int nb, int start, XWikiContext inputxcontext) throws XWikiException
XWikiException
public int countDocuments(String wheresql, XWikiContext context) throws XWikiException
XWikiStoreInterface
countDocuments
in interface XWikiStoreInterface
wheresql
- Query to use, similar to the ones accepted by XWikiStoreInterface.searchDocuments(String, XWikiContext)
. It
should not contain order by
or group
clauses, since this kind of queries are not
portable.context
- The current request context.XWikiException
- if there was a problem executing the query.public int countDocuments(String parametrizedSqlClause, List<?> parameterValues, XWikiContext context) throws XWikiException
XWikiStoreInterface
countDocuments
in interface XWikiStoreInterface
parametrizedSqlClause
- Parameterized query to use, similar to the ones accepted by
XWikiStoreInterface.searchDocuments(String, List, XWikiContext)
. It should not contain order by
or
group
clauses, since this kind of queries are not portable.parameterValues
- The parameter values that replace the question marks.context
- The current request context.XWikiException
- if there was a problem executing the query.public List<XWikiDocument> searchDocuments(String wheresql, boolean distinctbylanguage, boolean customMapping, boolean checkRight, int nb, int start, XWikiContext context) throws XWikiException
XWikiStoreInterface
searchDocuments
in interface XWikiStoreInterface
wheresql
- the HQL where clause. For example: where doc.fullName
<> ?1 and (doc.parent = ?2 or (doc.parent = ?3 and doc.space = ?4))
distinctbylanguage
- when a document has multiple version for each language it is returned as one document a
language.customMapping
- inject custom mapping in session.checkRight
- if true check for each found document if context's user has "view" rights for it.nb
- the number of rows to return. If 0 then all rows are returned.start
- the number of rows to skip. If 0 don't skip any row.context
- the XWiki context required for getting information about the execution context.XWikiException
- in case of error while performing the query.public List<XWikiDocument> searchDocuments(String wheresql, boolean distinctbylanguage, boolean customMapping, boolean checkRight, int nb, int start, List<?> parameterValues, XWikiContext inputxcontext) throws XWikiException
XWikiStoreInterface
Search documents by passing HQL where clause values as parameters. This allows generating a Named HQL query which will automatically encode the passed values (like escaping single quotes). This API is recommended to be used over the other similar methods where the values are passed inside the where clause and for which you'll need to do the encoding/escpaing yourself before calling them.
searchDocuments
in interface XWikiStoreInterface
wheresql
- the HQL where clause. For example: where doc.fullName
<> ?1 and (doc.parent = ?2 or (doc.parent = ?3 and doc.space = ?4))
distinctbylanguage
- when a document has multiple version for each language it is returned as one document a
language.customMapping
- inject custom mapping in session.checkRight
- if true check for each found document if context's user has "view" rights for it.nb
- the number of rows to return. If 0 then all rows are returned.start
- the number of rows to skip. If 0 don't skip any row.parameterValues
- the where clause values that replace the question marks (?).inputxcontext
- the XWiki context required for getting information about the execution context.XWikiException
- in case of error while performing the query.protected String createSQLQuery(String queryPrefix, String whereSQL)
queryPrefix
- the start of the SQL query (for example "select distinct doc.space, doc.name")whereSQL
- the where clause to appendprotected String getColumnsForSelectStatement(String whereSQL)
whereSQL
- the SQL where clause@Deprecated public boolean isCustomMappingValid(BaseClass bclass, String custommapping1, XWikiContext context)
isCustomMappingValid
in interface XWikiStoreInterface
public boolean isCustomMappingValid(BaseClass bclass, String custommapping1)
isCustomMappingValid
in interface XWikiStoreInterface
public void injectCustomMappings(XWikiContext context) throws XWikiException
injectCustomMappings
in interface XWikiStoreInterface
XWikiException
public void injectUpdatedCustomMappings(XWikiContext context) throws XWikiException
injectUpdatedCustomMappings
in interface XWikiStoreInterface
XWikiException
public org.hibernate.SessionFactory injectCustomMappingsInSessionFactory(BaseClass bclass, XWikiContext context) throws XWikiException
XWikiException
public org.hibernate.SessionFactory injectCustomMappingsInSessionFactory(XWikiContext inputxcontext) throws XWikiException
XWikiException
public boolean injectCustomMappings(XWikiDocument doc, XWikiContext inputxcontext) throws XWikiException
injectCustomMappings
in interface XWikiStoreInterface
XWikiException
public boolean injectCustomMapping(String className, String customMapping, XWikiContext inputxcontext) throws XWikiException
className
- the name of the class to mapcustomMapping
- the custom mapping to inject for this classinputxcontext
- the current XWikiContextXWikiException
- if an error occurspublic boolean injectCustomMapping(BaseClass doc1class, XWikiContext inputxcontext) throws XWikiException
injectCustomMapping
in interface XWikiStoreInterface
XWikiException
public boolean injectCustomMapping(BaseClass doc1class) throws XWikiException
injectCustomMapping
in interface XWikiStoreInterface
XWikiException
public List<String> getCustomMappingPropertyList(BaseClass bclass)
getCustomMappingPropertyList
in interface XWikiStoreInterface
public List<XWikiDocument> searchDocuments(String wheresql, XWikiContext context) throws XWikiException
XWikiStoreInterface
searchDocuments
in interface XWikiStoreInterface
wheresql
- the HQL where clause. For example: where doc.fullName
<> ?1 and (doc.parent = ?2 or (doc.parent = ?3 and doc.space = ?4))
context
- the XWiki context required for getting information about the execution context.XWikiException
- in case of error while performing the query.public List<XWikiDocument> searchDocuments(String wheresql, List<?> parameterValues, XWikiContext context) throws XWikiException
XWikiStoreInterface
Search documents by passing HQL where clause values as parameters. This allows generating a Named HQL query which will automatically encode the passed values (like escaping single quotes). This API is recommended to be used over the other similar methods where the values are passed inside the where clause and for which you'll need to do the encoding/escpaing yourself before calling them.
searchDocuments
in interface XWikiStoreInterface
wheresql
- the HQL where clause. For example: where doc.fullName
<> ?1 and (doc.parent = ?2 or (doc.parent = ?3 and doc.space = ?4))
parameterValues
- the where clause values that replace the question marks (?).context
- the XWiki context required for getting information about the execution context.XWikiException
- in case of error while performing the query.public List<XWikiDocument> searchDocuments(String wheresql, boolean distinctbylanguage, XWikiContext context) throws XWikiException
XWikiStoreInterface
searchDocuments
in interface XWikiStoreInterface
wheresql
- the HQL where clause. For example: where doc.fullName
<> ?1 and (doc.parent = ?2 or (doc.parent = ?3 and doc.space = ?4))
distinctbylanguage
- when a document has multiple version for each language it is returned as one document a
language.context
- the XWiki context required for getting information about the execution context.XWikiException
- in case of error while performing the query.public List<XWikiDocument> searchDocuments(String wheresql, boolean distinctbylanguage, boolean customMapping, XWikiContext context) throws XWikiException
XWikiStoreInterface
searchDocuments
in interface XWikiStoreInterface
wheresql
- the HQL where clause. For example: where doc.fullName
<> ?1 and (doc.parent = ?2 or (doc.parent = ?3 and doc.space = ?4))
distinctbylanguage
- when a document has multiple version for each language it is returned as one document a
language.customMapping
- inject custom mapping in session.context
- the XWiki context required for getting information about the execution context.XWikiException
- in case of error while performing the query.public List<XWikiDocument> searchDocuments(String wheresql, int nb, int start, XWikiContext context) throws XWikiException
XWikiStoreInterface
searchDocuments
in interface XWikiStoreInterface
wheresql
- the HQL where clause. For example: where doc.fullName
<> ?1 and (doc.parent = ?2 or (doc.parent = ?3 and doc.space = ?4))
nb
- the number of rows to return. If 0 then all rows are returned.start
- the number of rows to skip. If 0 don't skip any row.context
- the XWiki context required for getting information about the execution context.XWikiException
- in case of error while performing the query.public List<XWikiDocument> searchDocuments(String wheresql, int nb, int start, List<?> parameterValues, XWikiContext context) throws XWikiException
XWikiStoreInterface
Search documents by passing HQL where clause values as parameters. This allows generating a Named HQL query which will automatically encode the passed values (like escaping single quotes). This API is recommended to be used over the other similar methods where the values are passed inside the where clause and for which you'll need to do the encoding/escpaing yourself before calling them.
searchDocuments
in interface XWikiStoreInterface
wheresql
- the HQL where clause. For example: where doc.fullName
<> ?1 and (doc.parent = ?2 or (doc.parent = ?3 and doc.space = ?4))
nb
- the number of rows to return. If 0 then all rows are returned.start
- the number of rows to skip. If 0 don't skip any row.parameterValues
- the where clause values that replace the question marks (?).context
- the XWiki context required for getting information about the execution context.XWikiException
- in case of error while performing the query.public List<XWikiDocument> searchDocuments(String wheresql, boolean distinctbylanguage, int nb, int start, List<?> parameterValues, XWikiContext context) throws XWikiException
XWikiStoreInterface
searchDocuments
in interface XWikiStoreInterface
wheresql
- the HQL where clause. For example: where doc.fullName
<> ?1 and (doc.parent = ?2 or (doc.parent = ?3 and doc.space = ?4))
distinctbylanguage
- when a document has multiple version for each language it is returned as one document a
language.nb
- the number of rows to return. If 0 then all rows are returned.start
- the number of rows to skip. If 0 don't skip any row.parameterValues
- the where clause values that replace the question marks (?).context
- the XWiki context required for getting information about the execution context.XWikiException
- in case of error while performing the query.public List<XWikiDocument> searchDocuments(String wheresql, boolean distinctbylanguage, int nb, int start, XWikiContext context) throws XWikiException
XWikiStoreInterface
searchDocuments
in interface XWikiStoreInterface
wheresql
- the HQL where clause. For example: where doc.fullName
<> ?1 and (doc.parent = ?2 or (doc.parent = ?3 and doc.space = ?4))
distinctbylanguage
- when a document has multiple version for each language it is returned as one document a
language.nb
- the number of rows to return. If 0 then all rows are returned.start
- the number of rows to skip. If 0 don't skip any row.context
- the XWiki context required for getting information about the execution context.XWikiException
- in case of error while performing the query.public List<XWikiDocument> searchDocuments(String wheresql, boolean distinctbylanguage, boolean customMapping, int nb, int start, XWikiContext context) throws XWikiException
XWikiStoreInterface
searchDocuments
in interface XWikiStoreInterface
wheresql
- the HQL where clause. For example: where doc.fullName
<> ?1 and (doc.parent = ?2 or (doc.parent = ?3 and doc.space = ?4))
distinctbylanguage
- when a document has multiple version for each language it is returned as one document a
language.customMapping
- inject custom mapping in session.nb
- the number of rows to return. If 0 then all rows are returned.start
- the number of rows to skip. If 0 don't skip any row.context
- the XWiki context required for getting information about the execution context.XWikiException
- in case of error while performing the query.public List<XWikiDocument> searchDocuments(String wheresql, boolean distinctbylanguage, boolean customMapping, int nb, int start, List<?> parameterValues, XWikiContext context) throws XWikiException
XWikiStoreInterface
Search documents by passing HQL where clause values as parameters. This allows generating a Named HQL query which will automatically encode the passed values (like escaping single quotes). This API is recommended to be used over the other similar methods where the values are passed inside the where clause and for which you'll need to do the encoding/escpaing yourself before calling them.
searchDocuments
in interface XWikiStoreInterface
wheresql
- the HQL where clause. For example: where doc.fullName
<> ?1 and (doc.parent = ?2 or (doc.parent = ?3 and doc.space = ?4))
distinctbylanguage
- when a document has multiple version for each language it is returned as one document a
language.customMapping
- inject custom mapping in session.nb
- the number of rows to return. If 0 then all rows are returned.start
- the number of rows to skip. If 0 don't skip any row.parameterValues
- the where clause values that replace the question marks (?).context
- the XWiki context required for getting information about the execution context.XWikiException
- in case of error while performing the query.public List<String> getTranslationList(XWikiDocument doc, XWikiContext context) throws XWikiException
getTranslationList
in interface XWikiStoreInterface
XWikiException
public QueryManager getQueryManager()
getQueryManager
in interface XWikiStoreInterface
public int getLimitSize(XWikiContext context, Class<?> entityType, String propertyName)
XWikiStoreInterface
getLimitSize
in interface XWikiStoreInterface
context
- the context of the wiki to retrieve the propertyentityType
- the entityType where the property is located.propertyName
- the property on which we want the limit size.Copyright © 2004–2021 XWiki. All rights reserved.