Jira issue originally created by user strygin:
By scalars-only-selects I mean this:
SELECT c.id, c.name FROM GLocalityBundle:Country c INDEX by c.id
The result won't be indexed by c.id, as opposites to this:
SELECT c FROM GLocalityBundle:Country c INDEX by c.id
Assuming that GLocalityBundle:Country has several hunders of fields, and you need only two of them, this is very disappointing :(
After diving in the code, due to rigorous separation of entities on objects and scalars, it looks practically impossible even to implement this feature :(
What is this? Bad design?
Comment created by @beberlei:
I agree it seems very complex to implement for the Object and ArrayHydrator, however it should be very easy for the getScalarResult() hydrator.
Even more I think there is a general bug with INDEX BY and scalars in Object and ArrayHydrator that has to be evaluated.
This PR will fix this issue #151, it is scheduled for 2.2
This is fixed in master
Issue was closed with resolution "Fixed"
Comment created by deatheriam:
This behavior has not changed in the latest 2.2.1. getArrayResult returns an indexed result. getScalarResult returns zero based result. Do I need to create a separate ticket for that issue?