congrats Icon
New! Announcing Tabnine Chat Beta
Learn More
Tabnine Logo
AggregateConfigurer.configureRepository
Code IndexAdd Tabnine to your IDE (free)

How to use
configureRepository
method
in
org.axonframework.config.AggregateConfigurer

Best Java code snippets using org.axonframework.config.AggregateConfigurer.configureRepository (Showing top 7 results out of 315)

origin: AxonFramework/AxonFramework

    aggregate.substring(0, 1).toLowerCase() + aggregate.substring(1) + "AggregateFactory";
if (beanFactory.containsBean(repositoryName)) {
  aggregateConf.configureRepository(c -> beanFactory.getBean(repositoryName, Repository.class));
} else {
  registry.registerBeanDefinition(repositoryName,
    aggregateConf.configureRepository(
        c -> GenericJpaRepository.builder(aggregateType)
            .parameterResolverFactory(c.parameterResolverFactory())
aggregateConf.configureRepository(
    c -> beanFactory.getBean(aggregateAnnotation.repository(), Repository.class));
origin: AxonFramework/AxonFramework

return configurer.configureRepository(
    c -> {
      EntityManagerProvider entityManagerProvider = c.getComponent(
origin: AxonFramework/AxonFramework

/**
 * Creates a Configuration for an aggregate of given {@code aggregateType}, which is mapped to a relational
 * database using an EntityManager provided by given {@code entityManagerProvider}. The given {@code aggregateType}
 * is expected to be a proper JPA Entity.
 *
 * @param aggregateType         The type of Aggregate to configure
 * @param entityManagerProvider The provider for Axon to retrieve the EntityManager from
 * @param <A>                   The type of Aggregate to configure
 * @return An AggregateConfigurer instance for further configuration of the Aggregate
 */
public static <A> AggregateConfigurer<A> jpaMappedConfiguration(Class<A> aggregateType,
                                EntityManagerProvider entityManagerProvider) {
  AggregateConfigurer<A> configurer = new AggregateConfigurer<>(aggregateType);
  return configurer.configureRepository(
      c -> GenericJpaRepository.builder(aggregateType)
          .aggregateModel(configurer.metaModel.get())
          .entityManagerProvider(entityManagerProvider)
          .eventBus(c.eventBus())
          .repositoryProvider(c::repository)
          .build()
  );
}
origin: org.axonframework/axon-core

/**
 * Creates a Configuration for an aggregate of given {@code aggregateType}, which is mapped to a relational
 * database using an EntityManager provided by given {@code entityManagerProvider}. The given {@code aggregateType}
 * is expected to be a proper JPA Entity.
 *
 * @param aggregateType         The type of Aggregate to configure
 * @param entityManagerProvider The provider for Axon to retrieve the EntityManager from
 * @param <A>                   The type of Aggregate to configure
 * @return An AggregateConfigurer instance for further configuration of the Aggregate
 */
public static <A> AggregateConfigurer<A> jpaMappedConfiguration(Class<A> aggregateType,
                                EntityManagerProvider entityManagerProvider) {
  AggregateConfigurer<A> configurer = new AggregateConfigurer<>(aggregateType);
  return configurer.configureRepository(
      c -> new GenericJpaRepository<>(entityManagerProvider,
                      configurer.metaModel.get(),
                      c.eventBus(),
                      (RepositoryProvider) c::repository));
}
origin: org.axonframework/axon-core

/**
 * Creates a Configuration for an aggregate of given {@code aggregateType}, which is mapped to a relational
 * database using an EntityManager obtained from the main configuration. The given {@code aggregateType}
 * is expected to be a proper JPA Entity.
 * <p>
 * The EntityManagerProvider is expected to have been registered with the Configurer (which would be the case when
 * using {@link DefaultConfigurer#jpaConfiguration(EntityManagerProvider)}. If that is not the case, consider using
 * {@link #jpaMappedConfiguration(Class, EntityManagerProvider)} instead.
 *
 * @param aggregateType The type of Aggregate to configure
 * @param <A>           The type of Aggregate to configure
 * @return An AggregateConfigurer instance for further configuration of the Aggregate
 */
public static <A> AggregateConfigurer<A> jpaMappedConfiguration(Class<A> aggregateType) {
  AggregateConfigurer<A> configurer = new AggregateConfigurer<>(aggregateType);
  return configurer.configureRepository(
      c -> new GenericJpaRepository<>(c.getComponent(EntityManagerProvider.class,
                              () -> {
                                throw new AxonConfigurationException(format(
                                    "JPA has not been correctly configured for aggregate [%s]. Either provide an EntityManagerProvider, or use DefaultConfigurer.jpaConfiguration(...) to define one for the entire configuration.",
                                    aggregateType.getSimpleName()));
                              }),
                      configurer.metaModel.get(),
                      c.eventBus(),
                      (RepositoryProvider) c::repository));
}
origin: org.axonframework/axon-configuration

return configurer.configureRepository(
    c -> {
      EntityManagerProvider entityManagerProvider = c.getComponent(
origin: org.axonframework/axon-configuration

/**
 * Creates a Configuration for an aggregate of given {@code aggregateType}, which is mapped to a relational
 * database using an EntityManager provided by given {@code entityManagerProvider}. The given {@code aggregateType}
 * is expected to be a proper JPA Entity.
 *
 * @param aggregateType         The type of Aggregate to configure
 * @param entityManagerProvider The provider for Axon to retrieve the EntityManager from
 * @param <A>                   The type of Aggregate to configure
 * @return An AggregateConfigurer instance for further configuration of the Aggregate
 */
public static <A> AggregateConfigurer<A> jpaMappedConfiguration(Class<A> aggregateType,
                                EntityManagerProvider entityManagerProvider) {
  AggregateConfigurer<A> configurer = new AggregateConfigurer<>(aggregateType);
  return configurer.configureRepository(
      c -> GenericJpaRepository.builder(aggregateType)
          .aggregateModel(configurer.metaModel.get())
          .entityManagerProvider(entityManagerProvider)
          .eventBus(c.eventBus())
          .repositoryProvider(c::repository)
          .build()
  );
}
org.axonframework.configAggregateConfigurerconfigureRepository

Javadoc

Defines the repository to use to load and store Aggregates of this type. The builder function receives the global configuration object from which it can retrieve components the repository depends on.

Popular methods of AggregateConfigurer

  • defaultConfiguration
    Creates a default Configuration for an aggregate of the given aggregateType. This required either a
  • <init>
    Creates a default configuration as described in #defaultConfiguration(Class). This constructor is av
  • configureAggregateFactory
    Defines the factory to use to to create new Aggregates instances of the type under configuration.
  • name
  • configureCommandTargetResolver
    Defines the CommandTargetResolver to use for the Aggregate type under configuration. The CommandTarg
  • configureSnapshotTrigger
    Configures snapshotting for the Aggregate type under configuration. Note that this configuration is

Popular in Java

  • Reading from database using SQL prepared statement
  • getOriginalFilename (MultipartFile)
    Return the original filename in the client's filesystem.This may contain path information depending
  • requestLocationUpdates (LocationManager)
  • setContentView (Activity)
  • VirtualMachine (com.sun.tools.attach)
    A Java virtual machine. A VirtualMachine represents a Java virtual machine to which this Java vir
  • Graphics2D (java.awt)
    This Graphics2D class extends the Graphics class to provide more sophisticated control overgraphics
  • ServerSocket (java.net)
    This class represents a server-side socket that waits for incoming client connections. A ServerSocke
  • Selector (java.nio.channels)
    A controller for the selection of SelectableChannel objects. Selectable channels can be registered w
  • ReentrantLock (java.util.concurrent.locks)
    A reentrant mutual exclusion Lock with the same basic behavior and semantics as the implicit monitor
  • Manifest (java.util.jar)
    The Manifest class is used to obtain attribute information for a JarFile and its entries.
  • Top Vim plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now