Search in sources :

Example 1 with BackendSetupStrategy

use of org.hibernate.search.util.impl.integrationtest.common.rule.BackendSetupStrategy in project hibernate-search by hibernate.

the class DocumentationSetupHelper method testParamsForBothAnnotationsAndProgrammatic.

public static List<DocumentationSetupHelper> testParamsForBothAnnotationsAndProgrammatic(BackendSetupStrategy backendSetupStrategy, BackendConfiguration defaultBackendConfiguration, Set<Class<?>> additionalAnnotatedClasses, Consumer<ProgrammaticMappingConfigurationContext> programmaticMappingContributor) {
    List<DocumentationSetupHelper> result = new ArrayList<>();
    // Annotation-based mapping
    HibernateOrmSearchMappingConfigurer annotationMappingConfigurer = additionalAnnotatedClasses.isEmpty() ? null : context -> context.annotationMapping().add(additionalAnnotatedClasses);
    result.add(new DocumentationSetupHelper(backendSetupStrategy, null, annotationMappingConfigurer));
    // Programmatic mapping
    HibernateOrmSearchMappingConfigurer programmaticMappingConfigurer = context -> programmaticMappingContributor.accept(context.programmaticMapping());
    result.add(new DocumentationSetupHelper(backendSetupStrategy, false, programmaticMappingConfigurer));
    return result;
}
Also used : Arrays(java.util.Arrays) SchemaManagementStrategyName(org.hibernate.search.mapper.orm.schema.management.SchemaManagementStrategyName) SimpleSessionFactoryBuilder(org.hibernate.search.util.impl.integrationtest.mapper.orm.SimpleSessionFactoryBuilder) SessionFactory(org.hibernate.SessionFactory) Set(java.util.Set) HibernateOrmMappingHandle(org.hibernate.search.util.impl.integrationtest.mapper.orm.HibernateOrmMappingHandle) ArrayList(java.util.ArrayList) LinkedHashMap(java.util.LinkedHashMap) Consumer(java.util.function.Consumer) AutomaticIndexingSynchronizationStrategyNames(org.hibernate.search.mapper.orm.automaticindexing.session.AutomaticIndexingSynchronizationStrategyNames) List(java.util.List) ProgrammaticMappingConfigurationContext(org.hibernate.search.mapper.pojo.mapping.definition.programmatic.ProgrammaticMappingConfigurationContext) HibernateOrmMapperSettings(org.hibernate.search.mapper.orm.cfg.HibernateOrmMapperSettings) HibernateOrmSearchMappingConfigurer(org.hibernate.search.mapper.orm.mapping.HibernateOrmSearchMappingConfigurer) Map(java.util.Map) MappingSetupHelper(org.hibernate.search.util.impl.integrationtest.common.rule.MappingSetupHelper) BackendMappingHandle(org.hibernate.search.util.impl.integrationtest.common.stub.backend.BackendMappingHandle) BackendSetupStrategy(org.hibernate.search.util.impl.integrationtest.common.rule.BackendSetupStrategy) Collections(java.util.Collections) BackendConfiguration(org.hibernate.search.util.impl.integrationtest.common.rule.BackendConfiguration) HibernateOrmSearchMappingConfigurer(org.hibernate.search.mapper.orm.mapping.HibernateOrmSearchMappingConfigurer) ArrayList(java.util.ArrayList)

Aggregations

ArrayList (java.util.ArrayList)1 Arrays (java.util.Arrays)1 Collections (java.util.Collections)1 LinkedHashMap (java.util.LinkedHashMap)1 List (java.util.List)1 Map (java.util.Map)1 Set (java.util.Set)1 Consumer (java.util.function.Consumer)1 SessionFactory (org.hibernate.SessionFactory)1 AutomaticIndexingSynchronizationStrategyNames (org.hibernate.search.mapper.orm.automaticindexing.session.AutomaticIndexingSynchronizationStrategyNames)1 HibernateOrmMapperSettings (org.hibernate.search.mapper.orm.cfg.HibernateOrmMapperSettings)1 HibernateOrmSearchMappingConfigurer (org.hibernate.search.mapper.orm.mapping.HibernateOrmSearchMappingConfigurer)1 SchemaManagementStrategyName (org.hibernate.search.mapper.orm.schema.management.SchemaManagementStrategyName)1 ProgrammaticMappingConfigurationContext (org.hibernate.search.mapper.pojo.mapping.definition.programmatic.ProgrammaticMappingConfigurationContext)1 BackendConfiguration (org.hibernate.search.util.impl.integrationtest.common.rule.BackendConfiguration)1 BackendSetupStrategy (org.hibernate.search.util.impl.integrationtest.common.rule.BackendSetupStrategy)1 MappingSetupHelper (org.hibernate.search.util.impl.integrationtest.common.rule.MappingSetupHelper)1 BackendMappingHandle (org.hibernate.search.util.impl.integrationtest.common.stub.backend.BackendMappingHandle)1 HibernateOrmMappingHandle (org.hibernate.search.util.impl.integrationtest.mapper.orm.HibernateOrmMappingHandle)1 SimpleSessionFactoryBuilder (org.hibernate.search.util.impl.integrationtest.mapper.orm.SimpleSessionFactoryBuilder)1