#How to get control of Spring Data JPA's Complex Query

8 messages ยท Page 1 of 1 (latest)

dull igloo
#

Hello ๐Ÿ˜
I am new to hibernate/jpa/spring-data-jpa and I am curious about the complex quereis or subqueries.
the document says spring-data-jpa has subquery-related functinons.

However, It doesn't seem convienient when query get complex. like 30 lines of single query.
native query is good. But separating the Query Logic and Java code would be nice to think.

  1. So, what do you guys use?
    Do people use QueryDSL or Mybatis for complex queryies and subqueries?

  2. What is your Preference?

  3. Can I use Mybatis + Spring Data JPA combination? or should I use QueryDSL + Spring Data JPA? Or use Both queryDSL and Mybatis and Spring Data JPA?

west quarryBOT
#

โŒ› This post has been reserved for your question.

Hey @dull igloo! Please use /close or the Close Post button above when your problem is solved. Please remember to follow the help guidelines. This post will be automatically closed after 300 minutes of inactivity.

TIP: Narrow down your issue to simple and precise questions to maximize the chance that others will reply in here.

gray cargo
#

Are you going to support 3 different models for QueryDSL, MyBatis and Spring Data?

dull igloo
gray cargo
#

AFAIR MyBatis needs table definitions in XML files?

west quarryBOT
#

๐Ÿ’ค Post marked as dormant

This post has been inactive for over 300 minutes, thus, it has been archived.
If your question was not answered yet, feel free to re-open this post or create a new one.
In case your post is not getting any attention, you can try to use /help ping.
Warning: abusing this will result in moderative actions taken against you.

dull igloo
# gray cargo AFAIR MyBatis needs table definitions in XML files?

you are right. I looked up mybatis and it does. I need a mapper xml file.
Too much support to mapping 3 different models right?

So, I think when query get too complex, using mybatis for that query is fine when using mybatis + spring data JPA. but not use all three.
So, what I concluded from resarching is..

  1. combination of Spring Data JPA + Mybatis + JPQL
  2. combination of Spring Data JPA + QueryDSL + JPQL

won't need all three of them.