is_a relationship?

[prev] [thread] [next] [Date index for 2004/08/27]

From: Caroline Johnston
Subject: is_a relationship?
Date: 14:14 on 27 Aug 2004
Hi,

I've been playing around with the IsA stuff and I've hit a couple of 
problems. Any chance of some help?!

I'm using AutoLoader to generate my classes from a Pg DB, if it 
makes a difference.

I haven't tried to actually set a relationship on anything yet, I've just 
tried to add_relationship_type(is_a=>"Class::DBI::Relationship::IsA").

The first problem was that if I had any cols in my DB called "name" I was 
getting errors about clashing with built in methods (the error is at line 
403 in DBI.pm - apparently Class::DBI->can('name') if I've added the is_a 
relationships type, but can't if I don't.). I couldn't even figure out 
where the 'name' method was defined by IsA, let alone how it ends up in 
Class::DBI...

The second problem is that it seems to be using the is_a search method,
even when I haven't set up any is_a relationships (If I add a print
statement to the IsA::search, it gets printed when I call retrieve, even
if I don't have an is_a defined on the class. ) - the result being that it
dies on its arse when I try to do:

	Some::Class->retreive('PK');

I get an error saying: "Can't fetch data as class method"

This doesn't happen if I don't add_relationship_type(is_a).

Should it not be using the normal Class::DBI search method?
Maybe I've got the wrong end of the stick completely, but I can't 
understand how it even knows about the IsA search method.

I've had a look and tried to figure out what's going on, but I don't know 
Class::DBI very well and I don't really understand how the addition of 
relationships works. Any help would be appreciated!

Cheers,

Caroline

is_a relationship?
Caroline Johnston 14:14 on 27 Aug 2004

Generated at 11:34 on 01 Dec 2004 by mariachi v0.52