@Target(value=TYPE) @Retention(value=RUNTIME) @Documented @Inherited @Import(value=JdbcDatastoreRegistrar.class) @EnableDatastoreConfiguration public @interface EnableJdbcDatastore
Datastore
.JdbcDatastore
Modifier and Type | Fields and Description |
---|---|
static String |
DEFAULT_DATASTORE_BEAN_NAME
Default
Datastore registration bean name. |
Modifier and Type | Optional Element and Description |
---|---|
String |
dataContextId
Optional data context id to use to discriminate Datastores when more than one persistence source is configured,
i.e. when multiple DataSources are configured in context.
|
String |
dataSourceReference
Configures the name of the
DataSource bean definition to be used to create the Datastore
registered using this annotation. |
IdentifierResolutionStrategy |
identifierResolutionStrategy
Set the
IdentifierResolutionStrategy to use to resolve PropertyBox identifiers. |
com.holonplatform.jdbc.DatabasePlatform |
platform
Set the database platform using the
DatabasePlatform enumeration. |
com.holonplatform.spring.PrimaryMode |
primary
Whether to qualify
Datastore bean as primary , i.e. the preferential bean to be injected in a
single-valued dependency when multiple candidates are present. |
boolean |
transactional
Get whether to add
Transactional behaviour to transactional Datastore methods, to automatically
create or partecipate in a transaction when methods are invoked. |
public static final String DEFAULT_DATASTORE_BEAN_NAME
Datastore
registration bean name.public abstract String dataContextId
The configured data context id will be returned by the DataContextBound.getDataContextId()
method of the
registered Datastore
.
When a data context id is specified, the registered Datastore is bound to the DataSource
with a matching
data context id, if available. During registration phase, if the data context id is not null/empty and a
dataSourceReference()
is not specified, an DataSource bean is searched in context using the bean name
pattern: dataSource_[datacontextid]
where [datacontextid]
is equal to
dataContextId()
attribute.
public abstract String dataSourceReference
DataSource
bean definition to be used to create the Datastore
registered using this annotation. See dataContextId()
for informations about DataSource bean lookup when
a specific name is not configured.DataSource
bean definition to be used to create the Datastore
public abstract com.holonplatform.jdbc.DatabasePlatform platform
DatabasePlatform
enumeration.
If specified, can be used by the JDBC datastore to auto-dectect a suitable dialect. When not specified, it will be auto-detected using the JDBC connection URL.
DatabasePlatform.NONE
if not specifiedpublic abstract com.holonplatform.spring.PrimaryMode primary
Datastore
bean as primary
, i.e. the preferential bean to be injected in a
single-valued dependency when multiple candidates are present.
When mode is PrimaryMode.AUTO
, the registred Datastore bean is marked as primary only when the
DataSource
bean to which is bound is registered as primary bean.
PrimaryMode.AUTO
public abstract boolean transactional
Transactional
behaviour to transactional Datastore
methods, to automatically
create or partecipate in a transaction when methods are invoked. Affected methods are:
Datastore.refresh(com.holonplatform.core.datastore.DataTarget, com.holonplatform.core.property.PropertyBox)
Datastore#insert(com.holonplatform.core.datastore.DataTarget, com.holonplatform.core.property.PropertyBox, com.holonplatform.core.datastore.Datastore.WriteOption...)
Datastore#update(com.holonplatform.core.datastore.DataTarget, com.holonplatform.core.property.PropertyBox, com.holonplatform.core.datastore.Datastore.WriteOption...)
Datastore#save(com.holonplatform.core.datastore.DataTarget, com.holonplatform.core.property.PropertyBox, com.holonplatform.core.datastore.Datastore.WriteOption...)
Datastore#delete(com.holonplatform.core.datastore.DataTarget, com.holonplatform.core.property.PropertyBox, com.holonplatform.core.datastore.Datastore.WriteOption...)
Transactional
behaviour to transactional datastore methods. Defaults to
true
.public abstract IdentifierResolutionStrategy identifierResolutionStrategy
IdentifierResolutionStrategy
to use to resolve PropertyBox
identifiers.IdentifierResolutionStrategy
Copyright © 2019 The Holon Platform. All rights reserved.