chore(entities): Move entity sql logic into entityTable service