#1671: Column aggregation inheritance based on bool in PgSQL
------------------------------+---------------------------------------------
Reporter: j.debowczyk | Owner: romanb
Type: defect | Status: reopened
Priority: major | Milestone:
Component: Query/Hydration | Version: 1.0.3
Resolution: | Keywords: pgsql inheritnace
Has_test: 1 | Mystatus: Pending Core Response
Has_patch: 0 |
------------------------------+---------------------------------------------
Changes (by j.debowczyk):
* status: closed => reopened
* resolution: invalid =>
Comment:
Above take effect in queries, which are now in form:
{{{
SELECT j.id AS j__id, j.child1 AS j__child1 FROM
jacek__bool_subclass__parent j WHERE (j.child1 = 'false')
}}}
They works properly under PgSQL, so I think this syntax (with apostrophes)
is acceptable for booleans.
However, this code breaks objects creation from query results. For
example, I have records of both classes:
{{{
$myModel = new Jacek_BoolSubclass_Child1();
$myModel->id = 1;
$myModel->save();
$myModel = new Jacek_BoolSubclass_Child1();
$myModel->id = 2;
$myModel->save();
$myModel = new Jacek_BoolSubclass_Child2();
$myModel->id = 3;
$myModel->save();
$myModel = new Jacek_BoolSubclass_Child2();
$myModel->id = 4;
$myModel->save();
}}}
In result of query
{{{
Doctrine_Query::create()->from('Jacek_BoolSubclass_Parent')
}}}
I get all records of class Jacek_BoolSubclass_Child1.
Of course, I know 2-children limitation of column aggregation based on
boolean, but in some cases we have exactly 2 complementary subclasses.
Some another time we already have boolean column, which becomes base of
column aggregation inheritance, so I think that this Doctrine feature
should work correctly.
I'm including updated testcase.
--
Ticket URL: <http://trac.doctrine-project.org/ticket/1671#comment:2>
Doctrine <http://www.phpdoctrine.org>
PHP Doctrine Object Relational Mapper
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"doctrine-svn" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.co.uk/group/doctrine-svn?hl=en-GB
-~----------~----~----~----~------~----~------~--~---