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:
  • 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.
    • addCommitLogListener

      public CoreModuleExtender addCommitLogListener(CommitLogListener listener)
      Registers a commit log listener that receives post-commit change notifications.
      Since:
      5.0
    • addCommitLogListener

      public CoreModuleExtender addCommitLogListener(Class<? extends CommitLogListener> listenerType)
      Registers a commit log listener type that receives post-commit change notifications.
      Since:
      5.0
    • commitLogAnnotationEntitiesOnly

      public CoreModuleExtender commitLogAnnotationEntitiesOnly()
      Restricts commit log auditing to entities annotated with CommitLog. By default all entities are audited.
      Since:
      5.0
    • commitLogEntityFactory

      public CoreModuleExtender commitLogEntityFactory(Class<? extends CommitLogEntityFactory> factoryType)
      Installs a custom factory for commit log entity metadata.
      Since:
      5.0
    • excludeCommitLogFromTransaction

      public CoreModuleExtender excludeCommitLogFromTransaction()
      Configures commit log listeners to be notified outside the database transaction. By default listeners are called within the transaction, allowing them to participate in the same commit. Use this option when listeners may themselves write to the database and you want to avoid nested transactions.
      Since:
      5.0