Hello,
is it possible to use Postgres' array types and operators in QueryDSL?
I'm looking for something to map the expression
ARRAY[column_name] and the array concatenation operator
some_array||some_column to QueryDSL.
Specifically in the context of a common table expression:
with recursive category_tree as (
select id, parent_id, sort_order, name, array[0,id] as sort_path, 0 as level
from category
where parent_id is null
union all
select c.id, c.parent_id, c.sort_order, c.name, p.sort_path||array[c.sort_order, c.id], p.level + 1
from category c
join category_tree p on c.parent_id = p.id
)
select *
from category_tree
order by sort_path;
How would I write a template (?) to support the
array[0,id]
and
p.sort_path||array[c.sort_order, c.id]
expressions?
I already have the rest, but I have no clue how to integrate something like that.
We have already written support for the array_agg() aggregate function, but this seems quite different.