cancel
Showing results for 
Search instead for 
Did you mean: 

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

promanov_
Star Contributor
Star Contributor

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?

1 ACCEPTED ANSWER

Benjamin_Jalon1
Elite Collaborator
Elite Collaborator

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

View answer in original post

3 REPLIES 3

promanov_
Star Contributor
Star Contributor

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

Benjamin_Jalon1
Elite Collaborator
Elite Collaborator

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

Florent_Guillau
World-Class Innovator
World-Class Innovator

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.

Getting started

Find what you came for

We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.