[Chicago-talk] Class::DBI and multiple tables

Jim Thomason thomasoniii at gmail.com
Mon Sep 20 11:30:37 CDT 2004

Anybody know if Class::DBI (or one of the Class::DBI::* modules) has
support for objects wrapping multiple tables WITH read/write access?

I've got an object that cleanly maps to a table, but then I've got a
special case of that object that would map to two tables. I could just
set it up with a has_a relationship, and have the main object have an
instance of a subset object that contains the speciality info, but it
just doesn't seem as clean to me. I also think I'd run into some data
duplication issues, needing to ensure that changes are made to both
the main object and its satellite sub-object with the subclass
specific info.

So, ideally, I'd just set it up so that my modules wrappers two
tables, reads them both in, and then writes back out to both of them
when I'm ready for changes.

Can it be done?


More information about the Chicago-talk mailing list