문서의 선택한 두 판 사이의 차이를 보여줍니다.
양쪽 이전 판 이전 판 다음 판 | 이전 판 | ||
java:querydsl:nativesql [2017/12/18 17:58] kwon37xi [JPASQLQuery 에서 native query 추가] |
java:querydsl:nativesql [2022/01/21 23:23] (현재) kwon37xi [문제점] |
||
---|---|---|---|
줄 2: | 줄 2: | ||
* [[gradle: | * [[gradle: | ||
- | ===== SQL 생성시 schema(catalog) | + | ===== XxxQueryFactory 를 사용하여 쿼리를 시작하라 |
+ | * [[http:// | ||
+ | * [[https:// | ||
+ | * [[https:// | ||
+ | * [[https:// | ||
+ | |||
+ | ===== SQL 생성시 schema 이름도 함께 출력 ===== | ||
* 아래와 같이 '' | * 아래와 같이 '' | ||
SQLTemplates mysqlTemplates = MySQLTemplates.builder().printSchema().build(); | SQLTemplates mysqlTemplates = MySQLTemplates.builder().printSchema().build(); | ||
줄 12: | 줄 18: | ||
</ | </ | ||
- | ===== JPASQLQuery 에서 native query 추가 | + | ===== XXXSQLQuery의 확장 |
- | * '' | + | * '' |
+ | * JPASQLQuery 에서 native query 추가 : '' | ||
+ | * [[https:// | ||
+ | * [[http:// | ||
- | <code java> | + | ===== 문제점 ===== |
- | // MySQLQuery와 JPASQLQuery 를 참조해서 만든 MySQLJPASQLQuery | + | * 현재 catalog 개념을 지원하지 않는다. [[: |
- | public class MySQLJPASQLQuery extends AbstractJPASQLQuery< | + | * [[database:mysql|MySQL]] 은 스키마 지정으로 가능하다. |
- | | + | * '' |
+ | | ||
+ | * 따라서 위 두 클래스를 상속하는 클래스에서 '' | ||
+ | * 혹은 '' | ||
- | public MySQLJPASQLQuery(EntityManager entityManager, | + | ===== infobip-spring-data-querydsl ===== |
- | | + | * https:// |
- | } | + | ===== 참조 ===== |
- | + | * [[https:// | |
- | public MySQLJPASQLQuery forceIndex(String... indexes) { | + | * [[https:// |
- | | + | |
- | | + | |
- | } | + | |
- | + | ||
- | public MySQLJPASQLQuery ignoreIndex(String... indexes) { | + | |
- | | + | |
- | return this; | + | |
- | } | + | |
- | + | ||
- | public MySQLJPASQLQuery useIndex(String... indexes) { | + | |
- | addJoinFlag(" | + | |
- | return this; | + | |
- | } | + | |
- | + | ||
- | @Override | + | |
- | public MySQLJPASQLQuery clone(EntityManager entityManager) { | + | |
- | MySQLJPASQLQuery q = new MySQLJPASQLQuery(entityManager, | + | |
- | q.clone(this); | + | |
- | return q; | + | |
- | } | + | |
- | } | + | |
- | </code> | + |