Start a new topic
Answered

Assistance Required: Repository Table for Attribute Data Types and Linking with MTA_ATTRIBUTE

Hello Team,

I’m currently building a dashboard that lists all entities along with their respective attributes. While preparing the query to retrieve this data, I was unable to locate the repository table that stores the data type information for attributes.

I need your assistance in identifying which Semarchy xDM repository table contains attribute data type details. Specifically:

1. Which repository table contains the data type details for attributes?
2. How can this table be linked to the MTA_ATTRIBUTE table, or what is the correct join key or relationship between these tables?

Please share:

The table name(s) that hold attribute data type metadata. The column(s) to use for joining with MTA_ATTRIBUTE. Any relevant documentation or ER diagram references.

Thank you for your assistance.


Best Answer

Hi Mounkarthick,


MTA_FIELD isn't the right source for this, as it describes attributes as they appear in forms and collections, which is why it has no direct link to MTA_ATTRIBUTE.

The data type of an entity attribute is stored on MTA_ATTRIBUTE itself:

  • Built-in types (String, Integer, Date, etc.): MTA_ATTRIBUTE.R_TYPE holds a fixed UUID for the type. These types have no row in MTA_TYPE, so you need to map the UUIDs yourself. A community thread lists them: https://support.semarchy.com/support/discussions/topics/43000533962
  • Lists of Values: R_TYPE points to MTA_TYPE (where CLASSNAME = 'LOVType'), and the values are in MTA_LOV_VAL.
  • Complex types: R_CPLXTYPE points to MTA_CPLXTYPE.

When you join repository tables, match on UUID, EDITIONID and BRANCHID together, for example a.r_cplxtype = ct.uuid and a.editionid = ct.editionid and a.branchid = ct.branchid.

Otherwise you'll get one row per model edition.


Note that the repository structure isn't formally documented and can change between releases, so test your dashboard query after upgrades.

If you only need a readable list of entities and attributes, the Model Documentation generator is the supported option.


Hope that helps.

Alexia


To add on, While exploring the repository, I noticed that the MTA_FIELD table (filtered with CLASSNAME = 'TableColumn') lists attributes along with their data types. However, I am unsure if this is the only way to retrieve an attribute’s data type because I do not see any direct relationship or common key between MTA_FIELD and MTA_ATTRIBUTE.


Could you please confirm:

Is MTA_FIELD the correct and only source for attribute data types? If so, what is the recommended approach to link MTA_FIELD with MTA_ATTRIBUTE for building a consolidated query?

Answer

Hi Mounkarthick,


MTA_FIELD isn't the right source for this, as it describes attributes as they appear in forms and collections, which is why it has no direct link to MTA_ATTRIBUTE.

The data type of an entity attribute is stored on MTA_ATTRIBUTE itself:

  • Built-in types (String, Integer, Date, etc.): MTA_ATTRIBUTE.R_TYPE holds a fixed UUID for the type. These types have no row in MTA_TYPE, so you need to map the UUIDs yourself. A community thread lists them: https://support.semarchy.com/support/discussions/topics/43000533962
  • Lists of Values: R_TYPE points to MTA_TYPE (where CLASSNAME = 'LOVType'), and the values are in MTA_LOV_VAL.
  • Complex types: R_CPLXTYPE points to MTA_CPLXTYPE.

When you join repository tables, match on UUID, EDITIONID and BRANCHID together, for example a.r_cplxtype = ct.uuid and a.editionid = ct.editionid and a.branchid = ct.branchid.

Otherwise you'll get one row per model edition.


Note that the repository structure isn't formally documented and can change between releases, so test your dashboard query after upgrades.

If you only need a readable list of entities and attributes, the Model Documentation generator is the supported option.


Hope that helps.

Alexia

Login to post a comment