@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, updateSchemagetExecutionXContext, restoreExecutionXContextclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitcleanUp@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.Initializableorg.xwiki.component.phase.InitializationExceptionpublic boolean isWikiNameAvailable(String wikiName, XWikiContext inputxcontext) throws XWikiException
XWikiStoreInterfaceisWikiNameAvailable in interface XWikiStoreInterfacewikiName - 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
XWikiStoreInterfacecreateWiki in interface XWikiStoreInterfacewikiName - 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
XWikiStoreInterfacedeleteWiki in interface XWikiStoreInterfacewikiName - 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 XWikiStoreInterfaceXWikiExceptionpublic void saveXWikiDoc(XWikiDocument doc, XWikiContext inputxcontext, boolean bTransaction) throws XWikiException
saveXWikiDoc in interface XWikiStoreInterfaceXWikiExceptionpublic void saveXWikiDoc(XWikiDocument doc, XWikiContext context) throws XWikiException
saveXWikiDoc in interface XWikiStoreInterfaceXWikiExceptionpublic 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 XWikiStoreInterfacedoc - 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 XWikiStoreInterfaceXWikiExceptionpublic void deleteXWikiDoc(XWikiDocument doc, XWikiContext inputxcontext) throws XWikiException
deleteXWikiDoc in interface XWikiStoreInterfaceXWikiException@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
XWikiExceptionpublic XWikiLock loadLock(long docId, XWikiContext inputxcontext, boolean bTransaction) throws XWikiException
loadLock in interface XWikiStoreInterfaceXWikiExceptionpublic void saveLock(XWikiLock lock, XWikiContext inputxcontext, boolean bTransaction) throws XWikiException
saveLock in interface XWikiStoreInterfaceXWikiExceptionpublic void deleteLock(XWikiLock lock, XWikiContext inputxcontext, boolean bTransaction) throws XWikiException
deleteLock in interface XWikiStoreInterfaceXWikiExceptionpublic List<XWikiLink> loadLinks(long docId, XWikiContext inputxcontext, boolean bTransaction) throws XWikiException
loadLinks in interface XWikiStoreInterfaceXWikiExceptionpublic List<DocumentReference> loadBacklinks(DocumentReference documentReference, boolean bTransaction, XWikiContext inputxcontext) throws XWikiException
loadBacklinks in interface XWikiStoreInterfaceXWikiException@Deprecated public List<String> loadBacklinks(String fullName, XWikiContext inputxcontext, boolean bTransaction) throws XWikiException
loadBacklinks(DocumentReference, boolean, XWikiContext)loadBacklinks in interface XWikiStoreInterfaceXWikiExceptionpublic void saveLinks(XWikiDocument doc, XWikiContext inputxcontext, boolean bTransaction) throws XWikiException
saveLinks in interface XWikiStoreInterfaceXWikiExceptionpublic void deleteLinks(long docId,
XWikiContext inputxcontext,
boolean bTransaction)
throws XWikiException
deleteLinks in interface XWikiStoreInterfaceXWikiExceptionpublic void getContent(XWikiDocument doc, StringBuffer buf)
public List<String> getClassList(XWikiContext inputxcontext) throws XWikiException
getClassList in interface XWikiStoreInterfaceXWikiExceptionpublic List<DocumentReference> searchDocumentReferences(String parametrizedSqlClause, List<?> parameterValues, XWikiContext context) throws XWikiException
XWikiStoreInterfaceXWikiStoreInterface.searchDocumentReferences(String, int, int, List, XWikiContext) but returns all rows.searchDocumentReferences in interface XWikiStoreInterfaceXWikiExceptionXWikiStoreInterface.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 XWikiStoreInterfaceXWikiExceptionpublic List<DocumentReference> searchDocumentReferences(String parametrizedSqlClause, int nb, int start, List<?> parameterValues, XWikiContext context) throws XWikiException
XWikiStoreInterfaceExample:
#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 XWikiStoreInterfaceparametrizedSqlClause - 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 XWikiStoreInterfaceXWikiExceptionpublic List<DocumentReference> searchDocumentReferences(String wheresql, XWikiContext context) throws XWikiException
searchDocumentReferences in interface XWikiStoreInterfaceXWikiExceptionpublic List<String> searchDocumentsNames(String wheresql, XWikiContext context) throws XWikiException
searchDocumentsNames in interface XWikiStoreInterfaceXWikiExceptionpublic List<DocumentReference> searchDocumentReferences(String wheresql, int nb, int start, XWikiContext context) throws XWikiException
searchDocumentReferences in interface XWikiStoreInterfaceXWikiExceptionpublic List<String> searchDocumentsNames(String wheresql, int nb, int start, XWikiContext context) throws XWikiException
searchDocumentsNames in interface XWikiStoreInterfaceXWikiExceptionpublic List<DocumentReference> searchDocumentReferences(String wheresql, int nb, int start, String selectColumns, XWikiContext context) throws XWikiException
searchDocumentReferences in interface XWikiStoreInterfaceXWikiExceptionpublic List<String> searchDocumentsNames(String wheresql, int nb, int start, String selectColumns, XWikiContext context) throws XWikiException
searchDocumentsNames in interface XWikiStoreInterfaceXWikiExceptionpublic <T> List<T> search(String sql, int nb, int start, XWikiContext context) throws XWikiException
XWikiStoreInterfacesearch in interface XWikiStoreInterfacesql - 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
XWikiStoreInterfaceExecute 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 XWikiStoreInterfacesql - 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
XWikiStoreInterfacesearch in interface XWikiStoreInterfacesql - 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
XWikiStoreInterfaceExecute 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 XWikiStoreInterfacesql - 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
XWikiExceptionpublic int countDocuments(String wheresql, XWikiContext context) throws XWikiException
XWikiStoreInterfacecountDocuments in interface XWikiStoreInterfacewheresql - 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
XWikiStoreInterfacecountDocuments in interface XWikiStoreInterfaceparametrizedSqlClause - 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
XWikiStoreInterfacesearchDocuments in interface XWikiStoreInterfacewheresql - 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
XWikiStoreInterfaceSearch 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 XWikiStoreInterfacewheresql - 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 XWikiStoreInterfacepublic boolean isCustomMappingValid(BaseClass bclass, String custommapping1)
isCustomMappingValid in interface XWikiStoreInterfacepublic void injectCustomMappings(XWikiContext context) throws XWikiException
injectCustomMappings in interface XWikiStoreInterfaceXWikiExceptionpublic void injectUpdatedCustomMappings(XWikiContext context) throws XWikiException
injectUpdatedCustomMappings in interface XWikiStoreInterfaceXWikiExceptionpublic org.hibernate.SessionFactory injectCustomMappingsInSessionFactory(BaseClass bclass, XWikiContext context) throws XWikiException
XWikiExceptionpublic org.hibernate.SessionFactory injectCustomMappingsInSessionFactory(XWikiContext inputxcontext) throws XWikiException
XWikiExceptionpublic boolean injectCustomMappings(XWikiDocument doc, XWikiContext inputxcontext) throws XWikiException
injectCustomMappings in interface XWikiStoreInterfaceXWikiExceptionpublic 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 XWikiStoreInterfaceXWikiExceptionpublic boolean injectCustomMapping(BaseClass doc1class) throws XWikiException
injectCustomMapping in interface XWikiStoreInterfaceXWikiExceptionpublic List<String> getCustomMappingPropertyList(BaseClass bclass)
getCustomMappingPropertyList in interface XWikiStoreInterfacepublic List<XWikiDocument> searchDocuments(String wheresql, XWikiContext context) throws XWikiException
XWikiStoreInterfacesearchDocuments in interface XWikiStoreInterfacewheresql - 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
XWikiStoreInterfaceSearch 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 XWikiStoreInterfacewheresql - 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
XWikiStoreInterfacesearchDocuments in interface XWikiStoreInterfacewheresql - 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
XWikiStoreInterfacesearchDocuments in interface XWikiStoreInterfacewheresql - 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
XWikiStoreInterfacesearchDocuments in interface XWikiStoreInterfacewheresql - 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
XWikiStoreInterfaceSearch 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 XWikiStoreInterfacewheresql - 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
XWikiStoreInterfacesearchDocuments in interface XWikiStoreInterfacewheresql - 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
XWikiStoreInterfacesearchDocuments in interface XWikiStoreInterfacewheresql - 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
XWikiStoreInterfacesearchDocuments in interface XWikiStoreInterfacewheresql - 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
XWikiStoreInterfaceSearch 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 XWikiStoreInterfacewheresql - 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 XWikiStoreInterfaceXWikiExceptionpublic QueryManager getQueryManager()
getQueryManager in interface XWikiStoreInterfacepublic int getLimitSize(XWikiContext context, Class<?> entityType, String propertyName)
XWikiStoreInterfacegetLimitSize in interface XWikiStoreInterfacecontext - 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.