JPAQueryFactory and JPAQuery #2081

Open
beamofsoul opened this Issue Jan 9, 2017 · 2 comments

Projects

None yet

2 participants

@beamofsoul
beamofsoul commented Jan 9, 2017 edited

I am new about QueryDSL and trying to use it in my new spring boot based project.
Could someone explain for me about:

  1. Is JPAQueryFactory a 'HEAVY' object like SessionFactory so cannot be created frequently (to be singletion) ?
  2. If so, how can I use it to update entities efficiently, because looks like no other objects have same ability ?
  3. What is the relationship between JPAQueryFactory and JPAQuery ?

Thanks in advance!

PS: In fact, I have read Querydsl Reference Guide 4.1.2 Reference Document, but there are just a few words to introduce it.

@Shredder121
Member
Shredder121 commented Jan 12, 2017 edited

JPAQueryFactory is in fact a small wrapper around useful methods regarding creating queries and dml clauses.

If so, how can I use it to update entities efficiently, because looks like no other objects have same ability ?

You can directly create JPA(Update/Delete/Insert)Clauses.

So you could create more than one JPAQueryFactory, but it's not strictly necessary.

P.S. do you have a suggestion as to what to write about it in the reference documentation?

@beamofsoul

@Shredder121 Thanks a lot for your reply.
I know more about it by your explanation now.

The reference documentation has been pretty easy to understand, but it may have the potential to be more comprehensive by introducing some frequently-used classes, just like "JPAQueryFactory", in more detail (structures, purposes etc.) even in new version of the reference documentation, especially for the new learner, like me :)

Thanks again.

@Shredder121 Shredder121 added the docs label Jan 13, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment