Java 类org.springframework.boot.autoconfigure.domain.EntityScanner 实例源码

项目:spring-data-documentdb    文件:DocumentDbTemplateIT.java   
@Before
public void setup() {
    mappingContext = new DocumentDbMappingContext();
    try {
        mappingContext.setInitialEntitySet(new EntityScanner(this.applicationContext)
                .scan(Persistent.class));
    } catch (ClassNotFoundException e) {
        throw new RuntimeException(e.getMessage());

    }
    dbConverter = new MappingDocumentDbConverter(mappingContext);
    documentClient = new DocumentClient(documentDbUri, documentDbKey,
            ConnectionPolicy.GetDefault(), ConsistencyLevel.Session);

    dbTemplate = new DocumentDbTemplate(documentClient, dbConverter, TEST_DB_NAME);

    dbTemplate.createCollectionIfNotExists(Person.class.getSimpleName(), null, null);
    dbTemplate.insert(Person.class.getSimpleName(), TEST_PERSON, null);
}
项目:spring-multitenancy    文件:MultitenancyAutoConfiguration.java   
@Bean
@ConditionalOnMissingBean
public MongoMappingContext mongoMappingContext(BeanFactory beanFactory, ApplicationContext applicationContext) throws ClassNotFoundException {

    MongoMappingContext context = new MongoMappingContext();
    context.setInitialEntitySet(new EntityScanner(applicationContext).scan(Document.class, Persistent.class));
    return context;
}
项目:https-github.com-g0t4-jenkins2-course-spring-boot    文件:MongoDataAutoConfiguration.java   
@Bean
@ConditionalOnMissingBean
public MongoMappingContext mongoMappingContext(BeanFactory beanFactory)
        throws ClassNotFoundException {
    MongoMappingContext context = new MongoMappingContext();
    context.setInitialEntitySet(new EntityScanner(this.applicationContext)
            .scan(Document.class, Persistent.class));
    Class<?> strategyClass = this.properties.getFieldNamingStrategy();
    if (strategyClass != null) {
        context.setFieldNamingStrategy(
                (FieldNamingStrategy) BeanUtils.instantiate(strategyClass));
    }
    return context;
}
项目:https-github.com-g0t4-jenkins2-course-spring-boot    文件:SpringBootCouchbaseDataConfiguration.java   
@Override
protected Set<Class<?>> getInitialEntitySet() throws ClassNotFoundException {
    return new EntityScanner(this.applicationContext).scan(Document.class,
            Persistent.class);
}