From: | Sam Vilain <sam [...] vilain.net> |
To: | tangram-t2-maintainers [...] hottub.perlfect.com, "Konopnicki, David" <david.konopnicki [...] hp.com>, <tangram-users [...] lists.sourceforge.net> |
Subject: | Re: [tangram-t2-maintainers] Inheritance in queries |
Date: | Mon, 3 Nov 2003 15:58:44 +0000 |
CC: | bug-Tangram [...] rt.cpan.org |
Right. In which case, you should explicitly tell Tangram where not to
create the table:
...Tangram::Schema->new({
classes => [
Foo => {
bases => [qw(Bar)],
table => "Bar",
},
Bar => {
# ...
},
] });
There's still a bug of course, but the workaround exists in this case.
What to do with one that doesn't contain any attributes at all at the
top of the heirarchy is another problem :-).
Thanks,
Sam.
On Sun, 02 Nov 2003 13:26, Konopnicki, David wrote;
Show quoted text
> I fixed it myself but the solution may interrest other people.
> The problem is that one of the classes in my hierarchy has no fields
only associations. When this is the case, Tangram does not create a table
for this class. This breaks a lot of things when writing queries. In
particular, I think it breaks the code that associate a field in an object
with a column in one of the table to which the object is mapped.
Show quoted text >
> Hope it helps.
> -David
>
> -----Original Message-----
> From: Konopnicki, David
> Sent: Sunday, November 02, 2003 11:25 AM
> To: Tangram (E-mail); tangram-users@lists.sourceforge.net
> Subject: [tangram-t2-maintainers] Inheritance in queries
>
>
> Hi,
> I have problems with inheritance in queries. I have four classes
inheriting from each other A->B->C->D (D is the top of the hierarchy).
Show quoted text > I do:
> $r = $storage->remote(A);
> @o = $storage->select($r, A->{toto} eq 'z');
>
> where toto is in fact an attribute that is defined in class C.
> The SQL generated looks like:
> Select ....
> from A, B, C, D where
> A.id = B.id and A.id = C.id and A.id = D.id and B.toto = 'z';
> which fails because toto is found in table C and not B.
> Any ideas?
> Thanks.
> -David
> _______________________________________________
> tangram-t2-maintainers mailing list
> tangram-t2-maintainers@hottub.perlfect.com
> http://hottub.perlfect.com/mailman/listinfo/tangram-t2-maintainers
> _______________________________________________
> tangram-t2-maintainers mailing list
> tangram-t2-maintainers@hottub.perlfect.com
> http://hottub.perlfect.com/mailman/listinfo/tangram-t2-maintainers
>
>
--
Sam Vilain, sam@vilain.net
He hasn't one redeeming vice.
OSCAR WILDE