2016년 11월 23일 수요일

[자바강의,스프링강의,JPA강의추천_탑크리에듀][JPA,Querydsl강좌]스프링에서Querydsl,SQLQueryFactory생성하기

[JPA,Querydsl강좌]스프링에서Querydsl,SQLQueryFactory생성하기

        @Autowired 
DataSource dataSource; 

@Transactional() 
public void run(String... args) { 
///////// 


public PlatformTransactionManager transactionManager() { 
return new DataSourceTransactionManager(dataSource); 


public Configuration querydslConfiguration() { 
SQLTemplates templates = MySQLTemplates.builder().build(); 
Configuration configuration = new Configuration(templates); 
configuration.setExceptionTranslator(new SpringExceptionTranslator()); 
return configuration; 


public SQLQueryFactory queryFactory() { 
Provider<Connection> provider = new SpringConnectionProvider(dataSource); 
return new SQLQueryFactory(querydslConfiguration(), provider); 
}

댓글 없음:

댓글 쓰기