Package org.apache.cayenne.configuration.runtime

# Class CoreModuleExtender

java.lang.Object
org.apache.cayenne.configuration.runtime.CoreModuleExtender

public class CoreModuleExtender extends Object
A builder of extensions for `CoreModule`.

Since:
  5.0
See Also:
  - `CoreModule.extend(Binder)`

- ## Constructor Summary

  Constructors
  Modifier
  Constructor
  Description
  `protected`
  `CoreModuleExtender(Binder binder)`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `CoreModuleExtender`
  `addAdapterDetector(Class<? extends DbAdapterDetector> adapterDetectorType)`
  Adds a custom DbAdapterDetector
  `CoreModuleExtender`
  `addAdapterDetector(DbAdapterDetector adapterDetector)`
  Adds a custom DbAdapterDetector
  `CoreModuleExtender`
  `addDefaultExtendedType(Class<? extends ExtendedType<?>> type)`
  Adds a default adapter-agnostic ExtendedType.
  `CoreModuleExtender`
  `addDefaultExtendedType(ExtendedType<?> type)`
  Adds a default adapter-agnostic ExtendedType.
  `CoreModuleExtender`
  `addExtendedTypeFactory(Class<? extends ExtendedTypeFactory> factoryType)`
  Adds an ExtendedTypeFactory used for dynamic extended type creation.
  `CoreModuleExtender`
  `addExtendedTypeFactory(ExtendedTypeFactory factory)`
  Adds an ExtendedTypeFactory used for dynamic extended type creation.
  `CoreModuleExtender`
  `addListener(Object listener)`
  Registers an annotated event listener.
  `CoreModuleExtender`
  `addListenerType(Class<?> listenerType)`
  Registers an annotated event listener of a given type
  `CoreModuleExtender`
  `addPkGenerator(Class<? extends DbAdapter> adapter, Class<? extends PkGenerator> pkGeneratorType)`
  Adds a custom PK generator per DbAdapter
  `CoreModuleExtender`
  `addPkGenerator(Class<? extends DbAdapter> adapter, PkGenerator pkGenerator)`
  Adds a custom PK generator per DbAdapter
  `CoreModuleExtender`
  `addProjectLocation(String location)`
  Adds a custom project location.
  `CoreModuleExtender`
  `addQueryFilter(Class<? extends DataChannelQueryFilter> queryFilterType)`
  Adds a custom query filter to the end of the existing filter list
  `CoreModuleExtender`
  `addQueryFilter(DataChannelQueryFilter queryFilter)`
  Adds a custom query filter to the end of the existing filter list
  `CoreModuleExtender`
  `addSyncFilter(Class<? extends DataChannelSyncFilter> syncFilterType)`
  Adds a custom sync filter.
  `CoreModuleExtender`
  `addSyncFilter(Class<? extends DataChannelSyncFilter> syncFilterType, boolean includeInTransaction)`
  Adds a custom sync filter.
  `CoreModuleExtender`
  `addSyncFilter(DataChannelSyncFilter syncFilter)`
  Adds a custom sync filter.
  `CoreModuleExtender`
  `addSyncFilter(DataChannelSyncFilter syncFilter, boolean includeInTransaction)`
  Adds a custom sync filter.
  `CoreModuleExtender`
  `addUserExtendedType(Class<? extends ExtendedType<?>> type)`
  Adds an adapter-agnostic ExtendedType.
  `CoreModuleExtender`
  `addUserExtendedType(ExtendedType<?> type)`
  Adds an adapter-agnostic ExtendedType.
  `CoreModuleExtender`
  `addValueObjectType(Class<? extends ValueObjectType<?,?>> type)`
  Adds a custom `ValueObjectType`.
  `CoreModuleExtender`
  `addValueObjectType(ValueObjectType<?,?> type)`
  Adds a custom `ValueObjectType`.
  `CoreModuleExtender`
  `externalTransactions()`
  Sets transaction management to either external.
  `protected CoreModuleExtender`
  `initAllExtensions()`
  `CoreModuleExtender`
  `setProperty(String key, Object value)`
  Sets Cayenne runtime property.
  `CoreModuleExtender`
  `snapshotCacheSize(int size)`
  Sets max size of snapshot cache.
  `CoreModuleExtender`
  `syncContexts()`
  Configures the stack to synchronize data between ObjectContexts.

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Constructor Details

  - ### CoreModuleExtender

    protected CoreModuleExtender(Binder binder)

- ## Method Details

  - ### initAllExtensions

    protected CoreModuleExtender initAllExtensions()

  - ### setProperty

    public CoreModuleExtender setProperty(String key, Object value)
    Sets Cayenne runtime property. Property names known to Cayenne are defined in the `Constants` interface.

  - ### syncContexts

    public CoreModuleExtender syncContexts()
    Configures the stack to synchronize data between ObjectContexts. This is false by default.

  - ### externalTransactions

    public CoreModuleExtender externalTransactions()
    Sets transaction management to either external. By default, transactions are internally managed by Cayenne.

  - ### snapshotCacheSize

    public CoreModuleExtender snapshotCacheSize(int size)
    Sets max size of snapshot cache.
    Parameters:
      `size` - max size of snapshot cache

  - ### addProjectLocation

    public CoreModuleExtender addProjectLocation(String location)
    Adds a custom project location.

  - ### addPkGenerator

    public CoreModuleExtender addPkGenerator(Class<? extends DbAdapter> adapter, PkGenerator pkGenerator)
    Adds a custom PK generator per DbAdapter

  - ### addPkGenerator

    public CoreModuleExtender addPkGenerator(Class<? extends DbAdapter> adapter, Class<? extends PkGenerator> pkGeneratorType)
    Adds a custom PK generator per DbAdapter

  - ### addQueryFilter

    public CoreModuleExtender addQueryFilter(DataChannelQueryFilter queryFilter)
    Adds a custom query filter to the end of the existing filter list

  - ### addQueryFilter

    public CoreModuleExtender addQueryFilter(Class<? extends DataChannelQueryFilter> queryFilterType)
    Adds a custom query filter to the end of the existing filter list

  - ### addSyncFilter

    public CoreModuleExtender addSyncFilter(DataChannelSyncFilter syncFilter)
    Adds a custom sync filter.

  - ### addSyncFilter

    public CoreModuleExtender addSyncFilter(Class<? extends DataChannelSyncFilter> syncFilterType)
    Adds a custom sync filter.

  - ### addSyncFilter

    public CoreModuleExtender addSyncFilter(DataChannelSyncFilter syncFilter, boolean includeInTransaction)
    Adds a custom sync filter. Depending on the "includeInTransaction" parameter value it is added either before or after the `TransactionFilter`.

  - ### addSyncFilter

    public CoreModuleExtender addSyncFilter(Class<? extends DataChannelSyncFilter> syncFilterType, boolean includeInTransaction)
    Adds a custom sync filter. Depending on the "includeInTransaction" parameter value it is added either before or after the `TransactionFilter`.

  - ### addListener

    public CoreModuleExtender addListener(Object listener)
    Registers an annotated event listener.

  - ### addListenerType

    public CoreModuleExtender addListenerType(Class<?> listenerType)
    Registers an annotated event listener of a given type

  - ### addAdapterDetector

    public CoreModuleExtender addAdapterDetector(DbAdapterDetector adapterDetector)
    Adds a custom DbAdapterDetector

  - ### addAdapterDetector

    public CoreModuleExtender addAdapterDetector(Class<? extends DbAdapterDetector> adapterDetectorType)
    Adds a custom DbAdapterDetector

  - ### addDefaultExtendedType

    public CoreModuleExtender addDefaultExtendedType(ExtendedType<?> type)
    Adds a default adapter-agnostic ExtendedType. "Default" types are loaded before adapter-provided or "user" types, so they may be overridden by those.

  - ### addDefaultExtendedType

    public CoreModuleExtender addDefaultExtendedType(Class<? extends ExtendedType<?>> type)
    Adds a default adapter-agnostic ExtendedType. "Default" types are loaded before adapter-provided or "user" types, so they may be overridden by those.

  - ### addUserExtendedType

    public CoreModuleExtender addUserExtendedType(ExtendedType<?> type)
    Adds an adapter-agnostic ExtendedType. "User" types are loaded after default and adapter-provided types and can override those.

  - ### addUserExtendedType

    public CoreModuleExtender addUserExtendedType(Class<? extends ExtendedType<?>> type)
    Adds an adapter-agnostic ExtendedType. "User" types are loaded after default and adapter-provided types and can override those.

  - ### addExtendedTypeFactory

    public CoreModuleExtender addExtendedTypeFactory(ExtendedTypeFactory factory)
    Adds an ExtendedTypeFactory used for dynamic extended type creation.

  - ### addExtendedTypeFactory

    public CoreModuleExtender addExtendedTypeFactory(Class<? extends ExtendedTypeFactory> factoryType)
    Adds an ExtendedTypeFactory used for dynamic extended type creation.

  - ### addValueObjectType

    public CoreModuleExtender addValueObjectType(ValueObjectType<?,?> type)
    Adds a custom `ValueObjectType`.

  - ### addValueObjectType

    public CoreModuleExtender addValueObjectType(Class<? extends ValueObjectType<?,?>> type)
    Adds a custom `ValueObjectType`.