CDBI::Loader and plugins
[prev]
[thread]
[next]
[Date index for 2004/08/02]
I am trying out CDBI::Loader and CDBI::Loader::Relationship for my
latest project and I have got it mostly working the way I want. I love
the fact that I can reduce the representation of the database down to
just a few lines and do not have to manually create a separate class
for each table anymore.
The problem I have come across though, and others have as well from
what I see in the mailing list, is how to enable CDBI plugins such as
AbstractSearch, RetrieveAll, etc..
I saw a suggestion of going through each class and evalling the
"require" of the plugins in each package context, like:
From: Kingsley Kerce <kingsley@xxxxxxxxxxxxxxxx.xxx>
Date: Thu, 8 Apr 2004 16:27:51 -0400
Subject: Class::DBI::Plugin::RetrieveAll and Class::DBI::Loader
foreach my $class ($loader->classes) {
eval "package $class;
use Class::DBI::Plugin::RetrieveAll;
";
}
but this seems like a bit of an ugly hack, there has to be a nicer way
(it might not have been written yet, of course). Anyone have thoughts
on how to resolve/improve this issue?
Thanks in advance,
Stephen Quinney
|
CDBI::Loader and plugins
Stephen Quinney 13:48 on 02 Aug 2004
|