Class AbstractConnectedGenerator<T>
- java.lang.Object
-
- org.datanucleus.store.valuegenerator.AbstractGenerator<T>
-
- org.datanucleus.store.valuegenerator.AbstractConnectedGenerator<T>
-
- All Implemented Interfaces:
ValueGenerator<T>
public abstract class AbstractConnectedGenerator<T> extends AbstractGenerator<T>
Abstract representation of a ValueGenerator requiring a connection to a datastore. Builds on the base AbstractGenerator, providing datastore connection information. TODO Remove "properties" and pass in class+member so we can extract the precise definition for this generator directly
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
AbstractConnectedGenerator.ConnectionPreference
-
Field Summary
Fields Modifier and Type Field Description protected ValueGenerationConnectionProvider
connectionProvider
The means of connecting to the datastore.protected Properties
properties
Properties controlling the value generator behaviour.-
Fields inherited from class org.datanucleus.store.valuegenerator.AbstractGenerator
allocationSize, block, initialValue, name, storeMgr
-
Fields inherited from interface org.datanucleus.store.valuegenerator.ValueGenerator
PROPERTY_CATALOG_NAME, PROPERTY_CLASS_NAME, PROPERTY_COLUMN_NAME, PROPERTY_FIELD_NAME, PROPERTY_KEY_CACHE_SIZE, PROPERTY_KEY_DATABASE_CACHE_SIZE, PROPERTY_KEY_INITIAL_VALUE, PROPERTY_KEY_MAX_VALUE, PROPERTY_KEY_MIN_VALUE, PROPERTY_ROOT_CLASS_NAME, PROPERTY_SCHEMA_NAME, PROPERTY_SEQUENCE_NAME, PROPERTY_SEQUENCETABLE_CATALOG, PROPERTY_SEQUENCETABLE_NAME_COLUMN, PROPERTY_SEQUENCETABLE_NEXTVAL_COLUMN, PROPERTY_SEQUENCETABLE_SCHEMA, PROPERTY_SEQUENCETABLE_TABLE, PROPERTY_TABLE_NAME
-
-
Constructor Summary
Constructors Constructor Description AbstractConnectedGenerator(StoreManager storeMgr, String name, Properties props)
Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description AbstractConnectedGenerator.ConnectionPreference
getConnectionPreference()
Accessor for any requirement for connection used by this value generator.void
setConnectionProvider(ValueGenerationConnectionProvider provider)
Mutator for setting the connection provider.-
Methods inherited from class org.datanucleus.store.valuegenerator.AbstractGenerator
allocate, current, currentValue, getName, next, nextValue, obtainGenerationBlock, obtainGenerationBlock, reserveBlock, reserveBlock
-
-
-
-
Field Detail
-
connectionProvider
protected ValueGenerationConnectionProvider connectionProvider
The means of connecting to the datastore.
-
properties
protected Properties properties
Properties controlling the value generator behaviour.
-
-
Constructor Detail
-
AbstractConnectedGenerator
public AbstractConnectedGenerator(StoreManager storeMgr, String name, Properties props)
Constructor.- Parameters:
storeMgr
- Store Managername
- Symbolic name for the generatorprops
- Properties controlling the behaviour of the generator
-
-
Method Detail
-
setConnectionProvider
public void setConnectionProvider(ValueGenerationConnectionProvider provider)
Mutator for setting the connection provider.- Parameters:
provider
- The connection provider.
-
getConnectionPreference
public AbstractConnectedGenerator.ConnectionPreference getConnectionPreference()
Accessor for any requirement for connection used by this value generator. EXISTING means use the same connection as the ExecutionContext is using. NEW means use a new connection, and commit it after any operation. NONE means use NEW and allow override by the persistence property "datanucleus.valuegeneration.transactionAttribute".- Returns:
- The connection preference
-
-