Fix finder method generation issue

The finder methods from secondary entity
may refer fields from base entity.
Fix extra-code/extra-import merge issue

Fixes RM-2718