Using CDBI with an ORDBMS
[prev]
[thread]
[next]
[Date index for 2005/04/30]
I'm designing a database schema that uses the ORDBMS table inheritance
features of PostgreSQL to make two tables inherit from a common third table.
I wanted to know if there was any way within Class::DBI to express that
relationship, so it will DWIM. Consider the following pseudo-SQL:
CREATE TABLE Bookmark (target) INHERITS (URI);
CREATE TABLE Folder (entries) INHERITS (URI);
CREATE TABLE URI (id, name, description);
If I insert a record into either tables Bookmark or Folder, it will show
up in URI as well, though only with the columns defined within URI.
Therefore, I wanted to have Class::DBI return the appropriate object
type when I query from the URI table. For instance:
my $obj = URI->retrieve(10);
If ID 10 is a Folder, I would expect it to return a Class::DBI object
for the folder class, giving me the columns "id", "name", "description",
and "entries".
Is there a way of doing this currently with Class::DBI, or do I need to
create a new module to accomodate this?
Thanks.
--
Michael Nachbaur <mike@xxxxxxxx.xxx>
http://nachbaur.com/pgpkey.asc
|
Using CDBI with an ORDBMS
Michael Nachbaur 00:16 on 30 Apr 2005
|