Skip to main content

ItemId Property

The ItemId property of the generated Caché class represents the original multivalue file’s item-id field. The ItemId property has an index defined on it. Here are the relevant declarations from the MVFILE.PERSON class definition:


Property ItemId As %String;
Index indexItemId On ItemId [ IdKey, PrimaryKey ];  

The index declaration gives ItemId the following features:

  • ItemId is an IDKEY and serves as the Caché objects ObjectID. Use ItemId to open objects. When you create a new object, you must assign a unique value to its ItemId property before saving the object.

  • ItemId is also the SQL primary key, so each record must have a unique value. Note that the SQL representation also includes the RowID field (named ID). Its values are always identical to the ItemID values.

Note:

For more information on the IDKEY mechanism, read IDKEY in the SQL and Object Use of Multidimensional Storage section of Using Caché Globals as well as IdKey in the Caché Class Definition Reference.

For more information on IDKEYs that are also SQL primary keys, read Primary Key in the CREATE TABLE section of the Caché SQL Reference.

FeedbackOpens in a new tab