@Component(roles=XWikiStoreInterface.class) @Named(value="cache") @InstantiationStrategy(value=PER_LOOKUP) public class XWikiCacheStore extends com.xpn.xwiki.internal.store.AbstractXWikiStore implements XWikiCacheStoreInterface, org.xwiki.observation.EventListener, org.xwiki.component.phase.Initializable
Constructor and Description |
---|
XWikiCacheStore()
Default constructor generally used by the Component Manager.
|
XWikiCacheStore(XWikiStoreInterface store,
XWikiContext context)
Deprecated.
since 10.2 and 9.11.4, should be used as a component instead
|
Modifier and Type | Method and Description |
---|---|
void |
cleanUp(XWikiContext context) |
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.
|
void |
createWiki(String wikiName,
XWikiContext context)
Allows to create a new wiki database and initialize the default tables.
|
void |
deleteLinks(long docId,
XWikiContext context,
boolean bTransaction) |
void |
deleteLock(XWikiLock lock,
XWikiContext context,
boolean bTransaction) |
void |
deleteWiki(String wikiName,
XWikiContext context)
Delete a wiki database.
|
void |
deleteXWikiDoc(XWikiDocument doc,
XWikiContext inputxcontext) |
boolean |
exists(XWikiDocument doc,
XWikiContext inputxcontext) |
void |
flushCache() |
org.xwiki.cache.Cache<XWikiDocument> |
getCache() |
List<String> |
getClassList(XWikiContext context) |
List<String> |
getCustomMappingPropertyList(BaseClass bclass) |
List<org.xwiki.observation.event.Event> |
getEvents() |
String |
getKey(String wiki,
String fullName,
String language)
Deprecated.
since 4.0M1, use
XWikiDocument.getKey() |
String |
getKey(String fullName,
String language,
XWikiContext context)
Deprecated.
since 4.0M1, use
XWikiDocument.getKey() |
String |
getKey(XWikiDocument doc)
Deprecated.
since 4.0M1, use
XWikiDocument.getKey() |
String |
getKey(XWikiDocument doc,
XWikiContext context) |
int |
getLimitSize(XWikiContext context,
Class<?> entityType,
String propertyName)
Get the limit size of a property.
|
org.xwiki.cache.Cache<Integer> |
getLimitSizePropertyCache() |
String |
getName() |
org.xwiki.cache.Cache<Boolean> |
getPageExistCache() |
QueryManager |
getQueryManager() |
XWikiStoreInterface |
getStore() |
List<String> |
getTranslationList(XWikiDocument doc,
XWikiContext context) |
void |
initCache(int capacity,
int pageExistCacheCapacity,
XWikiContext context)
Deprecated.
|
void |
initCache(XWikiContext context)
Deprecated.
|
void |
initialize() |
boolean |
injectCustomMapping(BaseClass doc1class,
XWikiContext context) |
void |
injectCustomMappings(XWikiContext context) |
boolean |
injectCustomMappings(XWikiDocument doc,
XWikiContext context) |
void |
injectUpdatedCustomMappings(XWikiContext context) |
boolean |
isCustomMappingValid(BaseClass bclass,
String custommapping1,
XWikiContext context) |
boolean |
isWikiNameAvailable(String wikiName,
XWikiContext context)
Indicate if the provided wiki name could be used to create a new wiki.
|
List<DocumentReference> |
loadBacklinks(DocumentReference documentReference,
boolean bTransaction,
XWikiContext context) |
List<String> |
loadBacklinks(String fullName,
XWikiContext context,
boolean bTransaction) |
List<XWikiLink> |
loadLinks(long docId,
XWikiContext context,
boolean bTransaction) |
XWikiLock |
loadLock(long docId,
XWikiContext context,
boolean bTransaction) |
XWikiDocument |
loadXWikiDoc(XWikiDocument doc,
XWikiContext inputxcontext) |
void |
onEvent(org.xwiki.observation.event.Event event,
Object source,
Object data) |
void |
renameXWikiDoc(XWikiDocument doc,
DocumentReference newReference,
XWikiContext inputxcontext)
Atomic operation for renaming a document.
|
void |
saveLinks(XWikiDocument doc,
XWikiContext context,
boolean bTransaction) |
void |
saveLock(XWikiLock lock,
XWikiContext context,
boolean bTransaction) |
void |
saveXWikiDoc(XWikiDocument doc,
XWikiContext context) |
void |
saveXWikiDoc(XWikiDocument doc,
XWikiContext inputxcontext,
boolean bTransaction) |
<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 context)
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 context)
Search documents in the storing system.
|
List<XWikiDocument> |
searchDocuments(String wheresql,
boolean distinctbyname,
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 distinctbyname,
boolean customMapping,
int nb,
int start,
XWikiContext context)
Search documents in the storing system.
|
List<XWikiDocument> |
searchDocuments(String wheresql,
boolean distinctbyname,
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 distinctbyname,
int nb,
int start,
XWikiContext context)
Search documents in the storing system.
|
List<XWikiDocument> |
searchDocuments(String wheresql,
boolean distinctbyname,
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) |
void |
setCache(org.xwiki.cache.Cache<XWikiDocument> cache) |
void |
setPageExistCache(org.xwiki.cache.Cache<Boolean> pageExistCache) |
void |
setStore(XWikiStoreInterface store) |
getExecutionXContext, restoreExecutionXContext
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
injectCustomMapping, isCustomMappingValid
public XWikiCacheStore()
public XWikiCacheStore(XWikiStoreInterface store, XWikiContext context) throws XWikiException
XWikiException
public void initialize() throws org.xwiki.component.phase.InitializationException
initialize
in interface org.xwiki.component.phase.Initializable
org.xwiki.component.phase.InitializationException
public String getName()
getName
in interface org.xwiki.observation.EventListener
public List<org.xwiki.observation.event.Event> getEvents()
getEvents
in interface org.xwiki.observation.EventListener
@Deprecated public void initCache(XWikiContext context) throws XWikiException
XWikiException
@Deprecated public void initCache(int capacity, int pageExistCacheCapacity, XWikiContext context) throws XWikiException
initCache
in interface XWikiCacheStoreInterface
XWikiException
public XWikiStoreInterface getStore()
getStore
in interface XWikiCacheStoreInterface
public void setStore(XWikiStoreInterface store)
setStore
in interface XWikiCacheStoreInterface
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
XWikiStoreInterface
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 void saveXWikiDoc(XWikiDocument doc, XWikiContext inputxcontext, boolean bTransaction) throws XWikiException
saveXWikiDoc
in interface XWikiStoreInterface
XWikiException
public void flushCache()
flushCache
in interface XWikiCacheStoreInterface
public void onEvent(org.xwiki.observation.event.Event event, Object source, Object data)
onEvent
in interface org.xwiki.observation.EventListener
@Deprecated public String getKey(XWikiDocument doc)
XWikiDocument.getKey()
public String getKey(XWikiDocument doc, XWikiContext context)
@Deprecated public String getKey(String fullName, String language, XWikiContext context)
XWikiDocument.getKey()
@Deprecated public String getKey(String wiki, String fullName, String language)
XWikiDocument.getKey()
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
public List<String> getClassList(XWikiContext context) throws XWikiException
getClassList
in interface XWikiStoreInterface
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 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 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 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 boolean isCustomMappingValid(BaseClass bclass, String custommapping1, XWikiContext context) throws XWikiException
isCustomMappingValid
in interface XWikiStoreInterface
XWikiException
public boolean injectCustomMapping(BaseClass doc1class, XWikiContext context) throws XWikiException
injectCustomMapping
in interface XWikiStoreInterface
XWikiException
public boolean injectCustomMappings(XWikiDocument doc, XWikiContext context) throws XWikiException
injectCustomMappings
in interface XWikiStoreInterface
XWikiException
public List<XWikiDocument> searchDocuments(String wheresql, boolean distinctbyname, 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))
distinctbyname
- 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 distinctbyname, 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))
distinctbyname
- 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, boolean distinctbyname, 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))
distinctbyname
- 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 distinctbyname, 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))
distinctbyname
- 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, 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, 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, boolean distinctbyname, 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))
distinctbyname
- 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, 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, 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, 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<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, boolean customMapping, boolean checkRight, 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.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 (?).context
- the XWiki context required for getting information about the execution context.XWikiException
- in case of error while performing 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 XWikiLock loadLock(long docId, XWikiContext context, boolean bTransaction) throws XWikiException
loadLock
in interface XWikiStoreInterface
XWikiException
public void saveLock(XWikiLock lock, XWikiContext context, boolean bTransaction) throws XWikiException
saveLock
in interface XWikiStoreInterface
XWikiException
public void deleteLock(XWikiLock lock, XWikiContext context, boolean bTransaction) throws XWikiException
deleteLock
in interface XWikiStoreInterface
XWikiException
public List<XWikiLink> loadLinks(long docId, XWikiContext context, boolean bTransaction) throws XWikiException
loadLinks
in interface XWikiStoreInterface
XWikiException
public List<DocumentReference> loadBacklinks(DocumentReference documentReference, boolean bTransaction, XWikiContext context) throws XWikiException
loadBacklinks
in interface XWikiStoreInterface
XWikiException
public List<String> loadBacklinks(String fullName, XWikiContext context, boolean bTransaction) throws XWikiException
loadBacklinks
in interface XWikiStoreInterface
XWikiException
public void saveLinks(XWikiDocument doc, XWikiContext context, boolean bTransaction) throws XWikiException
saveLinks
in interface XWikiStoreInterface
XWikiException
public void deleteLinks(long docId, XWikiContext context, boolean bTransaction) throws XWikiException
deleteLinks
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, 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, 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, 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.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 (?).context
- the XWiki context required for getting information about the execution context.XWikiException
- in case of error while performing the query.public void cleanUp(XWikiContext context)
cleanUp
in interface XWikiStoreInterface
public boolean isWikiNameAvailable(String wikiName, XWikiContext context) throws XWikiException
XWikiStoreInterface
isWikiNameAvailable
in interface XWikiStoreInterface
wikiName
- the name of the wiki.context
- the XWiki context.XWikiException
- error when looking if wiki name already used.public void createWiki(String wikiName, XWikiContext context) throws XWikiException
XWikiStoreInterface
createWiki
in interface XWikiStoreInterface
wikiName
- the name of the new wiki.context
- the XWiki context.XWikiException
- error when creating new wiki.public void deleteWiki(String wikiName, XWikiContext context) throws XWikiException
XWikiStoreInterface
deleteWiki
in interface XWikiStoreInterface
wikiName
- the name of the wiki.context
- the XWiki context.XWikiException
- error when deleting wiki database.public boolean exists(XWikiDocument doc, XWikiContext inputxcontext) throws XWikiException
exists
in interface XWikiStoreInterface
XWikiException
public org.xwiki.cache.Cache<XWikiDocument> getCache()
public void setCache(org.xwiki.cache.Cache<XWikiDocument> cache)
public org.xwiki.cache.Cache<Boolean> getPageExistCache()
public void setPageExistCache(org.xwiki.cache.Cache<Boolean> pageExistCache)
public org.xwiki.cache.Cache<Integer> getLimitSizePropertyCache()
public List<String> getCustomMappingPropertyList(BaseClass bclass)
getCustomMappingPropertyList
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 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.