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
  • Field Details

    • connectionProvider

      protected ValueGenerationConnectionProvider connectionProvider
      The means of connecting to the datastore.
    • properties

      protected Properties properties
      Properties controlling the value generator behaviour.
  • Constructor Details

    • AbstractConnectedGenerator

      public AbstractConnectedGenerator(StoreManager storeMgr, String name, Properties props)
      Constructor.
      Parameters:
      storeMgr - Store Manager
      name - Symbolic name for the generator
      props - Properties controlling the behaviour of the generator
  • Method Details

    • 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