/** * Gets package names to scan to detect JPA Entity classes, using {@link JpaEntityScan} (or {@link EntityScan} for * default data context id) annotation. * @param dataContextId Data context id * @return Package names to scan to detect JPA Entity classes */ protected String[] getPackagesToScan(String dataContextId) { List<String> packages = JpaEntityScanPackages.get(beanFactory, dataContextId).getPackageNames(); if (packages.isEmpty() && dataContextId == null) { packages = EntityScanPackages.get(beanFactory).getPackageNames(); } return packages.toArray(new String[packages.size()]); }
private String[] getPackagesToScan() { List<String> packages = EntityScanPackages.get(this.applicationContext) .getPackageNames(); if (packages.isEmpty() && AutoConfigurationPackages.has(this.applicationContext)) { packages = AutoConfigurationPackages.get(this.applicationContext); } return packages.toArray(new String[packages.size()]); }
@Bean @ConditionalOnMissingBean public CassandraMappingContext cassandraMapping() throws ClassNotFoundException { BasicCassandraMappingContext context = new BasicCassandraMappingContext(); List<String> packages = EntityScanPackages.get(this.beanFactory) .getPackageNames(); if (packages.isEmpty() && AutoConfigurationPackages.has(this.beanFactory)) { packages = AutoConfigurationPackages.get(this.beanFactory); } if (!packages.isEmpty()) { context.setInitialEntitySet(CassandraEntityClassScanner.scan(packages)); } return context; }
protected String[] getPackagesToScan() { List<String> packages = EntityScanPackages.get(this.beanFactory) .getPackageNames(); if (packages.isEmpty() && AutoConfigurationPackages.has(this.beanFactory)) { packages = AutoConfigurationPackages.get(this.beanFactory); } return packages.toArray(new String[packages.size()]); }
@Bean public static BeanFactoryPostProcessor entityScanPackagesPostProcessor() { return new BeanFactoryPostProcessor() { @Override public void postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory) throws BeansException { if (beanFactory instanceof BeanDefinitionRegistry) { EntityScanPackages.register((BeanDefinitionRegistry) beanFactory, Collections.singletonList(Schema.class.getPackage().getName())); } } }; }