[Dbix-class] Hiding storage details

Andreas Mock andreas.mock at drumedar.de
Mon Mar 16 19:02:30 GMT 2009


Hi all,

as part of another thread I want to extract the following question with a more meaningful subject:

We do have objects (O) which consist of attribues (A) which are
stored in a table O with columns A just as DBIC would model it.
But we do also have sparse attributes (B) (attributes which are very often
NULL) which are not stored as columns of the "base" table O but as rows
of a - let's call it attribute table - where each "not null"-attribut B of O is a
row in that table with a key consisting of a class identifier,
an object identifier (O.id) and an attribute identifier.

After loading this object I want to see that object in a flat way. This
"attribute collection" shall show up as "normal" (columns) attributes
(with accessors named like the attribute identifier).
While using the object from the application perspective I don't want to
know that there are some attributes stored as columns in the base table
and some as entries in a related table.

Is there a way in DBIC to do this?

Best regards
Andreas Mock




More information about the DBIx-Class mailing list