@@ -0,0 +1,2476 @@
+package cane.brothers.circus;%0D%0A%0D%0Aimport javax.persistence.EntityManagerFactory;%0D%0Aimport javax.sql.DataSource;%0D%0A%0D%0Aimport org.springframework.context.annotation.Bean;%0D%0Aimport org.springframework.context.annotation.Configuration;%0D%0Aimport org.springframework.data.jpa.repository.config.EnableJpaRepositories;%0D%0Aimport org.springframework.jdbc.datasource.embedded.EmbeddedDatabaseBuilder;%0D%0Aimport org.springframework.jdbc.datasource.embedded.EmbeddedDatabaseType;%0D%0Aimport org.springframework.orm.jpa.JpaTransactionManager;%0D%0Aimport org.springframework.orm.jpa.JpaVendorAdapter;%0D%0Aimport org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean;%0D%0Aimport org.springframework.orm.jpa.vendor.Database;%0D%0Aimport org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter;%0D%0A%0D%0A@Configuration%0D%0A//@EnableTransactionManagement%0D%0A@EnableJpaRepositories(basePackages=%22cane.brothers.circus.repository%22)%0D%0Apublic class JpaConfig %7B%0D%0A%0D%0A%09%0D%0A//%09@Bean%0D%0A//    public DataSourceInitializer dataSourceInitializer(DataSource dataSource)%0D%0A//    %7B%0D%0A//        ResourceDatabasePopulator resourceDatabasePopulator = new ResourceDatabasePopulator();%0D%0A//        resourceDatabasePopulator.addScript(new ClassPathResource(%22/schema.sql%22));%0D%0A//%0D%0A//        DataSourceInitializer dataSourceInitializer = new DataSourceInitializer();%0D%0A//        dataSourceInitializer.setDataSource(dataSource);%0D%0A//        dataSourceInitializer.setDatabasePopulator(resourceDatabasePopulator);%0D%0A//        return dataSourceInitializer;%0D%0A//    %7D%0D%0A%09%0D%0A%09@Bean%0D%0A%09public DataSource dataSource() %7B%0D%0A%09%09return new EmbeddedDatabaseBuilder().setType(EmbeddedDatabaseType.H2).build();%0D%0A%09%7D%0D%0A%0D%0A%09@Bean%0D%0A%09public JpaTransactionManager transactionManager(EntityManagerFactory emf) %7B%0D%0A%09%09return new JpaTransactionManager(emf);%0D%0A%09%7D%0D%0A%0D%0A%09@Bean%0D%0A%09public JpaVendorAdapter jpaVendorAdapter() %7B%0D%0A%09%09HibernateJpaVendorAdapter jpaVendorAdapter = new HibernateJpaVendorAdapter();%0D%0A%09%09jpaVendorAdapter.setDatabase(Database.H2);%0D%0A%09%09jpaVendorAdapter.setGenerateDdl(true);%0D%0A%09%09return jpaVendorAdapter;%0D%0A%09%7D%0D%0A%0D%0A%09@Bean%0D%0A%09public LocalContainerEntityManagerFactoryBean entityManagerFactory() %7B%0D%0A%09%09LocalContainerEntityManagerFactoryBean lemfb = new LocalContainerEntityManagerFactoryBean();%0D%0A%09%09lemfb.setDataSource(dataSource());%0D%0A%09%09lemfb.setJpaVendorAdapter(jpaVendorAdapter());%0D%0A%09%09lemfb.setPackagesToScan(%22cane.brothers.circus%22);%0D%0A%09%09return lemfb;%0D%0A%09%7D%0D%0A%09%0D%0A%09// services%0D%0A%09%0D%0A//%09@Bean%0D%0A//%09public EmployeeService employeeService() %7B%0D%0A//%09%09return new JpaEmployeeService();%0D%0A//%09%7D%0D%0A%7D

add java config