cyclonephp/JORK — Issue #1: Refactoring query result handling
Author: crystal88
Created: 2012-01-18 14:39:02+00:00
State: open

In the current implementation of query result handling the database query result rows are read one-by-one and a new root entity is created if a new primary key value is found in a row. Once a new object created in the result the previous object is handled as being complete and if a new database row is found then the object will be added to the object query result as a new row. This behavior is OK in most cases but if the object query is ordered by a property which is not a primitive property of the root entity class of the query then the query result is very weird.

In the case of object queries with 1 root entity class the task is the following: when a database query result row is read and a new primary key value is found then it must be checked if an object result row already exist with the same primary key. If yes then the components found in the new database row(s) should be appended to the existing object instead of creating a new root object.

It should be further examined how the problem affects the queries with multiple root entity classess.