Skip to content

Commit

Permalink
feat: DataBaseConfig (#11)
Browse files Browse the repository at this point in the history
QueryDSL 의존성 추가 및 JPAQueryFactory Spring Bean 등록
  • Loading branch information
toychip committed Dec 14, 2023
1 parent a5c2089 commit b28094f
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions src/main/java/com/api/TaveShot/global/config/DataBaseConfig.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
package com.api.TaveShot.global.config;

import com.querydsl.jpa.impl.JPAQueryFactory;
import jakarta.persistence.EntityManager;
import jakarta.persistence.PersistenceContext;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class DataBaseConfig {

@PersistenceContext
private EntityManager entityManager;

@Bean
public JPAQueryFactory jpaQueryFactory() {
return new JPAQueryFactory(entityManager);
}
}

0 comments on commit b28094f

Please sign in to comment.