Re: Accessing accessing foreign key without triggering lazy HasA class loading?

[prev] [thread] [next] [Date index for 2005/03/11]

From: gcomnz
Subject: Re: Accessing accessing foreign key without triggering lazy HasA class loading?
Date: 19:14 on 11 Mar 2005
Thanks! That's great. I've caught myself three times before this
almost asking the list something then realizing just as I was about to
that I was just thinking about it wrong.

I think that's the biggest curve to getting started with Class::DBI:
it requires thinking about things a little differently than the other
DB libraries I've worked with, and in a much nicer way in my view, and
when it seems like what I want to do isn't in there I am so far
finding that I'm just thinking about it in my old "do the DBI stuff
myself" M.O.


On Fri, 11 Mar 2005 11:28:43 -0700, gcomnz <gcomnz@xxxxx.xxx> wrote:
> Hi, all,
> 
> I'm trying to figure out whether I can access the ID value for a
> foreign key without triggering the loading of the foreign class?
> 
> For instance:
> 
> __PACKAGE__->table('task');
> __PACKAGE__->columns(All => qw/task_id on_success on_fail/);
> __PACKAGE__->has_a(on_success => 'IL::Task');
> __PACKAGE__->has_a(on_fail => 'IL::Task');
> 
> I want to have the option to read the actual ID value of on_success or
> on_fail without triggering another database read. Am I missing
> something really obvious?
> 
> Thanks!
> 
> Marcus
>

Re: Accessing accessing foreign key without triggering lazy HasA class loading?
gcomnz 19:14 on 11 Mar 2005

Generated at 08:39 on 15 Mar 2005 by mariachi v0.52