JavaBlog.fr / Java.lu Database,Documentum,DQL DCTM Documentum : Repeating and Single Value Attributes in Database, Tables, Views, Aspects, i_position

Documentum : Repeating and Single Value Attributes in Database, Tables, Views, Aspects, i_position

Hello,

This post is relating to repeating and single attributes in underlying database. Documentum objects support 2 types of attributes:

  • Single Value Attributes
    Single Value properties are properties that can hold a single value at a time like the attributes r_object_id, object_name,…etc.
  • Repeating Attributes
    Repeating Attributes are properties that can hold multiple values like the attributes Keywords, i_folder_id, r_aspect_name…etc.

 

TABLES
All objects/properties/attributes are saved in underlying database. Depending of object in which the attribute is defined and its type (single/repeating), the attribute is stored either in table “object_type_s” (or single) or “object_type_r” (for repeating). For example, the attributes defined in the dm_sysobject type are stored in the tables dm_sysobject_s and dm_sysobject_r.
 

If my_huo_object has two custom single single_attr_1 and single_attr_2 and 2 repeating value attributes repeat_attr_1 and repeat_attr_2, then:

  • the my_huo_object_s table will be the columns single_attr_1 and single_attr_2
  • the my_huo_object_r table will be the columns repeat_attr_1 and repeat_attr_2

 

So, each single value attribute has single column in the “_s” table. However, the repeating value attribute with others important colmuns as i_position which determines the position of the value in repeating attribute to which it belongs.
For our previous example, the my_huo_object_r table will be the columns repeat_attr_1, repeat_attr_2 and i_postion.
 

In this example, the custom accelera_doc object type has the supertype, dm_document. Therefore, the following total set of database tables are used to store the properties of accelera_doc objects:

 


 
VIEWS
Concerning the views, each object type has 4 views named:

  • _sv and _sp for all Single value attributes in conjunction with all super types
  • _rv and _rp for all repeating value attributes in conjunction with all super types

The two _sp and _rp views are used by DQL and the two _sv and _rv views are used by the Object Manager. So, in case of requiring to query the table rather than the object use the _sp, _rp views rather than making your own joins between _s or _r tables up the inheritance hierarchy.

For example, the type dm_document has four views: dm_document_sp, dm_document_sv, dm_document_rp and dm_document_rv. If my_huo_object extends dm_document, its views (my_huo_object_sp, my_huo_object_sv, my_huo_object_rp and my_huo_object_rv) will have all the single/repeating attributes of dm_sysobject, dm_document and my_huo_object. Note : dm_document doesn’t have any single attribute or repeating attribute.

 


 
CALCULATE REPEATING VALUE POSITION
Some notes concerning th calculate of repeating’s index:

  • i_position uses negative numbers for indexing. so, -1 is the first element, -2 is the second, and so on.
    The expression “(i_position*-1)-1 as index” and “-(i_position+1) as sameindex” are equivalent.
     
  • Example 1: for standard object
    01// Retrieve document id and index position where repeating attribute 'r_aspect_name' contains 'aspect_java_lu'
    02 
    03# For repeating attribute
    04describe dm_sysobject_r;
    05r_object_id Char(16)   
    06i_position  Integer
    07i_partition Integer
    08r_aspect_name   Char(64)   
    09i_folder_id Char(16)   
    10authors Char(48)   
    11a_effective_date    Time/Date  
    12a_effective_flag    Char(8)
    13a_effective_label   Char(32)   
    14a_expiration_date   Time/Date  
    15a_extended_properties   Char(32)   
    16a_publish_formats   Char(32)   
    17keywords    Char(48)   
    18r_component_label   Char(32)   
    19r_composite_id  Char(16)   
    20r_composite_label   Char(32)   
    21r_order_no  Integer
    22r_property_bag  Char(2048) 
    23r_version_label Char(32)   
    24 
    25# For single attribute
    26describe dm_sysobject_s;
    27r_object_id Char(16)   
    28i_position  Integer
    29i_partition Integer
    30acl_domain  Char(255)  
    31acl_name    Char(32)   
    32a_application_type  Char(32)   
    33...
    34 
    35select r_object_id, r_aspect_name as my_aspect, (i_position*-1)-1 as index, -(i_position+1) as sameindex
    36from dm_document
    37where r_aspect_name = 'aspect_java_lu'
    38enable (row_based);
    39OR
    40select r_object_id, r_aspect_name as my_aspect, (i_position*-1)-1 as index, -(i_position+1) as sameindex
    41from dm_sysobject
    42where r_aspect_name = 'aspect_java_lu'
    43enable (row_based);
    44OR
    45select r_object_id, r_aspect_name as my_aspect, (i_position*-1)-1 as index, -(i_position+1) as sameindex
    46from dm_sysobject_r
    47where r_aspect_name = 'aspect_java_lu'
    48enable (row_based);
    49 
    50r_object_id     my_aspect       index   sameindex
    5109xxxxxxxxxxxxxa    aspect_java_lu  0   0
    5209xxxxxxxxxxxxxb    aspect_java_lu  1   1
    5309xxxxxxxxxxxxxc    aspect_java_lu  1   1
    5409xxxxxxxxxxxxxd    aspect_java_lu  0   0

     

  • Example 2: for the ASPECT
    01Where do Aspects Store Attribute Values?
    02The dmc_aspect_type_s and dmc_aspect_type_r tables contains the definitions of the aspect. The i_attr_def column contains the name of the table that holds the attributes and values for the Aspect.
    03select i_attr_def from dmc_aspect_type   where object_name = 'my_aspect';
    04i_attr_def = dmi_03xxxxxxxxxxxc
    05 
    06# For repeating attribute
    07describe dm_dbo.dmi_03xxxxxxxxxxxc_r;
    08r_object_id Char(16)   
    09i_position  Integer
    10i_partition Integer
    11additionnal_approvers   Char(50)   
    12contacts    Char(50)   
    13...
    14 
    15# For single attribute
    16describe dm_dbo.dmi_03xxxxxxxxxxxc_s;
    17r_object_id Char(16)   
    18i_position  Integer
    19i_partition Integer
    20afs_request_num Char(12)   
    21request_status  Char(25)   
    22approved_rejected_date  Time/Date  
    23...
    24 
    25 
    26#
    27select r_object_id, contacts as my_contact, (i_position*-1)-1 as index, -(i_position+1) as sameindex
    28from dm_dbo.dmi_03xxxxxxxxxxxc_r
    29where contacts like 'Huseyin%'
    30order by r_object_id, i_position desc;
    31 
    32r_object_id my_contact  index   sameindex
    3309xxxxxxxxxxxxx9    Huseyin OZVEREN 1   1
    3409xxxxxxxxxxxxxa    Huseyin Ozveren 3   3
    3509xxxxxxxxxxxxxe    Huseyin Me  0   0

 

Below, the useful link to the Documentum 6 Object-Relational Model :
https://community.emc.com/servlet/JiveServlet/previewBody/1269-102-1-1396/DocumentumContentServer6ORDiagram.pdf

That’s all!!!

Huseyin OZVEREN

Leave a Reply

Your email address will not be published.

Time limit is exhausted. Please reload CAPTCHA.

Related Post