io.github.joselion.springr2dbcrelationships.R2dbcRelationshipsAutoConfiguration Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of spring-r2dbc-relationships Show documentation
Show all versions of spring-r2dbc-relationships Show documentation
Spring R2DBC annotations to handle entity relationships
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