Added hasManyEntries and related relation logic