package org.jboss.data.hibernatesearch.repository.config;

import org.jboss.data.hibernatesearch.repository.support.HibernateSearchRepositoryFactoryBean;
import org.springframework.beans.factory.support.BeanDefinitionBuilder;
import org.springframework.core.annotation.AnnotationAttributes;
import org.springframework.data.repository.config.AnnotationRepositoryConfigurationSource;
import org.springframework.data.repository.config.RepositoryConfigurationExtensionSupport;

/**
 * @author <a href="mailto:ales.justin@jboss.org">Ales Justin</a>
 */
public class HibernateSearchRepositoryConfigExtension extends RepositoryConfigurationExtensionSupport {
  @Override
  protected String getModulePrefix() {
    return "hibernatesearch";
  }

  @Override
  public String getRepositoryFactoryClassName() {
    return HibernateSearchRepositoryFactoryBean.class.getName();
  }

  @Override
  public void postProcess(BeanDefinitionBuilder builder, AnnotationRepositoryConfigurationSource config) {
    AnnotationAttributes attributes = config.getAttributes();
    builder.addPropertyReference("searchIntegrator", attributes.getString("searchIntegratorRef"));
    builder.addPropertyReference("datasourceMapper", attributes.getString("datasourceMapperRef"));
  }
}

@@ -52,16 +52,241 @@
 onfig;%0A%0A
+import java.lang.annotation.Annotation;%0Aimport java.util.Collection;%0Aimport java.util.Collections;%0A%0Aimport org.hibernate.search.annotations.Indexed;%0Aimport org.jboss.data.hibernatesearch.repository.HibernateSearchRepository;%0A
 import o
@@ -952,24 +952,317 @@
 arch%22;%0A  %7D%0A%0A
+  @Override%0A  protected Collection%3CClass%3C? extends Annotation%3E%3E getIdentifyingAnnotations() %7B%0A    return Collections.singletonList(Indexed.class);%0A  %7D%0A%0A  @Override%0A  protected Collection%3CClass%3C?%3E%3E getIdentifyingTypes() %7B%0A    return Collections.singleton(HibernateSearchRepository.class);%0A  %7D%0A%0A
   @Override%0A

Add more identifying info.