You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am new to QueryDSL and struggling to figure out how to query in a recursive way.
Let us say, I have an entity/datamodel which looks like:
public class Department {
private Long id;
private Department parent;
}
I want to query all of children departments (include children's children and so on) by a department id in a recursive way with QueryDSL (using 4.1.4).
I am using JPAQuery object to execute the common queries, and read through the latest reference doc still cannot find the answer, so what should I do to make it work ?
Please help.
Thanks in advance.
The text was updated successfully, but these errors were encountered:
@beamofsoul , SQL and relational databases in general do not handle recursive structures well without some help and extra meta-data stored in the table.
The following article is very good on handling it specifically in MySQL, but it can be extrapolated to other database technologies as well.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Hi there,
I am new to QueryDSL and struggling to figure out how to query in a recursive way.
Let us say, I have an entity/datamodel which looks like:
I want to query all of children departments (include children's children and so on) by a department id in a recursive way with QueryDSL (using 4.1.4).
I am using JPAQuery object to execute the common queries, and read through the latest reference doc still cannot find the answer, so what should I do to make it work ?
Please help.
Thanks in advance.
The text was updated successfully, but these errors were encountered: