Added support for entity hierarchy