How do you define ID as a composite key in the item descriptor of a table?
A.
<table name =”doc”type =”primary”id-column-names =”folder_id, doc_id”>
<property name =”ID”column-name =”folder_id, doc_id data-types =”string,int”/>
</table>
B.
< table name =”doc”type =”primary”id-column-names =”folder_id, doc_id”>
<property name =”ID”column-name =”folder_id”data-type =”string”>
<property name =”ID”column-name =”doc_id”data-type =”int”>
</table>
C.
<table name =”doc”type =”primary”>
<property name =”ID”column-name =”Folder_id”data-types =”int”/>
</table>
D.
It is illegal to have a composite key as an ID column.
Explanation:
A repository ID can be represented by a single column in the database, with a
corresponding Java type of String, Integer, or Long. A repository ID may also be represented by
more than one column in the database, each column of which can be either String, Integer, orLong. This type of repository ID is referred to as a multi-column ID or composite key ID.
A single property can be used to represent a single column of a multi-column ID or might
represent all of the IDcolumns. So, both of the following are valid:
* Here, the ID property represents the two ID columns (corresponds to this question above)
<table name=”doc” type=”primary” id-column-names=”folder_id,doc_id”>
<property name=”ID” column-names=”folder_id,doc_id”
data-types=”string,int”/>
</table>
* In this case, the folder property represents one of the ID columns, while the document property
represents
the other:
<table name=”doc” type=”primary” id-column-names=”folder_id,doc_id”>
<property name=”folder” column-names=”folder_id” data-type=”string”/>
<property name=”document” column-names=”doc_id” data-type=”int”/>
</table>
ATG Web Commerce Repository Guidem, Single Column and Multi-Column
Repository IDs