Where do Aspects Store Attribute Values?
June 13, 2011 2 Comments
Have you ever wondered where Aspects actually store the metadata they attach to an object? For example, in my series of posts on creating a Checksum Aspect, I created an Aspect that stored a checksum, a date, and the checksum algorithm’s name to any content object in the repository. But where did it actually store that metadata? If you look at the content object you will not see a checksum attribute.
My first thought was perhaps in the object’s i_property_bag
because I could see serialized values in this database field. But no, the i_property_bag
contains an object’s non-qualifiable properties and properties designated for fetch optimization. (If you’ve never heard of an object’s non-qualifiable properties, neither had I. See the Content Server Fundamentals manual.)
In Composer, when you create and install an Aspect, you define an aspect_type
object which contains the definitions of the attributes the Aspect will use. In the database, a new r_object_id
is added to the dmc_aspect_type_s
table for the new type, and a new type table is created with the column definitions you specified in Composer. It’s all tied together like this:
select r_object_id, r_aspect_name from dm_document where object_name = ‘test.doc’
The r_aspect_name
column contains the names of the Aspects attached to this object.
select r_object_id, object_name, i_attr_def from dmc_aspect_type where object_name = ‘checksum_aspect’
The i_attr_def
column contains the name of the table that holds the attributes and values for the Aspect. When you query the table, add _s
or _r
as appropriate.
select * from dmi_03000001800001f7_s
Each row of the result table contains data for each object that the Aspect, checksum_aspect
, is attached to. To find a particular object’s Aspect data, find the row for the object’s r_object_id
.
Thankfully, DQL takes care of all of this table navigation for you and you can simply query:
select r_object_id, checksum_aspect.checksum from dm_document where object_name = ‘test.doc’
Pingback: What is the Property Bag and What is it Used for? « dm_misc: Miscellaneous Documentum Tidbits and Information
Reblogged this on dump dm_documentum.
LikeLike