Tree hierarhy on DB layer