001/*
002 * #%L
003 * HAPI FHIR JPA Server
004 * %%
005 * Copyright (C) 2014 - 2025 Smile CDR, Inc.
006 * %%
007 * Licensed under the Apache License, Version 2.0 (the "License");
008 * you may not use this file except in compliance with the License.
009 * You may obtain a copy of the License at
010 *
011 *      http://www.apache.org/licenses/LICENSE-2.0
012 *
013 * Unless required by applicable law or agreed to in writing, software
014 * distributed under the License is distributed on an "AS IS" BASIS,
015 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
016 * See the License for the specific language governing permissions and
017 * limitations under the License.
018 * #L%
019 */
020package ca.uhn.fhir.jpa.config;
021
022import ca.uhn.fhir.batch2.api.IJobCoordinator;
023import ca.uhn.fhir.batch2.api.IJobPersistence;
024import ca.uhn.fhir.batch2.jobs.export.BulkDataExportProvider;
025import ca.uhn.fhir.batch2.jobs.expunge.DeleteExpungeJobSubmitterImpl;
026import ca.uhn.fhir.batch2.util.Batch2TaskHelper;
027import ca.uhn.fhir.context.FhirContext;
028import ca.uhn.fhir.context.FhirVersionEnum;
029import ca.uhn.fhir.context.support.IValidationSupport;
030import ca.uhn.fhir.interceptor.api.IInterceptorBroadcaster;
031import ca.uhn.fhir.interceptor.api.IInterceptorService;
032import ca.uhn.fhir.interceptor.executor.InterceptorService;
033import ca.uhn.fhir.interceptor.model.RequestPartitionId;
034import ca.uhn.fhir.jpa.api.config.JpaStorageSettings;
035import ca.uhn.fhir.jpa.api.dao.DaoRegistry;
036import ca.uhn.fhir.jpa.api.model.ExpungeOptions;
037import ca.uhn.fhir.jpa.api.svc.IIdHelperService;
038import ca.uhn.fhir.jpa.api.svc.ISearchUrlJobMaintenanceSvc;
039import ca.uhn.fhir.jpa.binary.interceptor.BinaryStorageInterceptor;
040import ca.uhn.fhir.jpa.binary.provider.BinaryAccessProvider;
041import ca.uhn.fhir.jpa.bulk.export.api.IBulkDataExportJobSchedulingHelper;
042import ca.uhn.fhir.jpa.bulk.export.svc.BulkDataExportJobSchedulingHelperImpl;
043import ca.uhn.fhir.jpa.bulk.export.svc.BulkExportHelperService;
044import ca.uhn.fhir.jpa.bulk.imprt.api.IBulkDataImportSvc;
045import ca.uhn.fhir.jpa.bulk.imprt.svc.BulkDataImportSvcImpl;
046import ca.uhn.fhir.jpa.cache.IResourceTypeCacheSvc;
047import ca.uhn.fhir.jpa.cache.IResourceVersionSvc;
048import ca.uhn.fhir.jpa.cache.ISearchParamIdentityCacheSvc;
049import ca.uhn.fhir.jpa.cache.ResourceTypeCacheSvcImpl;
050import ca.uhn.fhir.jpa.cache.ResourceVersionSvcDaoImpl;
051import ca.uhn.fhir.jpa.dao.CacheTagDefinitionDao;
052import ca.uhn.fhir.jpa.dao.DaoSearchParamProvider;
053import ca.uhn.fhir.jpa.dao.HistoryBuilder;
054import ca.uhn.fhir.jpa.dao.HistoryBuilderFactory;
055import ca.uhn.fhir.jpa.dao.IFulltextSearchSvc;
056import ca.uhn.fhir.jpa.dao.IJpaStorageResourceParser;
057import ca.uhn.fhir.jpa.dao.ISearchBuilder;
058import ca.uhn.fhir.jpa.dao.JpaStorageResourceParser;
059import ca.uhn.fhir.jpa.dao.MatchResourceUrlService;
060import ca.uhn.fhir.jpa.dao.ResourceHistoryCalculator;
061import ca.uhn.fhir.jpa.dao.SearchBuilderFactory;
062import ca.uhn.fhir.jpa.dao.TransactionProcessor;
063import ca.uhn.fhir.jpa.dao.data.IResourceIndexedSearchParamIdentityDao;
064import ca.uhn.fhir.jpa.dao.data.IResourceLinkDao;
065import ca.uhn.fhir.jpa.dao.data.IResourceModifiedDao;
066import ca.uhn.fhir.jpa.dao.data.IResourceSearchUrlDao;
067import ca.uhn.fhir.jpa.dao.data.IResourceTypeDao;
068import ca.uhn.fhir.jpa.dao.data.ITagDefinitionDao;
069import ca.uhn.fhir.jpa.dao.expunge.ExpungeEverythingService;
070import ca.uhn.fhir.jpa.dao.expunge.ExpungeOperation;
071import ca.uhn.fhir.jpa.dao.expunge.ExpungeService;
072import ca.uhn.fhir.jpa.dao.expunge.IExpungeEverythingService;
073import ca.uhn.fhir.jpa.dao.expunge.IResourceExpungeService;
074import ca.uhn.fhir.jpa.dao.expunge.JpaResourceExpungeService;
075import ca.uhn.fhir.jpa.dao.expunge.ResourceTableFKProvider;
076import ca.uhn.fhir.jpa.dao.index.DaoResourceLinkResolver;
077import ca.uhn.fhir.jpa.dao.index.DaoSearchParamSynchronizer;
078import ca.uhn.fhir.jpa.dao.index.IdHelperService;
079import ca.uhn.fhir.jpa.dao.index.SearchParamWithInlineReferencesExtractor;
080import ca.uhn.fhir.jpa.dao.tx.HapiTransactionService;
081import ca.uhn.fhir.jpa.dao.tx.IHapiTransactionService;
082import ca.uhn.fhir.jpa.dao.validation.SearchParameterDaoValidator;
083import ca.uhn.fhir.jpa.delete.DeleteConflictFinderService;
084import ca.uhn.fhir.jpa.delete.DeleteConflictService;
085import ca.uhn.fhir.jpa.delete.ThreadSafeResourceDeleterSvc;
086import ca.uhn.fhir.jpa.entity.Search;
087import ca.uhn.fhir.jpa.entity.TermValueSet;
088import ca.uhn.fhir.jpa.esr.ExternallyStoredResourceServiceRegistry;
089import ca.uhn.fhir.jpa.graphql.DaoRegistryGraphQLStorageServices;
090import ca.uhn.fhir.jpa.interceptor.CascadingDeleteInterceptor;
091import ca.uhn.fhir.jpa.interceptor.JpaConsentContextServices;
092import ca.uhn.fhir.jpa.interceptor.OverridePathBasedReferentialIntegrityForDeletesInterceptor;
093import ca.uhn.fhir.jpa.interceptor.validation.RepositoryValidatingRuleBuilder;
094import ca.uhn.fhir.jpa.model.config.PartitionSettings;
095import ca.uhn.fhir.jpa.model.dao.JpaPid;
096import ca.uhn.fhir.jpa.model.sched.ISchedulerService;
097import ca.uhn.fhir.jpa.packages.IHapiPackageCacheManager;
098import ca.uhn.fhir.jpa.packages.IPackageInstallerSvc;
099import ca.uhn.fhir.jpa.packages.JpaPackageCache;
100import ca.uhn.fhir.jpa.packages.NpmJpaValidationSupport;
101import ca.uhn.fhir.jpa.packages.PackageInstallerSvcImpl;
102import ca.uhn.fhir.jpa.packages.util.PackageUtils;
103import ca.uhn.fhir.jpa.partition.IPartitionLookupSvc;
104import ca.uhn.fhir.jpa.partition.IRequestPartitionHelperSvc;
105import ca.uhn.fhir.jpa.partition.PartitionLookupSvcImpl;
106import ca.uhn.fhir.jpa.partition.PartitionManagementProvider;
107import ca.uhn.fhir.jpa.partition.RequestPartitionHelperSvc;
108import ca.uhn.fhir.jpa.provider.DiffProvider;
109import ca.uhn.fhir.jpa.provider.IReplaceReferencesSvc;
110import ca.uhn.fhir.jpa.provider.InstanceReindexProvider;
111import ca.uhn.fhir.jpa.provider.ProcessMessageProvider;
112import ca.uhn.fhir.jpa.provider.ReplaceReferencesSvcImpl;
113import ca.uhn.fhir.jpa.provider.SubscriptionTriggeringProvider;
114import ca.uhn.fhir.jpa.provider.TerminologyUploaderProvider;
115import ca.uhn.fhir.jpa.provider.ValueSetOperationProvider;
116import ca.uhn.fhir.jpa.provider.ValueSetOperationProviderDstu2;
117import ca.uhn.fhir.jpa.sched.AutowiringSpringBeanJobFactory;
118import ca.uhn.fhir.jpa.sched.HapiSchedulerServiceImpl;
119import ca.uhn.fhir.jpa.search.ISynchronousSearchSvc;
120import ca.uhn.fhir.jpa.search.PersistedJpaBundleProvider;
121import ca.uhn.fhir.jpa.search.PersistedJpaBundleProviderFactory;
122import ca.uhn.fhir.jpa.search.PersistedJpaSearchFirstPageBundleProvider;
123import ca.uhn.fhir.jpa.search.ResourceSearchUrlSvc;
124import ca.uhn.fhir.jpa.search.SearchStrategyFactory;
125import ca.uhn.fhir.jpa.search.SearchUrlJobMaintenanceSvcImpl;
126import ca.uhn.fhir.jpa.search.SynchronousSearchSvcImpl;
127import ca.uhn.fhir.jpa.search.builder.QueryStack;
128import ca.uhn.fhir.jpa.search.builder.predicate.ComboNonUniqueSearchParameterPredicateBuilder;
129import ca.uhn.fhir.jpa.search.builder.predicate.ComboUniqueSearchParameterPredicateBuilder;
130import ca.uhn.fhir.jpa.search.builder.predicate.CoordsPredicateBuilder;
131import ca.uhn.fhir.jpa.search.builder.predicate.DatePredicateBuilder;
132import ca.uhn.fhir.jpa.search.builder.predicate.NumberPredicateBuilder;
133import ca.uhn.fhir.jpa.search.builder.predicate.QuantityNormalizedPredicateBuilder;
134import ca.uhn.fhir.jpa.search.builder.predicate.QuantityPredicateBuilder;
135import ca.uhn.fhir.jpa.search.builder.predicate.ResourceHistoryPredicateBuilder;
136import ca.uhn.fhir.jpa.search.builder.predicate.ResourceHistoryProvenancePredicateBuilder;
137import ca.uhn.fhir.jpa.search.builder.predicate.ResourceIdPredicateBuilder;
138import ca.uhn.fhir.jpa.search.builder.predicate.ResourceLinkPredicateBuilder;
139import ca.uhn.fhir.jpa.search.builder.predicate.ResourceTablePredicateBuilder;
140import ca.uhn.fhir.jpa.search.builder.predicate.SearchParamPresentPredicateBuilder;
141import ca.uhn.fhir.jpa.search.builder.predicate.StringPredicateBuilder;
142import ca.uhn.fhir.jpa.search.builder.predicate.TagPredicateBuilder;
143import ca.uhn.fhir.jpa.search.builder.predicate.TokenPredicateBuilder;
144import ca.uhn.fhir.jpa.search.builder.predicate.UriPredicateBuilder;
145import ca.uhn.fhir.jpa.search.builder.sql.GeneratedSql;
146import ca.uhn.fhir.jpa.search.builder.sql.SearchQueryBuilder;
147import ca.uhn.fhir.jpa.search.builder.sql.SearchQueryExecutor;
148import ca.uhn.fhir.jpa.search.builder.sql.SqlObjectFactory;
149import ca.uhn.fhir.jpa.search.builder.tasks.SearchTask;
150import ca.uhn.fhir.jpa.search.cache.DatabaseSearchCacheSvcImpl;
151import ca.uhn.fhir.jpa.search.cache.DatabaseSearchResultCacheSvcImpl;
152import ca.uhn.fhir.jpa.search.cache.ISearchCacheSvc;
153import ca.uhn.fhir.jpa.search.cache.ISearchResultCacheSvc;
154import ca.uhn.fhir.jpa.search.elastic.IndexNamePrefixLayoutStrategy;
155import ca.uhn.fhir.jpa.search.reindex.IInstanceReindexService;
156import ca.uhn.fhir.jpa.search.reindex.IResourceReindexingSvc;
157import ca.uhn.fhir.jpa.search.reindex.InstanceReindexServiceImpl;
158import ca.uhn.fhir.jpa.search.reindex.ResourceReindexer;
159import ca.uhn.fhir.jpa.search.reindex.ResourceReindexingSvcImpl;
160import ca.uhn.fhir.jpa.search.warm.CacheWarmingSvcImpl;
161import ca.uhn.fhir.jpa.search.warm.ICacheWarmingSvc;
162import ca.uhn.fhir.jpa.searchparam.MatchUrlService;
163import ca.uhn.fhir.jpa.searchparam.config.SearchParamConfig;
164import ca.uhn.fhir.jpa.searchparam.extractor.IResourceLinkResolver;
165import ca.uhn.fhir.jpa.searchparam.registry.ISearchParamProvider;
166import ca.uhn.fhir.jpa.sp.ISearchParamPresenceSvc;
167import ca.uhn.fhir.jpa.sp.SearchParamIdentityCacheSvcImpl;
168import ca.uhn.fhir.jpa.sp.SearchParamPresenceSvcImpl;
169import ca.uhn.fhir.jpa.subscription.ResourceModifiedMessagePersistenceSvcImpl;
170import ca.uhn.fhir.jpa.term.TermCodeSystemStorageSvcImpl;
171import ca.uhn.fhir.jpa.term.TermConceptMappingSvcImpl;
172import ca.uhn.fhir.jpa.term.TermReadSvcImpl;
173import ca.uhn.fhir.jpa.term.TermReindexingSvcImpl;
174import ca.uhn.fhir.jpa.term.ValueSetConceptAccumulator;
175import ca.uhn.fhir.jpa.term.ValueSetConceptAccumulatorFactory;
176import ca.uhn.fhir.jpa.term.api.ITermCodeSystemStorageSvc;
177import ca.uhn.fhir.jpa.term.api.ITermConceptMappingSvc;
178import ca.uhn.fhir.jpa.term.api.ITermReadSvc;
179import ca.uhn.fhir.jpa.term.api.ITermReindexingSvc;
180import ca.uhn.fhir.jpa.term.config.TermCodeSystemConfig;
181import ca.uhn.fhir.jpa.util.JpaHapiTransactionService;
182import ca.uhn.fhir.jpa.util.MemoryCacheService;
183import ca.uhn.fhir.jpa.util.PartitionedIdModeVerificationSvc;
184import ca.uhn.fhir.jpa.util.PersistenceContextProvider;
185import ca.uhn.fhir.jpa.validation.JpaValidationSupportChain;
186import ca.uhn.fhir.jpa.validation.ResourceLoaderImpl;
187import ca.uhn.fhir.jpa.validation.ValidationSettings;
188import ca.uhn.fhir.model.api.IPrimitiveDatatype;
189import ca.uhn.fhir.replacereferences.PreviousResourceVersionRestorer;
190import ca.uhn.fhir.replacereferences.ReplaceReferencesPatchBundleSvc;
191import ca.uhn.fhir.replacereferences.ReplaceReferencesProvenanceSvc;
192import ca.uhn.fhir.replacereferences.UndoReplaceReferencesSvc;
193import ca.uhn.fhir.rest.api.SearchIncludeDeletedEnum;
194import ca.uhn.fhir.rest.api.server.RequestDetails;
195import ca.uhn.fhir.rest.api.server.storage.IDeleteExpungeJobSubmitter;
196import ca.uhn.fhir.rest.api.server.storage.IResourcePersistentId;
197import ca.uhn.fhir.rest.server.interceptor.ResponseTerminologyTranslationInterceptor;
198import ca.uhn.fhir.rest.server.interceptor.ResponseTerminologyTranslationSvc;
199import ca.uhn.fhir.rest.server.interceptor.consent.IConsentContextServices;
200import ca.uhn.fhir.rest.server.interceptor.partition.RequestTenantPartitionInterceptor;
201import ca.uhn.fhir.rest.server.util.ISearchParamRegistry;
202import ca.uhn.fhir.subscription.api.IResourceModifiedMessagePersistenceSvc;
203import ca.uhn.fhir.util.IMetaTagSorter;
204import ca.uhn.fhir.util.MetaTagSorterAlphabetical;
205import ca.uhn.hapi.converters.canonical.VersionCanonicalizer;
206import jakarta.annotation.Nullable;
207import org.hl7.fhir.common.hapi.validation.support.UnknownCodeSystemWarningValidationSupport;
208import org.hl7.fhir.common.hapi.validation.support.ValidationSupportChain;
209import org.hl7.fhir.common.hapi.validation.validator.WorkerContextValidationSupportAdapter;
210import org.hl7.fhir.utilities.graphql.IGraphQLStorageServices;
211import org.springframework.beans.factory.annotation.Autowired;
212import org.springframework.context.annotation.Bean;
213import org.springframework.context.annotation.Configuration;
214import org.springframework.context.annotation.Import;
215import org.springframework.context.annotation.Lazy;
216import org.springframework.context.annotation.Primary;
217import org.springframework.context.annotation.Scope;
218import org.springframework.core.task.AsyncTaskExecutor;
219import org.springframework.data.envers.repository.support.EnversRevisionRepositoryFactoryBean;
220import org.springframework.data.jpa.repository.config.EnableJpaRepositories;
221import org.springframework.scheduling.TaskScheduler;
222import org.springframework.scheduling.concurrent.ConcurrentTaskScheduler;
223import org.springframework.scheduling.concurrent.ScheduledExecutorFactoryBean;
224import org.springframework.transaction.PlatformTransactionManager;
225
226import java.util.Date;
227
228@Configuration
229// repositoryFactoryBeanClass: EnversRevisionRepositoryFactoryBean is needed primarily for unit testing
230@EnableJpaRepositories(
231                basePackages = "ca.uhn.fhir.jpa.dao.data",
232                repositoryFactoryBeanClass = EnversRevisionRepositoryFactoryBean.class)
233@Import({
234        BeanPostProcessorConfig.class,
235        TermCodeSystemConfig.class,
236        SearchParamConfig.class,
237        ValidationSupportConfig.class,
238        Batch2SupportConfig.class,
239        JpaBulkExportConfig.class,
240        SearchConfig.class,
241        PackageLoaderConfig.class,
242        EnversAuditConfig.class,
243        MdmJpaConfig.class
244})
245public class JpaConfig {
246        public static final String JPA_VALIDATION_SUPPORT_CHAIN = "myJpaValidationSupportChain";
247        public static final String JPA_VALIDATION_SUPPORT = "myJpaValidationSupport";
248        public static final String TASK_EXECUTOR_NAME = "hapiJpaTaskExecutor";
249        public static final String GRAPHQL_PROVIDER_NAME = "myGraphQLProvider";
250        public static final String PERSISTED_JPA_BUNDLE_PROVIDER = "PersistedJpaBundleProvider";
251        public static final String PERSISTED_JPA_BUNDLE_PROVIDER_BY_SEARCH = "PersistedJpaBundleProvider_BySearch";
252        public static final String PERSISTED_JPA_SEARCH_FIRST_PAGE_BUNDLE_PROVIDER =
253                        "PersistedJpaSearchFirstPageBundleProvider";
254        public static final String HISTORY_BUILDER = "HistoryBuilder";
255        public static final String DEFAULT_PROFILE_VALIDATION_SUPPORT = "myDefaultProfileValidationSupport";
256        private static final String HAPI_DEFAULT_SCHEDULER_GROUP = "HAPI";
257
258        @Autowired
259        public JpaStorageSettings myStorageSettings;
260
261        @Autowired
262        private PartitionSettings myPartitionSettings;
263
264        @Autowired
265        private FhirContext myFhirContext;
266
267        @Bean
268        public ValidationSupportChain.CacheConfiguration validationSupportChainCacheConfiguration() {
269                return ValidationSupportChain.CacheConfiguration.defaultValues();
270        }
271
272        /**
273         * Note, there is a circular dependency between {@link WorkerContextValidationSupportAdapter}
274         * and {@link JpaValidationSupportChain}. The WorkerContextValidationSupportAdapter wraps
275         * an instance of {@link IValidationSupport} (which is what JpaValidationSupportChain is)
276         * but we also need to pass in the WorkerContextValidationSupportAdapter instance to the
277         * snapshot generator which is created within the {@literal @PostConstruct} method within
278         * JpaValidationSupportChain.
279         * <p>
280         * In order to allow the circular dependency to be created (since Spring doesn't like
281         * these), JpaValidationSupportChain calls {@link WorkerContextValidationSupportAdapter#setValidationSupport(IValidationSupport)}
282         * to pass itself in.
283         * </p>
284         * <p>
285         * This is obviously not ideal, but is the best we can do since the corelib
286         * tools all use {@link org.hl7.fhir.r5.context.IWorkerContext} interface as their
287         * input. See {@link WorkerContextValidationSupportAdapter} for more info.
288         * </p>
289         */
290        @Bean
291        public WorkerContextValidationSupportAdapter workerContextValidationSupportAdapter() {
292                return new WorkerContextValidationSupportAdapter();
293        }
294
295        @Bean(name = JpaConfig.JPA_VALIDATION_SUPPORT_CHAIN)
296        @Primary
297        public IValidationSupport jpaValidationSupportChain() {
298                return new JpaValidationSupportChain(
299                                myFhirContext, validationSupportChainCacheConfiguration(), workerContextValidationSupportAdapter());
300        }
301
302        @Bean("myDaoRegistry")
303        public DaoRegistry daoRegistry() {
304                return new DaoRegistry();
305        }
306
307        @Lazy
308        @Bean
309        public CascadingDeleteInterceptor cascadingDeleteInterceptor(
310                        FhirContext theFhirContext,
311                        DaoRegistry theDaoRegistry,
312                        IInterceptorBroadcaster theInterceptorBroadcaster,
313                        ThreadSafeResourceDeleterSvc threadSafeResourceDeleterSvc) {
314                return new CascadingDeleteInterceptor(
315                                theFhirContext, theDaoRegistry, theInterceptorBroadcaster, threadSafeResourceDeleterSvc);
316        }
317
318        @Bean
319        public ExternallyStoredResourceServiceRegistry ExternallyStoredResourceServiceRegistry() {
320                return new ExternallyStoredResourceServiceRegistry();
321        }
322
323        @Lazy
324        @Bean
325        public ThreadSafeResourceDeleterSvc safeDeleter(
326                        DaoRegistry theDaoRegistry,
327                        IInterceptorBroadcaster theInterceptorBroadcaster,
328                        HapiTransactionService hapiTransactionService) {
329                return new ThreadSafeResourceDeleterSvc(theDaoRegistry, theInterceptorBroadcaster, hapiTransactionService);
330        }
331
332        @Lazy
333        @Bean
334        public ResponseTerminologyTranslationInterceptor responseTerminologyTranslationInterceptor(
335                        IValidationSupport theValidationSupport,
336                        ResponseTerminologyTranslationSvc theResponseTerminologyTranslationSvc) {
337                return new ResponseTerminologyTranslationInterceptor(
338                                theValidationSupport, theResponseTerminologyTranslationSvc);
339        }
340
341        @Bean
342        public ResponseTerminologyTranslationSvc responseTerminologyTranslationSvc(
343                        IValidationSupport theValidationSupport) {
344                return new ResponseTerminologyTranslationSvc(theValidationSupport);
345        }
346
347        @Bean
348        @Lazy
349        public IGraphQLStorageServices graphqlStorageServices() {
350                return new DaoRegistryGraphQLStorageServices();
351        }
352
353        @Bean
354        public ScheduledExecutorFactoryBean scheduledExecutorService() {
355                ScheduledExecutorFactoryBean b = new ScheduledExecutorFactoryBean();
356                b.setPoolSize(5);
357                b.afterPropertiesSet();
358                return b;
359        }
360
361        @Bean(name = "mySubscriptionTriggeringProvider")
362        @Lazy
363        public SubscriptionTriggeringProvider subscriptionTriggeringProvider() {
364                return new SubscriptionTriggeringProvider();
365        }
366
367        @Bean
368        @Lazy
369        public ValueSetOperationProvider valueSetOperationProvider(FhirContext theFhirContext) {
370                if (theFhirContext.getVersion().getVersion().equals(FhirVersionEnum.DSTU2)) {
371                        return new ValueSetOperationProviderDstu2();
372                }
373                return new ValueSetOperationProvider();
374        }
375
376        @Bean
377        public IJpaStorageResourceParser jpaStorageResourceParser() {
378                return new JpaStorageResourceParser();
379        }
380
381        @Bean
382        public TransactionProcessor transactionProcessor() {
383                return new TransactionProcessor();
384        }
385
386        @Bean(name = "myAttachmentBinaryAccessProvider")
387        @Lazy
388        public BinaryAccessProvider binaryAccessProvider() {
389                return new BinaryAccessProvider();
390        }
391
392        @Bean(name = "myBinaryStorageInterceptor")
393        @Lazy
394        public BinaryStorageInterceptor<? extends IPrimitiveDatatype<byte[]>> binaryStorageInterceptor(
395                        JpaStorageSettings theStorageSettings, FhirContext theCtx) {
396                BinaryStorageInterceptor<? extends IPrimitiveDatatype<byte[]>> interceptor =
397                                new BinaryStorageInterceptor<>(theCtx);
398                interceptor.setAllowAutoInflateBinaries(theStorageSettings.isAllowAutoInflateBinaries());
399                interceptor.setAutoInflateBinariesMaximumSize(theStorageSettings.getAutoInflateBinariesMaximumBytes());
400                return interceptor;
401        }
402
403        @Bean
404        public MemoryCacheService memoryCacheService(JpaStorageSettings theStorageSettings) {
405                return new MemoryCacheService(theStorageSettings);
406        }
407
408        @Bean
409        @Primary
410        public IResourceLinkResolver daoResourceLinkResolver() {
411                return new DaoResourceLinkResolver<JpaPid>();
412        }
413
414        @Bean(name = PackageUtils.LOADER_WITH_CACHE)
415        public IHapiPackageCacheManager packageCacheManager() {
416                return new JpaPackageCache();
417        }
418
419        @Bean
420        public NpmJpaValidationSupport npmJpaValidationSupport() {
421                return new NpmJpaValidationSupport();
422        }
423
424        @Bean
425        public ValidationSettings validationSettings() {
426                return new ValidationSettings();
427        }
428
429        @Bean
430        public ISearchCacheSvc searchCacheSvc() {
431                return new DatabaseSearchCacheSvcImpl();
432        }
433
434        @Bean
435        public ISearchResultCacheSvc searchResultCacheSvc() {
436                return new DatabaseSearchResultCacheSvcImpl();
437        }
438
439        @Bean
440        public ITermConceptMappingSvc termConceptMappingSvc() {
441                return new TermConceptMappingSvcImpl();
442        }
443
444        @Bean
445        public TaskScheduler taskScheduler() {
446                ConcurrentTaskScheduler retVal = new ConcurrentTaskScheduler(
447                                scheduledExecutorService().getObject(),
448                                scheduledExecutorService().getObject());
449                return retVal;
450        }
451
452        @Bean(name = TASK_EXECUTOR_NAME)
453        public AsyncTaskExecutor taskExecutor() {
454                ConcurrentTaskScheduler retVal = new ConcurrentTaskScheduler(
455                                scheduledExecutorService().getObject(),
456                                scheduledExecutorService().getObject());
457                return retVal;
458        }
459
460        @Bean
461        public IResourceReindexingSvc resourceReindexingSvc() {
462                return new ResourceReindexingSvcImpl();
463        }
464
465        @Bean
466        @Lazy
467        public IInstanceReindexService instanceReindexService() {
468                return new InstanceReindexServiceImpl();
469        }
470
471        @Bean
472        @Lazy
473        public InstanceReindexProvider instanceReindexProvider(IInstanceReindexService theInstanceReindexService) {
474                return new InstanceReindexProvider(theInstanceReindexService);
475        }
476
477        @Bean
478        public ResourceReindexer resourceReindexer(FhirContext theFhirContext) {
479                return new ResourceReindexer(theFhirContext);
480        }
481
482        @Bean
483        public HapiFhirHibernateJpaDialect hibernateJpaDialect(FhirContext theFhirContext) {
484                return new HapiFhirHibernateJpaDialect(theFhirContext.getLocalizer());
485        }
486
487        @Bean
488        @Lazy
489        public OverridePathBasedReferentialIntegrityForDeletesInterceptor
490                        overridePathBasedReferentialIntegrityForDeletesInterceptor() {
491                return new OverridePathBasedReferentialIntegrityForDeletesInterceptor();
492        }
493
494        @Bean
495        public IRequestPartitionHelperSvc requestPartitionHelperService() {
496                return new RequestPartitionHelperSvc();
497        }
498
499        @Bean
500        public HapiTransactionService hapiTransactionService() {
501                return new JpaHapiTransactionService();
502        }
503
504        @Bean
505        public IInterceptorService jpaInterceptorService() {
506                return new InterceptorService();
507        }
508
509        @Bean
510        public IPackageInstallerSvc npmInstallerSvc() {
511                return new PackageInstallerSvcImpl();
512        }
513
514        @Bean
515        public IConsentContextServices consentContextServices() {
516                return new JpaConsentContextServices();
517        }
518
519        @Bean
520        @Lazy
521        public DiffProvider diffProvider() {
522                return new DiffProvider();
523        }
524
525        @Bean
526        @Lazy
527        public IPartitionLookupSvc partitionConfigSvc() {
528                return new PartitionLookupSvcImpl();
529        }
530
531        @Bean
532        @Lazy
533        public PartitionManagementProvider partitionManagementProvider() {
534                return new PartitionManagementProvider();
535        }
536
537        @Bean
538        @Lazy
539        public RequestTenantPartitionInterceptor requestTenantPartitionInterceptor() {
540                return new RequestTenantPartitionInterceptor();
541        }
542
543        @Bean
544        @Lazy
545        public TerminologyUploaderProvider terminologyUploaderProvider() {
546                return new TerminologyUploaderProvider();
547        }
548
549        @Bean
550        @Lazy
551        public ProcessMessageProvider processMessageProvider() {
552                return new ProcessMessageProvider();
553        }
554
555        @Bean
556        public ISchedulerService schedulerService() {
557                return new HapiSchedulerServiceImpl().setDefaultGroup(HAPI_DEFAULT_SCHEDULER_GROUP);
558        }
559
560        @Bean
561        public AutowiringSpringBeanJobFactory schedulerJobFactory() {
562                return new AutowiringSpringBeanJobFactory();
563        }
564
565        @Bean
566        public IBulkDataExportJobSchedulingHelper bulkDataExportJobSchedulingHelper(
567                        DaoRegistry theDaoRegistry,
568                        PlatformTransactionManager theTxManager,
569                        JpaStorageSettings theStorageSettings,
570                        BulkExportHelperService theBulkExportHelperSvc,
571                        IJobPersistence theJpaJobPersistence) {
572                return new BulkDataExportJobSchedulingHelperImpl(
573                                theDaoRegistry, theTxManager, theStorageSettings, theBulkExportHelperSvc, theJpaJobPersistence, null);
574        }
575
576        @Bean
577        @Lazy
578        public BulkDataExportProvider bulkDataExportProvider() {
579                return new BulkDataExportProvider();
580        }
581
582        @Bean
583        @Lazy
584        public IDeleteExpungeJobSubmitter deleteExpungeJobSubmitter() {
585                return new DeleteExpungeJobSubmitterImpl();
586        }
587
588        @Bean
589        @Lazy
590        public IBulkDataImportSvc bulkDataImportSvc() {
591                return new BulkDataImportSvcImpl();
592        }
593
594        @Bean
595        public PersistedJpaBundleProviderFactory persistedJpaBundleProviderFactory() {
596                return new PersistedJpaBundleProviderFactory();
597        }
598
599        @Bean
600        public SearchBuilderFactory<JpaPid> searchBuilderFactory() {
601                return new SearchBuilderFactory<>();
602        }
603
604        @Bean
605        public SqlObjectFactory sqlBuilderFactory() {
606                return new SqlObjectFactory();
607        }
608
609        @Bean
610        public HibernatePropertiesProvider HibernatePropertiesProvider() {
611                return new HibernatePropertiesProvider();
612        }
613
614        @Bean
615        public HistoryBuilderFactory historyBuilderFactory() {
616                return new HistoryBuilderFactory();
617        }
618
619        @Bean
620        public IResourceVersionSvc resourceVersionSvc() {
621                return new ResourceVersionSvcDaoImpl();
622        }
623
624        @Bean
625        public ISearchParamIdentityCacheSvc searchParamIdentityCacheSvc(
626                        @Autowired IResourceIndexedSearchParamIdentityDao theResourceIndexedSearchParamIdentityDao,
627                        @Autowired PlatformTransactionManager theTxManager,
628                        @Autowired MemoryCacheService theMemoryCacheService) {
629                return new SearchParamIdentityCacheSvcImpl(
630                                myStorageSettings, theResourceIndexedSearchParamIdentityDao, theTxManager, theMemoryCacheService);
631        }
632
633        @Bean
634        public IResourceTypeCacheSvc resourceTypeCacheSvc(
635                        @Autowired IHapiTransactionService theHapiTransactionService,
636                        @Autowired IResourceTypeDao theResourceTypeDao,
637                        @Autowired MemoryCacheService theMemoryCacheService) {
638                return new ResourceTypeCacheSvcImpl(theHapiTransactionService, theResourceTypeDao, theMemoryCacheService);
639        }
640
641        /* **************************************************************** *
642         * Prototype Beans Below                                            *
643         * **************************************************************** */
644
645        @Bean(name = PERSISTED_JPA_BUNDLE_PROVIDER)
646        @Scope("prototype")
647        public PersistedJpaBundleProvider newPersistedJpaBundleProvider(RequestDetails theRequest, String theUuid) {
648                return new PersistedJpaBundleProvider(theRequest, theUuid);
649        }
650
651        @Bean(name = PERSISTED_JPA_BUNDLE_PROVIDER_BY_SEARCH)
652        @Scope("prototype")
653        public PersistedJpaBundleProvider newPersistedJpaBundleProviderBySearch(
654                        RequestDetails theRequest, Search theSearch) {
655                return new PersistedJpaBundleProvider(theRequest, theSearch);
656        }
657
658        @Bean(name = PERSISTED_JPA_SEARCH_FIRST_PAGE_BUNDLE_PROVIDER)
659        @Scope("prototype")
660        public PersistedJpaSearchFirstPageBundleProvider newPersistedJpaSearchFirstPageBundleProvider(
661                        RequestDetails theRequest,
662                        SearchTask theSearchTask,
663                        ISearchBuilder theSearchBuilder,
664                        RequestPartitionId theRequestPartitionId) {
665                return new PersistedJpaSearchFirstPageBundleProvider(
666                                theSearchTask, theSearchBuilder, theRequest, theRequestPartitionId);
667        }
668
669        @Bean(name = RepositoryValidatingRuleBuilder.REPOSITORY_VALIDATING_RULE_BUILDER)
670        @Scope("prototype")
671        public RepositoryValidatingRuleBuilder repositoryValidatingRuleBuilder(IValidationSupport theValidationSupport) {
672                return new RepositoryValidatingRuleBuilder(theValidationSupport);
673        }
674
675        @Bean
676        @Scope("prototype")
677        public ComboUniqueSearchParameterPredicateBuilder newComboUniqueSearchParameterPredicateBuilder(
678                        SearchQueryBuilder theSearchSqlBuilder) {
679                return new ComboUniqueSearchParameterPredicateBuilder(theSearchSqlBuilder);
680        }
681
682        @Bean
683        @Scope("prototype")
684        public ComboNonUniqueSearchParameterPredicateBuilder newComboNonUniqueSearchParameterPredicateBuilder(
685                        SearchQueryBuilder theSearchSqlBuilder) {
686                return new ComboNonUniqueSearchParameterPredicateBuilder(theSearchSqlBuilder);
687        }
688
689        @Bean
690        @Scope("prototype")
691        public CoordsPredicateBuilder newCoordsPredicateBuilder(SearchQueryBuilder theSearchBuilder) {
692                return new CoordsPredicateBuilder(theSearchBuilder);
693        }
694
695        @Bean
696        @Scope("prototype")
697        public DatePredicateBuilder newDatePredicateBuilder(SearchQueryBuilder theSearchBuilder) {
698                return new DatePredicateBuilder(theSearchBuilder);
699        }
700
701        @Bean
702        @Scope("prototype")
703        public NumberPredicateBuilder newNumberPredicateBuilder(SearchQueryBuilder theSearchBuilder) {
704                return new NumberPredicateBuilder(theSearchBuilder);
705        }
706
707        @Bean
708        @Scope("prototype")
709        public QuantityPredicateBuilder newQuantityPredicateBuilder(SearchQueryBuilder theSearchBuilder) {
710                return new QuantityPredicateBuilder(theSearchBuilder);
711        }
712
713        @Bean
714        @Scope("prototype")
715        public QuantityNormalizedPredicateBuilder newQuantityNormalizedPredicateBuilder(
716                        SearchQueryBuilder theSearchBuilder) {
717                return new QuantityNormalizedPredicateBuilder(theSearchBuilder);
718        }
719
720        @Bean
721        @Scope("prototype")
722        public ResourceLinkPredicateBuilder newResourceLinkPredicateBuilder(
723                        QueryStack theQueryStack, SearchQueryBuilder theSearchBuilder, boolean theReversed) {
724                return new ResourceLinkPredicateBuilder(theQueryStack, theSearchBuilder, theReversed);
725        }
726
727        @Bean
728        @Scope("prototype")
729        public ResourceTablePredicateBuilder newResourceTablePredicateBuilder(
730                        SearchQueryBuilder theSearchBuilder, SearchIncludeDeletedEnum theSearchIncludeDeleted) {
731                return new ResourceTablePredicateBuilder(theSearchBuilder, theSearchIncludeDeleted);
732        }
733
734        @Bean
735        @Scope("prototype")
736        public TagPredicateBuilder newTagPredicateBuilder(SearchQueryBuilder theSearchBuilder) {
737                return new TagPredicateBuilder(theSearchBuilder);
738        }
739
740        @Bean
741        @Scope("prototype")
742        public ResourceIdPredicateBuilder newResourceIdPredicateBuilder(SearchQueryBuilder theSearchBuilder) {
743                return new ResourceIdPredicateBuilder(theSearchBuilder);
744        }
745
746        @Bean
747        @Scope("prototype")
748        public SearchParamPresentPredicateBuilder newSearchParamPresentPredicateBuilder(
749                        SearchQueryBuilder theSearchBuilder) {
750                return new SearchParamPresentPredicateBuilder(theSearchBuilder);
751        }
752
753        @Bean
754        @Scope("prototype")
755        public StringPredicateBuilder newStringPredicateBuilder(SearchQueryBuilder theSearchBuilder) {
756                return new StringPredicateBuilder(theSearchBuilder);
757        }
758
759        @Bean
760        @Scope("prototype")
761        public TokenPredicateBuilder newTokenPredicateBuilder(SearchQueryBuilder theSearchBuilder) {
762                return new TokenPredicateBuilder(theSearchBuilder);
763        }
764
765        @Bean
766        @Scope("prototype")
767        public ResourceHistoryPredicateBuilder newResourceHistoryPredicateBuilder(SearchQueryBuilder theSearchBuilder) {
768                return new ResourceHistoryPredicateBuilder(theSearchBuilder);
769        }
770
771        @Bean
772        @Scope("prototype")
773        public ResourceHistoryProvenancePredicateBuilder newResourceHistoryProvenancePredicateBuilder(
774                        SearchQueryBuilder theSearchBuilder) {
775                return new ResourceHistoryProvenancePredicateBuilder(theSearchBuilder);
776        }
777
778        @Bean
779        @Scope("prototype")
780        public UriPredicateBuilder newUriPredicateBuilder(SearchQueryBuilder theSearchBuilder) {
781                return new UriPredicateBuilder(theSearchBuilder);
782        }
783
784        @Bean
785        @Scope("prototype")
786        public SearchQueryExecutor newSearchQueryExecutor(GeneratedSql theGeneratedSql, Integer theMaxResultsToFetch) {
787                return new SearchQueryExecutor(theGeneratedSql, theMaxResultsToFetch);
788        }
789
790        @Bean(name = HISTORY_BUILDER)
791        @Scope("prototype")
792        public HistoryBuilder newHistoryBuilder(
793                        @Nullable String theResourceType,
794                        @Nullable JpaPid theResourceId,
795                        @Nullable Date theRangeStartInclusive,
796                        @Nullable Date theRangeEndInclusive) {
797                return new HistoryBuilder(theResourceType, theResourceId, theRangeStartInclusive, theRangeEndInclusive);
798        }
799
800        @Bean
801        @Primary
802        public ISearchParamProvider searchParamProvider() {
803                return new DaoSearchParamProvider();
804        }
805
806        @Bean
807        public IIdHelperService idHelperService() {
808                return new IdHelperService();
809        }
810
811        @Bean
812        public SearchStrategyFactory searchStrategyFactory(@Autowired(required = false) IFulltextSearchSvc theFulltextSvc) {
813                return new SearchStrategyFactory(myStorageSettings, theFulltextSvc);
814        }
815
816        @Bean
817        public DeleteConflictService deleteConflictService() {
818                return new DeleteConflictService();
819        }
820
821        @Bean
822        public DeleteConflictFinderService deleteConflictFinderService() {
823                return new DeleteConflictFinderService();
824        }
825
826        @Bean
827        public ExpungeService expungeService() {
828                return new ExpungeService();
829        }
830
831        @Bean
832        @Scope("prototype")
833        public ExpungeOperation expungeOperation(
834                        String theResourceName,
835                        IResourcePersistentId theResourceId,
836                        ExpungeOptions theExpungeOptions,
837                        RequestDetails theRequestDetails) {
838                return new ExpungeOperation(theResourceName, theResourceId, theExpungeOptions, theRequestDetails);
839        }
840
841        @Bean
842        public IExpungeEverythingService expungeEverythingService() {
843                return new ExpungeEverythingService();
844        }
845
846        @Bean
847        public IResourceExpungeService resourceExpungeService() {
848                return new JpaResourceExpungeService();
849        }
850
851        @Bean
852        public ISearchParamPresenceSvc searchParamPresenceService() {
853                return new SearchParamPresenceSvcImpl();
854        }
855
856        @Bean
857        public SearchParamWithInlineReferencesExtractor searchParamWithInlineReferencesExtractor() {
858                return new SearchParamWithInlineReferencesExtractor();
859        }
860
861        @Bean
862        public MatchResourceUrlService matchResourceUrlService() {
863                return new MatchResourceUrlService();
864        }
865
866        @Bean
867        public DaoSearchParamSynchronizer daoSearchParamSynchronizer() {
868                return new DaoSearchParamSynchronizer();
869        }
870
871        @Bean
872        public ResourceTableFKProvider resourceTableFKProvider() {
873                return new ResourceTableFKProvider();
874        }
875
876        @Bean
877        public ICacheWarmingSvc cacheWarmingSvc() {
878                return new CacheWarmingSvcImpl();
879        }
880
881        @Bean
882        public IndexNamePrefixLayoutStrategy indexLayoutStrategy() {
883                return new IndexNamePrefixLayoutStrategy();
884        }
885
886        @Bean
887        public ResourceLoaderImpl jpaResourceLoader() {
888                return new ResourceLoaderImpl();
889        }
890
891        @Bean
892        public UnknownCodeSystemWarningValidationSupport unknownCodeSystemWarningValidationSupport(
893                        FhirContext theFhirContext) {
894                return new UnknownCodeSystemWarningValidationSupport(theFhirContext);
895        }
896
897        @Bean
898        public ISynchronousSearchSvc synchronousSearchSvc() {
899                return new SynchronousSearchSvcImpl();
900        }
901
902        @Bean
903        public VersionCanonicalizer versionCanonicalizer(FhirContext theFhirContext) {
904                return new VersionCanonicalizer(theFhirContext);
905        }
906
907        @Bean
908        public SearchParameterDaoValidator searchParameterDaoValidator(
909                        FhirContext theFhirContext,
910                        JpaStorageSettings theStorageSettings,
911                        ISearchParamRegistry theSearchParamRegistry) {
912                return new SearchParameterDaoValidator(theFhirContext, theStorageSettings, theSearchParamRegistry);
913        }
914
915        @Bean
916        public ITermReadSvc terminologyService() {
917                return new TermReadSvcImpl();
918        }
919
920        @Bean
921        public ValueSetConceptAccumulatorFactory valueSetConceptAccumulatorFactory() {
922                return new ValueSetConceptAccumulatorFactory();
923        }
924
925        @Bean
926        @Scope("prototype")
927        public ValueSetConceptAccumulator valueSetConceptAccumulator(TermValueSet theTermValueSet) {
928                return valueSetConceptAccumulatorFactory().create(theTermValueSet);
929        }
930
931        @Bean
932        public ITermCodeSystemStorageSvc termCodeSystemStorageSvc() {
933                return new TermCodeSystemStorageSvcImpl();
934        }
935
936        @Bean
937        public ITermReindexingSvc termReindexingSvc() {
938                return new TermReindexingSvcImpl();
939        }
940
941        @Bean
942        @Scope("prototype")
943        public PersistenceContextProvider persistenceContextProvider() {
944                return new PersistenceContextProvider();
945        }
946
947        @Bean
948        public ResourceSearchUrlSvc resourceSearchUrlSvc(
949                        PersistenceContextProvider thePersistenceContextProvider,
950                        IResourceSearchUrlDao theResourceSearchUrlDao,
951                        MatchUrlService theMatchUrlService,
952                        FhirContext theFhirContext,
953                        PartitionSettings thePartitionSettings) {
954                return new ResourceSearchUrlSvc(
955                                thePersistenceContextProvider.getEntityManager(),
956                                theResourceSearchUrlDao,
957                                theMatchUrlService,
958                                theFhirContext,
959                                thePartitionSettings);
960        }
961
962        @Bean
963        public ISearchUrlJobMaintenanceSvc searchUrlJobMaintenanceSvc(ResourceSearchUrlSvc theResourceSearchUrlSvc) {
964                return new SearchUrlJobMaintenanceSvcImpl(theResourceSearchUrlSvc);
965        }
966
967        @Bean
968        public IResourceModifiedMessagePersistenceSvc subscriptionMessagePersistence(
969                        FhirContext theFhirContext,
970                        IResourceModifiedDao theIResourceModifiedDao,
971                        DaoRegistry theDaoRegistry,
972                        HapiTransactionService theHapiTransactionService) {
973                return new ResourceModifiedMessagePersistenceSvcImpl(
974                                theFhirContext, theIResourceModifiedDao, theDaoRegistry, theHapiTransactionService);
975        }
976
977        @Bean
978        public IMetaTagSorter metaTagSorter() {
979                return new MetaTagSorterAlphabetical();
980        }
981
982        @Bean
983        public ResourceHistoryCalculator resourceHistoryCalculator(
984                        FhirContext theFhirContext, HibernatePropertiesProvider theHibernatePropertiesProvider) {
985                return new ResourceHistoryCalculator(theFhirContext, theHibernatePropertiesProvider.isOracleDialect());
986        }
987
988        @Bean
989        public CacheTagDefinitionDao tagDefinitionDao(
990                        ITagDefinitionDao tagDefinitionDao, MemoryCacheService memoryCacheService) {
991                return new CacheTagDefinitionDao(tagDefinitionDao, memoryCacheService);
992        }
993
994        @Bean
995        public Batch2TaskHelper batch2TaskHelper() {
996                return new Batch2TaskHelper();
997        }
998
999        @Bean
1000        public IReplaceReferencesSvc replaceReferencesSvc(
1001                        DaoRegistry theDaoRegistry,
1002                        HapiTransactionService theHapiTransactionService,
1003                        IResourceLinkDao theResourceLinkDao,
1004                        IJobCoordinator theJobCoordinator,
1005                        ReplaceReferencesPatchBundleSvc theReplaceReferencesPatchBundle,
1006                        Batch2TaskHelper theBatch2TaskHelper,
1007                        JpaStorageSettings theStorageSettings,
1008                        ReplaceReferencesProvenanceSvc theProvenanceSvc) {
1009                return new ReplaceReferencesSvcImpl(
1010                                theDaoRegistry,
1011                                theHapiTransactionService,
1012                                theResourceLinkDao,
1013                                theJobCoordinator,
1014                                theReplaceReferencesPatchBundle,
1015                                theBatch2TaskHelper,
1016                                theStorageSettings,
1017                                theProvenanceSvc);
1018        }
1019
1020        @Primary
1021        @Bean
1022        public ReplaceReferencesProvenanceSvc replaceReferencesProvenanceSvc(DaoRegistry theDaoRegistry) {
1023                return new ReplaceReferencesProvenanceSvc(theDaoRegistry);
1024        }
1025
1026        @Bean
1027        public ReplaceReferencesPatchBundleSvc replaceReferencesPatchBundleSvc(DaoRegistry theDaoRegistry) {
1028                return new ReplaceReferencesPatchBundleSvc(theDaoRegistry);
1029        }
1030
1031        @Bean
1032        public PreviousResourceVersionRestorer resourceVersionRestorer(
1033                        DaoRegistry theDaoRegistry, HapiTransactionService theHapiTransactionService) {
1034                return new PreviousResourceVersionRestorer(theDaoRegistry, theHapiTransactionService);
1035        }
1036
1037        @Bean
1038        public UndoReplaceReferencesSvc getUndoReplaceReferencesSvc(
1039                        DaoRegistry theDaoRegistry,
1040                        ReplaceReferencesProvenanceSvc theProvenanceSvc,
1041                        PreviousResourceVersionRestorer theResourceVersionRestorer) {
1042                return new UndoReplaceReferencesSvc(theDaoRegistry, theProvenanceSvc, theResourceVersionRestorer);
1043        }
1044
1045        @Bean
1046        public PartitionedIdModeVerificationSvc partitionedIdModeVerificationSvc(
1047                        PartitionSettings thePartitionSettings,
1048                        HibernatePropertiesProvider theHibernatePropertiesProvider,
1049                        PlatformTransactionManager theTxManager) {
1050                return new PartitionedIdModeVerificationSvc(thePartitionSettings, theHibernatePropertiesProvider, theTxManager);
1051        }
1052}