@@ -0,0 +1,2754 @@
+package com.enseirb.telecom.dngroup.dvd2c.conf;%0A%0Aimport javax.annotation.Resource;%0Aimport javax.persistence.EntityManagerFactory;%0Aimport javax.sql.DataSource;%0A%0Aimport org.springframework.context.annotation.Bean;%0Aimport org.springframework.context.annotation.ComponentScan;%0Aimport org.springframework.context.annotation.Configuration;%0Aimport org.springframework.core.env.Environment;%0Aimport org.springframework.data.jpa.repository.config.EnableJpaRepositories;%0Aimport org.springframework.jdbc.datasource.DriverManagerDataSource;%0Aimport org.springframework.orm.jpa.JpaTransactionManager;%0Aimport org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean;%0Aimport org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter;%0Aimport org.springframework.transaction.PlatformTransactionManager;%0Aimport org.springframework.transaction.annotation.EnableTransactionManagement;%0A%0A@Configuration%0A@EnableTransactionManagement%0A@ComponentScan(%22com.spr%22)%0A@EnableJpaRepositories(%22com.enseirb.telecom.dngroup.dvd2c.db%22)%0Aclass ApplicationConfig %7B%0A%0A%09private static final String PROPERTY_NAME_DATABASE_DRIVER = %22com.mysql.jdbc.Driver%22;%0A%09private static final String PROPERTY_NAME_DATABASE_PASSWORD = %22mediahome%22;%0A%09private static final String PROPERTY_NAME_DATABASE_URL = %22jdbc:mysql://localhost:3306/mediahome%22;%0A%09private static final String PROPERTY_NAME_DATABASE_USERNAME = %22mediahome%22;%0A%0A%09private static final String PROPERTY_NAME_HIBERNATE_DIALECT = %22hibernate.dialect%22;%0A%09private static final String PROPERTY_NAME_HIBERNATE_SHOW_SQL = %22hibernate.show_sql%22;%0A%09private static final String PROPERTY_NAME_ENTITYMANAGER_PACKAGES_TO_SCAN = %22com.enseirb.telecom.dngroup.dvd2c.db%22;%0A%0A%0A%0A%09@Bean%0A%09public DataSource dataSource() %7B%0A%0A%09%09DriverManagerDataSource dataSource = new DriverManagerDataSource();%0A%0A%09%09dataSource.setDriverClassName(PROPERTY_NAME_DATABASE_DRIVER);%0A%09%09dataSource.setUrl(PROPERTY_NAME_DATABASE_URL);%0A%09%09dataSource.setUsername(PROPERTY_NAME_DATABASE_USERNAME);%0A%09%09dataSource.setPassword(PROPERTY_NAME_DATABASE_PASSWORD);%0A%0A%09%09return dataSource;%0A%09%7D%0A%0A%09@Bean%0A%09public EntityManagerFactory entityManagerFactory() %7B%0A%0A%09%09HibernateJpaVendorAdapter vendorAdapter = new HibernateJpaVendorAdapter();%0A%09%09vendorAdapter.setGenerateDdl(true);%0A%0A%09%09LocalContainerEntityManagerFactoryBean factory = new LocalContainerEntityManagerFactoryBean();%0A%09%09factory.setJpaVendorAdapter(vendorAdapter);%0A%09%09factory.setPackagesToScan(PROPERTY_NAME_ENTITYMANAGER_PACKAGES_TO_SCAN);%0A%09%09factory.setDataSource(dataSource());%0A%09%09factory.afterPropertiesSet();%0A%0A%09%09return factory.getObject();%0A%09%7D%0A%0A%09@Bean%0A%09public PlatformTransactionManager transactionManager() %7B%0A%0A%09%09JpaTransactionManager txManager = new JpaTransactionManager();%0A%09%09txManager.setEntityManagerFactory(entityManagerFactory());%0A%09%09return txManager;%0A%09%7D%0A%0A%7D%0A

Add forget file