Pessoal, estou com duvidas referentes a configuração do JPAConfiguration, porém nao queria usar o MySql, qeria usar o Sql Server... como fica a classe JPAConfiguration utilizando sqlserver ?
Segue o codigo da classe JPAConfiguration... ( Fiz algumas configuraçoes porem apresenta erro de notfoundclass.
@EnableTransactionManagement
public class JPAConfiguration {
@Bean
public LocalContainerEntityManagerFactoryBean entityManagerFactory() {
LocalContainerEntityManagerFactoryBean factoryBean = new LocalContainerEntityManagerFactoryBean();
JpaVendorAdapter vendorAdapter = new HibernateJpaVendorAdapter();
factoryBean.setJpaVendorAdapter(vendorAdapter);
DriverManagerDataSource dataSource = new DriverManagerDataSource();
dataSource.setUsername("sa");
dataSource.setPassword("123123");
dataSource.setUrl("jdbc:sqlserver://localhost;databaseName=casadocodigo");
dataSource.setDriverClassName("com.microsoft.sqlserver.jdbc.SQLServerDriver");
factoryBean.setDataSource(dataSource);
Properties props = new Properties();
props.setProperty("hibernate.dialect", "org.hibernate.dialect.SQLServer2012Dialect");
props.setProperty("hibernate.show_sql", "true");
props.setProperty("hibernate.hbm2ddl.auto", "update");
factoryBean.setJpaProperties(props);
factoryBean.setPackagesToScan("br.com.casadocodigo.loja.models");
return factoryBean;
}
@Bean
public JpaTransactionManager transactionManager(EntityManagerFactory emf){
return new JpaTransactionManager(emf);
}
}