Package org.springframework.orm.jpa.persistenceunit

Examples of org.springframework.orm.jpa.persistenceunit.PersistenceUnitPostProcessor


            List<PersistenceUnitPostProcessor> postProcessors = new ArrayList<PersistenceUnitPostProcessor>();
            for (BeanDefinitionHolder postProcBeanDef : (ManagedList<BeanDefinitionHolder>) puiPostProcProperty.getValue())
            {
                String beanName = postProcBeanDef.getBeanName();
                BeanDefinition beanDefinition = postProcBeanDef.getBeanDefinition();
                PersistenceUnitPostProcessor postProcessor = (PersistenceUnitPostProcessor) context.createBean(beanName, beanDefinition);
                postProcessors.add(postProcessor);
            }
            defpum.setPersistenceUnitPostProcessors(postProcessors.toArray(new PersistenceUnitPostProcessor[postProcessors.size()]));
        }
View Full Code Here


  }

  @Test
  public void findsEntityClassesForBasePackage() {

    PersistenceUnitPostProcessor processor = new ClasspathScanningPersistenceUnitPostProcessor(basePackage);
    processor.postProcessPersistenceUnitInfo(pui);

    verify(pui).addManagedClassName(SampleEntity.class.getName());
  }
View Full Code Here

    hibernateJpaVendorAdapter.setDatabasePlatform(database.getDialect());
    hibernateJpaVendorAdapter.setShowSql(false);
    emf.setJpaVendorAdapter(hibernateJpaVendorAdapter);
    // To search entity packages from other jar files..
    emf.setPackagesToScan("empty");
    emf.setPersistenceUnitPostProcessors(new PersistenceUnitPostProcessor() {
      @Override
      public void postProcessPersistenceUnitInfo(MutablePersistenceUnitInfo pui) {
        Reflections reflections = new Reflections(ControllerConstants.DEFAULT_PACKAGE_NAME);
        for (Class<?> each : reflections.getTypesAnnotatedWith(Entity.class)) {
          LOGGER.trace("Entity class {} is detected as the SpringData entity.", each.getName());
View Full Code Here

TOP

Related Classes of org.springframework.orm.jpa.persistenceunit.PersistenceUnitPostProcessor

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.