public class DocumentConvention extends Convention implements Serializable
Modifier and Type | Class and Description |
---|---|
static interface |
DocumentConvention.TryConvertValueForQueryDelegate<T> |
identityPartsSeparator
Constructor and Description |
---|
DocumentConvention() |
Modifier and Type | Method and Description |
---|---|
DocumentConvention |
clone()
Clone the current conventions to a new instance
|
JsonSerializer |
createSerializer() |
String |
defaultFindFullDocumentKeyFromNonStringIdentifier(Object id,
Class<?> type,
boolean allowNull)
Find the full document name assuming that we are using the standard conventions
for generating a document key
|
static String |
defaultTransformTypeTagNameToDocumentKeyPrefix(String typeTagName) |
static String |
defaultTypeTagName(Class<?> t)
Get the default tag name for the specified type.
|
String |
generateDocumentKey(String dbName,
IDatabaseCommands databaseCommands,
Object entity)
Generates the document key.
|
static String |
generateDocumentKeyUsingIdentity(DocumentConvention conventions,
Object entity)
Generates the document key using identity.
|
ConsistencyOptions |
getDefaultQueryingConsistency()
The consistency options used when querying the database by default
|
SortOptions |
getDefaultSortOption(Class<?> clazz) |
SortOptions |
getDefaultSortOption(String typeName) |
DocumentKeyGenerator |
getDocumentKeyGenerator()
Gets the document key generator.
|
String |
getDynamicTagName(Object entity) |
DocumentKeyFinder |
getFindFullDocumentKeyFromNonStringIdentifier()
Gets the function to find the full document key based on the type of a document
and the value type identifier (just the numeric part of the id).
|
IdentityPropertyNameFinder |
getFindIdentityPropertyNameFromEntityName()
Get the function to get the identity property name from the entity name
|
IdValuePartFinder |
getFindIdValuePartForValueTypeConversion()
When RavenDB needs to convert between a string id to a value type like int or uuid, it calls
this to perform the actual work
|
JavaClassFinder |
getFindJavaClass()
Gets the function to find the java class of a document.
|
JavaClassNameFinder |
getFindJavaClassName()
Gets the function to find the java class name from a java class
|
PropertyNameFinder |
getFindPropertyNameForDynamicIndex()
Gets the function to find the indexed property name
given the indexed document type, the index name, the current path and the property path.
|
PropertyNameFinder |
getFindPropertyNameForIndex()
Gets the function to find the indexed property name
given the indexed document type, the index name, the current path and the property path.
|
TypeTagNameFinder |
getFindTypeTagName()
Gets the function to find the type tag.
|
String |
getIdentityPartsSeparator()
Gets the identity parts separator used by the HiLo generators
|
List<ITypeConverter> |
getIdentityTypeConvertors()
A list of type converters that can be used to translate the document key (string)
to whatever type it is that is used on the entity, if the type isn't already a string
|
EnumSet<IndexAndTransformerReplicationMode> |
getIndexAndTransformerReplicationMode() |
String |
getJavaClass(String id,
RavenJObject document,
RavenJObject metadata)
Get the java class (if exists) from the document
|
String |
getJavaClassName(Class<?> entityType)
Get the java class name to be stored in the entity metadata
|
org.codehaus.jackson.map.DeserializationProblemHandler |
getJsonContractResolver() |
int |
getMaxLengthOfQueryUsingGetUrl() |
int |
getMaxNumberOfRequestsPerSession()
Gets the default max number of requests per session.
|
ReplicationInformerFactory |
getReplicationInformerFactory()
This is called to provide replication behavior for the client.
|
TypeTagNameToDocumentKeyPrefixTransformer |
getTransformTypeTagNameToDocumentKeyPrefix()
Translate the type tag name to the document key prefix
|
String |
getTypeTagName(Class<?> type)
Gets the name of the type tag.
|
boolean |
isAcceptGzipContent() |
boolean |
isAllowQueriesOnId()
Whatever to allow queries on document id.
|
boolean |
isDefaultUseOptimisticConcurrency() |
boolean |
isDisableProfiling()
Disable all profiling support
|
boolean |
isPreserveDocumentPropertiesNotFoundOnModel() |
boolean |
isShouldAggressiveCacheTrackChanges()
Whatever or not RavenDB should in the aggressive cache mode use Changes API to track
changes and rebuild the cache.
|
boolean |
isShouldSaveChangesForceAggressiveCacheCheck()
Whatever or not RavenDB should in the aggressive cache mode should force the aggressive cache
to check with the server after we called SaveChanges() on a non empty data set.
|
boolean |
isUseParallelMultiGet()
Instruct RavenDB to parallel Multi Get processing
when handling lazy requests
|
<TEntity> DocumentConvention |
registerIdConvention(Class<TEntity> type,
IdConvention func)
Register an id convention for a single type (and all of its derived types.
|
<T> void |
registerQueryValueConverter(DocumentConvention.TryConvertValueForQueryDelegate<T> converter) |
<T> void |
registerQueryValueConverter(DocumentConvention.TryConvertValueForQueryDelegate<T> converter,
SortOptions defaultSortOption) |
<T> void |
registerQueryValueConverter(DocumentConvention.TryConvertValueForQueryDelegate<T> converter,
SortOptions defaultSortOption,
boolean usesRangeField) |
void |
setAcceptGzipContent(boolean acceptGzipContent) |
void |
setAllowQueriesOnId(boolean allowQueriesOnId)
Whatever to allow queries on document id.
|
void |
setDefaultQueryingConsistency(ConsistencyOptions defaultQueryingConsistency)
The consistency options used when querying the database by default
|
void |
setDefaultUseOptimisticConcurrency(boolean defaultUseOptimisticConcurrency) |
void |
setDisableProfiling(boolean b)
Disable all profiling support
|
void |
setDocumentKeyGenerator(DocumentKeyGenerator documentKeyGenerator)
Sets the document key generator.
|
void |
setFindFullDocumentKeyFromNonStringIdentifier(DocumentKeyFinder findFullDocumentKeyFromNonStringIdentifier)
Sets the function to find the full document key based on the type of a document
and the value type identifier (just the numeric part of the id).
|
void |
setFindIdentityPropertyNameFromEntityName(IdentityPropertyNameFinder findIdentityPropertyNameFromEntityName)
Sets the function to get the identity property name from the entity name
|
void |
setFindIdValuePartForValueTypeConversion(IdValuePartFinder findIdValuePartForValueTypeConversion)
When RavenDB needs to convert between a string id to a value type like int or uuid, it calls
this to perform the actual work
|
void |
setFindJavaClass(JavaClassFinder findJavaClass)
Sets the function to find the java class of a document.
|
void |
setFindJavaClassName(JavaClassNameFinder findJavaClassName)
Sets the function to find the java class name from a java class
|
void |
setFindPropertyNameForDynamicIndex(PropertyNameFinder findPropertyNameForDynamicIndex)
Sets the function to find the indexed property name
given the indexed document type, the index name, the current path and the property path.
|
void |
setFindPropertyNameForIndex(PropertyNameFinder findPropertyNameForIndex)
Sets the function to find the indexed property name
given the indexed document type, the index name, the current path and the property path.
|
void |
setFindTypeTagName(TypeTagNameFinder findTypeTagName)
Sets the function to find the type tag.
|
void |
setIdentityPartsSeparator(String identityPartsSeparator)
Sets the identity parts separator used by the HiLo generators
|
void |
setIdentityTypeConvertors(List<ITypeConverter> identityTypeConvertors)
A list of type converters that can be used to translate the document key (string)
to whatever type it is that is used on the entity, if the type isn't already a string
|
void |
setIndexAndTransformerReplicationMode(EnumSet<IndexAndTransformerReplicationMode> indexAndTransformerReplicationMode) |
void |
setJsonContractResolver(org.codehaus.jackson.map.DeserializationProblemHandler jsonContractResolver) |
void |
setMaxLengthOfQueryUsingGetUrl(int maxLengthOfQueryUsingGetUrl) |
void |
setMaxNumberOfRequestsPerSession(int maxNumberOfRequestsPerSession)
Sets the default max number of requests per session.
|
void |
setPreserveDocumentPropertiesNotFoundOnModel(boolean preserveDocumentPropertiesNotFoundOnModel)
Controls whatever properties on the object that weren't de-serialized to object properties
will be preserved when saving the document again.
|
void |
setReplicationInformerFactory(ReplicationInformerFactory replicationInformerFactory) |
void |
setShouldAggressiveCacheTrackChanges(boolean shouldAggressiveCacheTrackChanges)
Whatever or not RavenDB should in the aggressive cache mode use Changes API to track
changes and rebuild the cache.
|
void |
setShouldSaveChangesForceAggressiveCacheCheck(boolean shouldSaveChangesForceAggressiveCacheCheck)
Whatever or not RavenDB should in the aggressive cache mode should force the aggressive cache
to check with the server after we called SaveChanges() on a non empty data set.
|
void |
setTransformTypeTagNameToDocumentKeyPrefix(TypeTagNameToDocumentKeyPrefixTransformer transformTypeTagNameToDocumentKeyPrefix)
Translate the type tag name to the document key prefix
|
void |
setUseParallelMultiGet(boolean useParallelMultiGet)
Instruct RavenDB to parallel Multi Get processing
when handling lazy requests
|
boolean |
tryConvertValueForQuery(String fieldName,
Object value,
QueryValueConvertionType convertionType,
Reference<String> strValue) |
boolean |
usesRangeType(Object o) |
getFailoverBehavior, getFailoverBehaviorWithoutFlags, getFindIdentityProperty, getHandleForbiddenResponse, getHandleUnauthorizedResponse, getIdentityProperty, getShouldCacheRequest, handleForbiddenResponse, handleUnauthorizedResponse, isSaveEnumsAsIntegers, registerCustomQueryTranslator, setFailoverBehavior, setFindIdentityProperty, setHandleForbiddenResponse, setHandleUnauthorizedResponse, setSaveEnumsAsIntegers, setShouldCacheRequest, shouldCacheRequest, translateCustomQueryExpression, updateFrom
public static String defaultTransformTypeTagNameToDocumentKeyPrefix(String typeTagName)
public String defaultFindFullDocumentKeyFromNonStringIdentifier(Object id, Class<?> type, boolean allowNull)
id
- type
- allowNull
- public boolean isDisableProfiling()
public void setDisableProfiling(boolean b)
b
- public List<ITypeConverter> getIdentityTypeConvertors()
public org.codehaus.jackson.map.DeserializationProblemHandler getJsonContractResolver()
public void setJsonContractResolver(org.codehaus.jackson.map.DeserializationProblemHandler jsonContractResolver)
public void setIdentityTypeConvertors(List<ITypeConverter> identityTypeConvertors)
identityTypeConvertors
- public String getIdentityPartsSeparator()
public void setIdentityPartsSeparator(String identityPartsSeparator)
identityPartsSeparator
- public int getMaxNumberOfRequestsPerSession()
public void setMaxNumberOfRequestsPerSession(int maxNumberOfRequestsPerSession)
maxNumberOfRequestsPerSession
- public boolean isAllowQueriesOnId()
public void setAllowQueriesOnId(boolean allowQueriesOnId)
allowQueriesOnId
- public ConsistencyOptions getDefaultQueryingConsistency()
public void setDefaultQueryingConsistency(ConsistencyOptions defaultQueryingConsistency)
defaultQueryingConsistency
- public static String generateDocumentKeyUsingIdentity(DocumentConvention conventions, Object entity)
conventions
- entity
- public static String defaultTypeTagName(Class<?> t)
t
- public String getTypeTagName(Class<?> type)
type
- public String generateDocumentKey(String dbName, IDatabaseCommands databaseCommands, Object entity)
dbName
- Name of the databasedatabaseCommands
- Low level database commands.entity
- The entity.public JavaClassFinder getFindJavaClass()
public void setFindJavaClass(JavaClassFinder findJavaClass)
findJavaClass
- public JavaClassNameFinder getFindJavaClassName()
public void setFindJavaClassName(JavaClassNameFinder findJavaClassName)
findJavaClassName
- public DocumentKeyFinder getFindFullDocumentKeyFromNonStringIdentifier()
public void setFindFullDocumentKeyFromNonStringIdentifier(DocumentKeyFinder findFullDocumentKeyFromNonStringIdentifier)
findFullDocumentKeyFromNonStringIdentifier
- public TypeTagNameFinder getFindTypeTagName()
public void setFindTypeTagName(TypeTagNameFinder findTypeTagName)
findTypeTagName
- public PropertyNameFinder getFindPropertyNameForIndex()
public void setFindPropertyNameForIndex(PropertyNameFinder findPropertyNameForIndex)
findPropertyNameForIndex
- public PropertyNameFinder getFindPropertyNameForDynamicIndex()
public void setFindPropertyNameForDynamicIndex(PropertyNameFinder findPropertyNameForDynamicIndex)
findPropertyNameForDynamicIndex
- public IdentityPropertyNameFinder getFindIdentityPropertyNameFromEntityName()
public void setFindIdentityPropertyNameFromEntityName(IdentityPropertyNameFinder findIdentityPropertyNameFromEntityName)
findIdentityPropertyNameFromEntityName
- public DocumentKeyGenerator getDocumentKeyGenerator()
public void setDocumentKeyGenerator(DocumentKeyGenerator documentKeyGenerator)
documentKeyGenerator
- public boolean isShouldAggressiveCacheTrackChanges()
public void setShouldAggressiveCacheTrackChanges(boolean shouldAggressiveCacheTrackChanges)
shouldAggressiveCacheTrackChanges
- public boolean isShouldSaveChangesForceAggressiveCacheCheck()
shouldAggressiveCacheTrackChanges
public void setShouldSaveChangesForceAggressiveCacheCheck(boolean shouldSaveChangesForceAggressiveCacheCheck)
shouldAggressiveCacheTrackChanges
shouldSaveChangesForceAggressiveCacheCheck
- public void setUseParallelMultiGet(boolean useParallelMultiGet)
useParallelMultiGet
- public <TEntity> DocumentConvention registerIdConvention(Class<TEntity> type, IdConvention func)
public String getJavaClass(String id, RavenJObject document, RavenJObject metadata)
id
- document
- metadata
- public IdValuePartFinder getFindIdValuePartForValueTypeConversion()
public void setFindIdValuePartForValueTypeConversion(IdValuePartFinder findIdValuePartForValueTypeConversion)
findIdValuePartForValueTypeConversion
- public TypeTagNameToDocumentKeyPrefixTransformer getTransformTypeTagNameToDocumentKeyPrefix()
public void setTransformTypeTagNameToDocumentKeyPrefix(TypeTagNameToDocumentKeyPrefixTransformer transformTypeTagNameToDocumentKeyPrefix)
transformTypeTagNameToDocumentKeyPrefix
- public void setReplicationInformerFactory(ReplicationInformerFactory replicationInformerFactory)
public String getJavaClassName(Class<?> entityType)
public DocumentConvention clone()
public boolean isUseParallelMultiGet()
public ReplicationInformerFactory getReplicationInformerFactory()
public <T> void registerQueryValueConverter(DocumentConvention.TryConvertValueForQueryDelegate<T> converter)
public <T> void registerQueryValueConverter(DocumentConvention.TryConvertValueForQueryDelegate<T> converter, SortOptions defaultSortOption)
public <T> void registerQueryValueConverter(DocumentConvention.TryConvertValueForQueryDelegate<T> converter, SortOptions defaultSortOption, boolean usesRangeField)
public boolean tryConvertValueForQuery(String fieldName, Object value, QueryValueConvertionType convertionType, Reference<String> strValue)
public SortOptions getDefaultSortOption(String typeName)
public SortOptions getDefaultSortOption(Class<?> clazz)
public boolean usesRangeType(Object o)
public JsonSerializer createSerializer()
public int getMaxLengthOfQueryUsingGetUrl()
public boolean isDefaultUseOptimisticConcurrency()
public void setDefaultUseOptimisticConcurrency(boolean defaultUseOptimisticConcurrency)
public void setMaxLengthOfQueryUsingGetUrl(int maxLengthOfQueryUsingGetUrl)
public EnumSet<IndexAndTransformerReplicationMode> getIndexAndTransformerReplicationMode()
public void setIndexAndTransformerReplicationMode(EnumSet<IndexAndTransformerReplicationMode> indexAndTransformerReplicationMode)
public boolean isPreserveDocumentPropertiesNotFoundOnModel()
public void setPreserveDocumentPropertiesNotFoundOnModel(boolean preserveDocumentPropertiesNotFoundOnModel)
preserveDocumentPropertiesNotFoundOnModel
- public boolean isAcceptGzipContent()
public void setAcceptGzipContent(boolean acceptGzipContent)
Copyright © 2016. All Rights Reserved.