Created
December 18, 2017 09:47
-
-
Save kwon37xi/7de8dbe1a8ac7d31995c945eee3f796d to your computer and use it in GitHub Desktop.
MySQLQuery와 JPASQLQuery 를 참조해서 만든 MySQLJPASQLQuery : QueryDSL 3.x
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// MySQLQuery와 JPASQLQuery 를 참조해서 만든 MySQLJPASQLQuery : QueryDSL 3.x | |
public class MySQLJPASQLQuery extends AbstractJPASQLQuery<MySQLJPASQLQuery> { | |
private static final Joiner JOINER = Joiner.on(", "); | |
public MySQLJPASQLQuery(EntityManager entityManager, SQLTemplates sqlTemplates) { | |
super(entityManager, new Configuration(sqlTemplates)); | |
} | |
public MySQLJPASQLQuery forceIndex(String... indexes) { | |
return addJoinFlag(" force index (" + JOINER.join(indexes) + ")", JoinFlag.Position.END); | |
} | |
public MySQLJPASQLQuery ignoreIndex(String... indexes) { | |
return addJoinFlag(" ignore index (" + JOINER.join(indexes) + ")", JoinFlag.Position.END); | |
} | |
public MySQLJPASQLQuery useIndex(String... indexes) { | |
return addJoinFlag(" use index (" + JOINER.join(indexes) + ")", JoinFlag.Position.END); | |
} | |
@Override | |
public MySQLJPASQLQuery clone(EntityManager entityManager) { | |
MySQLJPASQLQuery q = new MySQLJPASQLQuery(entityManager, configuration, queryHandler, getMetadata().clone()); | |
q.clone(this); | |
return q; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment