All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.github.joselion.springr2dbcrelationships.R2dbcRelationshipsAutoConfiguration Maven / Gradle / Ivy

The newest version!
package io.github.joselion.springr2dbcrelationships;

import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Lazy;
import org.springframework.data.r2dbc.core.R2dbcEntityTemplate;

import lombok.extern.slf4j.Slf4j;

/**
 * R2DBC Relationships auto-configuration.
 */
@Slf4j
@Configuration
public class R2dbcRelationshipsAutoConfiguration {

  /**
   * Default configuration constructor.
   */
  protected R2dbcRelationshipsAutoConfiguration() {
    log.info("R2DBC Relationships auto-configuration loaded.");
  }

  /**
   * Creates the {@link R2dbcRelationshipsCallbacks} bean.
   *
   * @param  the type of the entity in the callback
   * @param template the r2dbc entity template
   * @param context the Spring application context
   * @return the relationship callbacks bean
   */
  @Bean
  public  R2dbcRelationshipsCallbacks relationshipsCallbacks(
    final @Lazy R2dbcEntityTemplate template,
    final ApplicationContext context
  ) {
    return new R2dbcRelationshipsCallbacks<>(template, context);
  }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy