public abstract class DocStoreBeanBaseAdapter<T> extends Object implements DocStoreBeanAdapter<T>
Constructor and Description |
---|
DocStoreBeanBaseAdapter(io.ebeaninternal.server.deploy.BeanDescriptor<T> desc,
io.ebeaninternal.server.deploy.meta.DeployBeanDescriptor<T> deploy) |
Modifier and Type | Method and Description |
---|---|
void |
applyPath(Query<T> query)
Apply the document structure to the query so that it fetches the required properties to build
the document (typically in JSON form).
|
DocumentMapping |
createDocMapping()
Create the document mapping.
|
abstract void |
deleteById(Object idValue,
DocStoreUpdateContext txn)
Process a delete by id of a given document.
|
FetchPath |
getEmbedded(String path)
Return the FetchPath for the embedded document.
|
FetchPath |
getEmbeddedManyRoot(String path)
For embedded 'many' properties we need a FetchPath relative to the root which is used to
build and replace the embedded list.
|
String |
getIndexName()
Return the index name for this bean type.
|
String |
getIndexType()
Return the index type for this bean type.
|
io.ebean.annotation.DocStoreMode |
getMode(io.ebeaninternal.server.core.PersistRequest.Type persistType,
io.ebean.annotation.DocStoreMode txnMode)
Determine and return how this persist type will be processed given the transaction mode.
|
String |
getQueueId()
Return the unique queueId for this bean type.
|
boolean |
hasEmbeddedInvalidation()
Return true if this bean type as embedded invalidate registered.
|
abstract void |
index(Object idValue,
T entityBean,
DocStoreUpdateContext txn)
Process an index event which is effectively an insert or update (or put).
|
abstract void |
insert(Object idValue,
io.ebeaninternal.server.core.PersistRequestBean<T> persistRequest,
DocStoreUpdateContext txn)
Process an insert persist request.
|
boolean |
isMapped()
Return true if this type is mapped for doc storage.
|
String |
rawProperty(String property)
Return an un-analysed property to use instead of the given property.
|
void |
registerInvalidationPath(String queueId,
String path,
Set<String> properties)
Register a doc store invalidation listener for the given bean type, path and properties.
|
void |
registerPaths()
Register invalidation paths for embedded documents.
|
abstract void |
update(Object idValue,
io.ebeaninternal.server.core.PersistRequestBean<T> persistRequest,
DocStoreUpdateContext txn)
Process an update persist request.
|
abstract void |
updateEmbedded(Object idValue,
String embeddedProperty,
String embeddedRawContent,
DocStoreUpdateContext txn)
Process an update of an embedded document.
|
void |
updateEmbedded(io.ebeaninternal.server.core.PersistRequestBean<T> request,
DocStoreUpdates docStoreUpdates)
Process the persist request adding any embedded/nested document invalidation to the docStoreUpdates.
|
public DocStoreBeanBaseAdapter(io.ebeaninternal.server.deploy.BeanDescriptor<T> desc, io.ebeaninternal.server.deploy.meta.DeployBeanDescriptor<T> deploy)
public boolean hasEmbeddedInvalidation()
DocStoreBeanAdapter
hasEmbeddedInvalidation
in interface DocStoreBeanAdapter<T>
public DocumentMapping createDocMapping()
DocStoreBeanAdapter
createDocMapping
in interface DocStoreBeanAdapter<T>
public String getIndexType()
DocStoreBeanAdapter
getIndexType
in interface BeanDocType<T>
getIndexType
in interface DocStoreBeanAdapter<T>
public String getIndexName()
DocStoreBeanAdapter
getIndexName
in interface BeanDocType<T>
getIndexName
in interface DocStoreBeanAdapter<T>
public void applyPath(Query<T> query)
DocStoreBeanAdapter
applyPath
in interface BeanDocType<T>
applyPath
in interface DocStoreBeanAdapter<T>
public String rawProperty(String property)
DocStoreBeanAdapter
For analysed properties that we want to sort on we will map the property to an additional 'raw' property that we can use for sorting etc.
rawProperty
in interface BeanDocType<T>
rawProperty
in interface DocStoreBeanAdapter<T>
public void registerPaths()
registerPaths
in interface DocStoreBeanAdapter<T>
public void registerInvalidationPath(String queueId, String path, Set<String> properties)
registerInvalidationPath
in interface DocStoreBeanAdapter<T>
public void updateEmbedded(io.ebeaninternal.server.core.PersistRequestBean<T> request, DocStoreUpdates docStoreUpdates)
DocStoreBeanAdapter
This is expected to check the specific properties to see what other documents they are nested in and register invalidation events based on that.
updateEmbedded
in interface DocStoreBeanAdapter<T>
request
- The persist requestdocStoreUpdates
- Invalidation events are registered to this docStoreUpdatespublic FetchPath getEmbedded(String path)
BeanDocType
getEmbedded
in interface BeanDocType<T>
public FetchPath getEmbeddedManyRoot(String path)
BeanDocType
getEmbeddedManyRoot
in interface BeanDocType<T>
public boolean isMapped()
DocStoreBeanAdapter
isMapped
in interface DocStoreBeanAdapter<T>
public String getQueueId()
DocStoreBeanAdapter
getQueueId
in interface DocStoreBeanAdapter<T>
public io.ebean.annotation.DocStoreMode getMode(io.ebeaninternal.server.core.PersistRequest.Type persistType, io.ebean.annotation.DocStoreMode txnMode)
DocStoreBeanAdapter
Some transactions (like bulk updates) might specifically turn off indexing for example.
getMode
in interface DocStoreBeanAdapter<T>
public abstract void deleteById(Object idValue, DocStoreUpdateContext txn) throws IOException
DocStoreBeanAdapter
deleteById
in interface BeanDocType<T>
deleteById
in interface DocStoreBeanAdapter<T>
IOException
public abstract void index(Object idValue, T entityBean, DocStoreUpdateContext txn) throws IOException
DocStoreBeanAdapter
index
in interface BeanDocType<T>
index
in interface DocStoreBeanAdapter<T>
IOException
public abstract void insert(Object idValue, io.ebeaninternal.server.core.PersistRequestBean<T> persistRequest, DocStoreUpdateContext txn) throws IOException
DocStoreBeanAdapter
insert
in interface DocStoreBeanAdapter<T>
IOException
public abstract void update(Object idValue, io.ebeaninternal.server.core.PersistRequestBean<T> persistRequest, DocStoreUpdateContext txn) throws IOException
DocStoreBeanAdapter
update
in interface DocStoreBeanAdapter<T>
IOException
public abstract void updateEmbedded(Object idValue, String embeddedProperty, String embeddedRawContent, DocStoreUpdateContext txn) throws IOException
DocStoreBeanAdapter
updateEmbedded
in interface BeanDocType<T>
updateEmbedded
in interface DocStoreBeanAdapter<T>
idValue
- the id of the bean effected by an embedded document updateembeddedProperty
- the path of the propertyembeddedRawContent
- the embedded content for this property in JSON formtxn
- the doc store transaction to use to process the updateIOException
Copyright © 2019. All rights reserved.