How to Fetch Entities ID from namespaces and sub-namespaces