Nuxeo EP 5.6: CoreSession.getChildren() method doesn't work with a type filter on a base class?

Hi,

I have doc types B and C, both deriving from A (A derives from Document).

CoreSession.getChildren() API taking on input a type name, a Filter etc.. doesn't seem to work if I make a get call for all A-type children: no objects returned. Putting a concrete type instead (for example, B) returns all B-type children.

No errors in the log (I haven't checked for debug traces).

Is it a known limitation or issue? If not, can somebody from Nuxeo team please check if it's reproducible? What can I do otherwise?

0 votes

2 answers

2011 views

ANSWER

can someone from nuxeo state the expected behavior? May be my usage of the method is wrong.
06/13/2013



Normal :

  • getChildren do a “SELECT * FROM Document WHERE ecm:primaryType = 'A'” => no doctype explosion
  • if you want what I understand do a CoreSession.query(“SELECT * FROM A”) instead.

Hope this helps

1 votes



The getChildren APIs only match exact types, and do not use the subtype hierarchy.

Also, the use of the getChildren APIs is discouraged because they do not scale. As mentioned by @bjalon, you should use a query, which provides ways to do batching.

1 votes