Package com.onec.spring
Class OnecAutoConfiguration
java.lang.Object
org.springframework.data.jdbc.repository.config.AbstractJdbcConfiguration
com.onec.spring.OnecAutoConfiguration
- All Implemented Interfaces:
org.springframework.beans.factory.Aware,org.springframework.context.ApplicationContextAware
@AutoConfiguration(after=org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration.class)
@EnableConfigurationProperties(OnecProperties.class)
@ConditionalOnBean(javax.sql.DataSource.class)
public class OnecAutoConfiguration
extends org.springframework.data.jdbc.repository.config.AbstractJdbcConfiguration
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbackgroundJobs(org.jobrunr.scheduling.JobScheduler jobScheduler) clusterEntityChangeRelay(ClusterEventBus clusterEventBus) Publish side of cross-node live-UI sync: relays eachEntityChangedEventonto theClusterEventBusfor peer nodes (no-op with the default bus).Local-only fallbackClusterEventBus.constantManager(ConstantPersistence constantPersistence, MetadataRegistry registry) constantPersistence(org.jdbi.v3.core.Jdbi jdbi) entityChangePublisher(org.springframework.context.ApplicationEventPublisher applicationEventPublisher) Bridges the framework'sEntityChangePublisherSPI onto Spring'sApplicationEventPublisher, so arepository.save/deletepublishes anEntityChangedEventthat application code can@EventListener— the same event the generic controllers emit, so both write paths are observable through one hook (issues #28, #29).informationRegisterRepositoryMap(org.jdbi.v3.core.Jdbi jdbi, MetadataRegistry registry) org.springframework.data.jdbc.core.convert.JdbcConverterjdbcConverter(org.springframework.data.jdbc.core.mapping.JdbcMappingContext mappingContext, org.springframework.jdbc.core.namedparam.NamedParameterJdbcOperations operations, org.springframework.data.jdbc.core.convert.RelationResolver relationResolver, org.springframework.data.jdbc.core.convert.JdbcCustomConversions conversions, org.springframework.data.relational.core.dialect.Dialect dialect) Replaces the defaultJdbcConverterwithOnecJdbcConverter, which maps framework enums to theirUUIDcolumn type so@Enumerationattributes persist throughrepository.save(...)(issue #26).org.springframework.data.jdbc.core.mapping.JdbcMappingContextjdbcMappingContext(Optional<org.springframework.data.relational.core.mapping.NamingStrategy> namingStrategy, org.springframework.data.jdbc.core.convert.JdbcCustomConversions customConversions, org.springframework.data.relational.RelationalManagedTypes jdbcManagedTypes) org.jdbi.v3.core.Jdbijdbi(DataSource dataSource) metadataRegistry(OnecProperties properties, org.springframework.context.ApplicationContext context) numberGenerator(org.jdbi.v3.core.Jdbi jdbi) onecAfterConvertCallback(MetadataRegistry registry, SecretCipher secretCipher) onecAfterSaveCallback(OutboxWriter outboxWriter, MetadataRegistry registry, SecretCipher secretCipher, EntityChangePublisher entityChangePublisher, OnecMetrics metrics) onecBeforeConvertCallback(MetadataRegistry registry, NumberGenerator numberGenerator, SecretCipher secretCipher, OnecMetrics metrics) onecBeforeDeleteCallback(OutboxWriter outboxWriter, MetadataRegistry registry, EntityChangePublisher entityChangePublisher) onecMetrics(org.springframework.beans.factory.ObjectProvider<io.micrometer.core.instrument.MeterRegistry> meterRegistry) org.springframework.data.relational.core.mapping.NamingStrategyoutboxWriter(org.jdbi.v3.core.Jdbi jdbi) postEventPublisher(org.springframework.context.ApplicationEventPublisher applicationEventPublisher) Bridges the framework'sPostEventPublisherSPI onto Spring'sApplicationEventPublisher, so a successful post/unpost publishes aDocumentPostedEvent/DocumentUnpostedEventthat application code can@EventListener.postingService(org.jdbi.v3.core.Jdbi jdbi, MetadataRegistry registry, Map<Class<?>, RegisterRepositoryImpl<?>> repositoryImplMap, OutboxWriter outboxWriter, PostEventPublisher postEventPublisher, OnecMetrics metrics) queryEngine(org.jdbi.v3.core.Jdbi jdbi, MetadataRegistry metadataRegistry) The unified type-safe query layer: aQueryEngineover catalogs, documents, and registers withRef-navigation joins.refResolver(org.springframework.context.ApplicationContext applicationContext) Map<Class<?>, RegisterPersistence<?>> registerPersistenceMap(org.jdbi.v3.core.Jdbi jdbi, MetadataRegistry registry) Map<Class<?>, RegisterRepositoryImpl<?>> registerRepositoryImplMap(Map<Class<?>, RegisterPersistence<?>> persistenceMap) scheduledJobRegistrar(org.springframework.context.ApplicationContext applicationContext, org.jobrunr.scheduling.JobScheduler jobScheduler) schemaInitializer(DataSource dataSource, OnecProperties properties, org.springframework.context.ApplicationContext context, org.springframework.beans.factory.ObjectProvider<AppMigration> migrations) secretCipher(OnecProperties properties) The default (Viewport.DESKTOP) layout, kept as a bean for consumers that aren't viewport-aware (identity resolution, the metadata API).uiLayoutResolver(MetadataRegistry registry) protected List<?> Methods inherited from class org.springframework.data.jdbc.repository.config.AbstractJdbcConfiguration
dataAccessStrategyBean, getInitialEntitySet, getMappingBasePackages, jdbcAggregateTemplate, jdbcCustomConversions, jdbcDialect, jdbcManagedTypes, scanForEntities, setApplicationContext
-
Constructor Details
-
OnecAutoConfiguration
public OnecAutoConfiguration()
-
-
Method Details
-
onecNamingStrategy
@Bean public org.springframework.data.relational.core.mapping.NamingStrategy onecNamingStrategy() -
userConverters
- Overrides:
userConvertersin classorg.springframework.data.jdbc.repository.config.AbstractJdbcConfiguration
-
jdbcMappingContext
public org.springframework.data.jdbc.core.mapping.JdbcMappingContext jdbcMappingContext(Optional<org.springframework.data.relational.core.mapping.NamingStrategy> namingStrategy, org.springframework.data.jdbc.core.convert.JdbcCustomConversions customConversions, org.springframework.data.relational.RelationalManagedTypes jdbcManagedTypes) - Overrides:
jdbcMappingContextin classorg.springframework.data.jdbc.repository.config.AbstractJdbcConfiguration
-
jdbcConverter
public org.springframework.data.jdbc.core.convert.JdbcConverter jdbcConverter(org.springframework.data.jdbc.core.mapping.JdbcMappingContext mappingContext, org.springframework.jdbc.core.namedparam.NamedParameterJdbcOperations operations, @Lazy org.springframework.data.jdbc.core.convert.RelationResolver relationResolver, org.springframework.data.jdbc.core.convert.JdbcCustomConversions conversions, org.springframework.data.relational.core.dialect.Dialect dialect) Replaces the defaultJdbcConverterwithOnecJdbcConverter, which maps framework enums to theirUUIDcolumn type so@Enumerationattributes persist throughrepository.save(...)(issue #26). The body mirrorsAbstractJdbcConfiguration.jdbcConverter(org.springframework.data.jdbc.core.mapping.JdbcMappingContext, org.springframework.jdbc.core.namedparam.NamedParameterJdbcOperations, org.springframework.data.jdbc.core.convert.RelationResolver, org.springframework.data.jdbc.core.convert.JdbcCustomConversions, org.springframework.data.relational.core.dialect.Dialect)so all other behaviour is unchanged.- Overrides:
jdbcConverterin classorg.springframework.data.jdbc.repository.config.AbstractJdbcConfiguration
-
schemaInitializer
@Bean public SchemaInitializer schemaInitializer(DataSource dataSource, OnecProperties properties, org.springframework.context.ApplicationContext context, org.springframework.beans.factory.ObjectProvider<AppMigration> migrations) -
onecMetrics
@Bean public OnecMetrics onecMetrics(org.springframework.beans.factory.ObjectProvider<io.micrometer.core.instrument.MeterRegistry> meterRegistry) -
secretCipher
-
onecBeforeConvertCallback
@Bean public OnecBeforeConvertCallback onecBeforeConvertCallback(MetadataRegistry registry, NumberGenerator numberGenerator, SecretCipher secretCipher, OnecMetrics metrics) -
entityChangePublisher
@Bean public EntityChangePublisher entityChangePublisher(org.springframework.context.ApplicationEventPublisher applicationEventPublisher) Bridges the framework'sEntityChangePublisherSPI onto Spring'sApplicationEventPublisher, so arepository.save/deletepublishes anEntityChangedEventthat application code can@EventListener— the same event the generic controllers emit, so both write paths are observable through one hook (issues #28, #29). -
clusterEventBus
Local-only fallbackClusterEventBus.onec-cluster-startersupplies a PostgresLISTEN/NOTIFYbus (its auto-configuration is orderedbeforethis one, so its@ConditionalOnMissingBeanbean registers first and this one backs off); an application may override either with its own bean. With this no-op default, the cluster relay/bridge are inert and single-node behaviour is unchanged. -
clusterEntityChangeRelay
Publish side of cross-node live-UI sync: relays eachEntityChangedEventonto theClusterEventBusfor peer nodes (no-op with the default bus). -
onecAfterSaveCallback
@Bean public OnecAfterSaveCallback onecAfterSaveCallback(OutboxWriter outboxWriter, MetadataRegistry registry, SecretCipher secretCipher, EntityChangePublisher entityChangePublisher, OnecMetrics metrics) -
onecAfterConvertCallback
@Bean public OnecAfterConvertCallback onecAfterConvertCallback(MetadataRegistry registry, SecretCipher secretCipher) -
onecBeforeDeleteCallback
@Bean public OnecBeforeDeleteCallback onecBeforeDeleteCallback(OutboxWriter outboxWriter, MetadataRegistry registry, EntityChangePublisher entityChangePublisher) -
numberGenerator
-
refResolver
@Bean public RefResolver refResolver(org.springframework.context.ApplicationContext applicationContext) -
metadataRegistry
@Bean public MetadataRegistry metadataRegistry(OnecProperties properties, org.springframework.context.ApplicationContext context) -
jdbi
-
queryEngine
The unified type-safe query layer: aQueryEngineover catalogs, documents, and registers withRef-navigation joins. Apps inject it to runquery.from(...).select(...).where(...).fetch()queries. -
outboxWriter
-
registerPersistenceMap
@Bean public Map<Class<?>,RegisterPersistence<?>> registerPersistenceMap(org.jdbi.v3.core.Jdbi jdbi, MetadataRegistry registry) -
registerRepositoryImplMap
@Bean public Map<Class<?>,RegisterRepositoryImpl<?>> registerRepositoryImplMap(Map<Class<?>, RegisterPersistence<?>> persistenceMap) -
postEventPublisher
@Bean public PostEventPublisher postEventPublisher(org.springframework.context.ApplicationEventPublisher applicationEventPublisher) Bridges the framework'sPostEventPublisherSPI onto Spring'sApplicationEventPublisher, so a successful post/unpost publishes aDocumentPostedEvent/DocumentUnpostedEventthat application code can@EventListener. This is the Spring-bean-reachable "after post" hook (no Kafka outbox required). -
postingService
@Bean public PostingService postingService(org.jdbi.v3.core.Jdbi jdbi, MetadataRegistry registry, Map<Class<?>, RegisterRepositoryImpl<?>> repositoryImplMap, OutboxWriter outboxWriter, PostEventPublisher postEventPublisher, OnecMetrics metrics) -
informationRegisterRepositoryMap
@Bean public Map<Class<?>,InformationRegisterRepositoryImpl<?>> informationRegisterRepositoryMap(org.jdbi.v3.core.Jdbi jdbi, MetadataRegistry registry) -
constantPersistence
-
constantManager
@Bean public ConstantManager constantManager(ConstantPersistence constantPersistence, MetadataRegistry registry) -
backgroundJobs
@Bean @ConditionalOnBean(org.jobrunr.scheduling.JobScheduler.class) public BackgroundJobs backgroundJobs(org.jobrunr.scheduling.JobScheduler jobScheduler) -
scheduledJobRegistrar
@Bean @ConditionalOnBean(org.jobrunr.scheduling.JobScheduler.class) public ScheduledJobRegistrar scheduledJobRegistrar(org.springframework.context.ApplicationContext applicationContext, org.jobrunr.scheduling.JobScheduler jobScheduler) -
layoutSet
-
uiLayout
The default (Viewport.DESKTOP) layout, kept as a bean for consumers that aren't viewport-aware (identity resolution, the metadata API). -
uiLayoutResolver
-
uiProfileResolver
-