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
DbQuery.addHierarchicalFilterRestriction used to add restrictions for filtering on offerings and procedures will only filter a single hierarchy level (in the child direction).
Filtering the value by b, it would currently execute something like this:
SELECT e1.*FROM entity AS e1
LEFT OUTER JOIN entity AS e2 ON (e1.parent=e2.id)
WHEREe2.value='b'ORe1.value='b'ORDER BYe1.id;
Which only currently only return 3, 5, 7, 8 and 11, 12, 13:
id | value | parent
----+-------+--------
3 | b | 2
5 | b | 4
6 | a | 5
7 | b |
8 | a | 7
11 | b | 10
12 | b |
13 | a | 12
(8 rows)
It should do a full recursive search:
WITH RECURSIVE
children AS (
SELECT*FROM entity WHERE value ='b'UNION ALLSELECT e.*FROM entity AS e JOIN children AS c ONe.id=c.parent
),
parents AS (
SELECT*FROM entity WHERE value ='b'UNION ALLSELECT e.*FROM entity AS e JOIN parents AS p ONe.parent=p.id
)
SELECT*FROM children
UNIONSELECT*FROM parents
ORDER BY id
... and return everything from 1 to 13:
id | value | parent
----+-------+--------
1 | a |
2 | a | 1
3 | b | 2
4 | a |
5 | b | 4
6 | a | 5
7 | b |
8 | a | 7
9 | a | 8
10 | a |
11 | b | 10
12 | b |
13 | a | 12
(13 rows)
Currently this is not possible with Hibernate, so we may need another solution...
As a side note, the parents are always filtered on the pkid field while the children may be filtered on the domainId field...
The text was updated successfully, but these errors were encountered:
DbQuery.addHierarchicalFilterRestriction
used to add restrictions for filtering on offerings and procedures will only filter a single hierarchy level (in the child direction).So given this data (not really representative):
Or in SQL:
Filtering the value by
b
, it would currently execute something like this:Which only currently only return
3
,5
,7
,8
and11
,12
,13
:It should do a full recursive search:
... and return everything from
1
to13
:Currently this is not possible with Hibernate, so we may need another solution...
As a side note, the parents are always filtered on the
pkid
field while the children may be filtered on thedomainId
field...The text was updated successfully, but these errors were encountered: