What does a MasterDefinition mean for an EntityValue?

In the DataExport screen, there is a field called master (see image below).


It’s tooltip says that there’s something to do with a master definition that’s associated with an entity, and to try putting in default.

If you export mantle.party.Party data without anything in that field, it’ll look something like:

 <parties lastUpdatedStamp="1641870207198" pseudoId="_NA_" ownerPartyId="_NA_" partyTypeEnumId="PtyPerson" partyId="_NA_">
<owner lastUpdatedStamp="1641870207198" pseudoId="_NA_" ownerPartyId="_NA_" partyTypeEnumId="PtyPerson"/>
<Owner-mantle.product.Product assetTypeEnumId="AstTpInventory" assetClassEnumId="AsClsInventorySub" productName="Demo Sub Assembly One" pseudoId="DEMO_SA_1" lastUpdatedStamp="1641870208553" productId="DEMO_SA_1" productTypeEnumId="PtAsset" ownerPartyId="_NA_"/>
<Owner-mantle.product.Product assetTypeEnumId="AstTpInventory" assetClassEnumId="AsClsInventorySub" productName="Demo Sub Assembly Two" pseudoId="DEMO_SA_2" lastUpdatedStamp="1641870208553" productId="DEMO_SA_2" productTypeEnumId="PtAsset" ownerPartyId="_NA_"/>
<Owner-mantle.product.Product assetTypeEnumId="AstTpInventory" assetClassEnumId="AsClsInventoryRaw" productName="Demo Raw Material 1" pseudoId="DEMO_RM_1" lastUpdatedStamp="1641870208553" productId="DEMO_RM_1" productTypeEnumId="PtAsset" ownerPartyId="_NA_"/>

If you export the same entity with default in the field, then it’ll look something like:

<parties lastUpdatedStamp="1641870207198" pseudoId="_NA_" ownerPartyId="_NA_" partyTypeEnumId="PtyPerson" partyId="_NA_">
<type lastUpdatedStamp="1641870207198" enumId="PtyPerson" description="Person" enumTypeId="PartyType"/>
<person lastName="Applicable" lastUpdatedStamp="1641870207198" firstName="Not"/>
</parties>

I’ve been looking into what MasterDefinition is for an entity and I despite looking at the code I haven’t been able to figure out what it is. Is it something to do with Master Data?

Basically, what does a MasterDefinition mean for an EntityValue?

We had a chat about this but I figured some info might help others as well…

The concept behind this is the master/detail pattern, which is common and old enough some info on it is around on the web and accessible with a quick web search. In the Moqui docs here is where these concepts are covered:

https://moqui.org/m/docs/framework/Data+and+Resources/Data+Model+Patterns

There are a few examples of master/detail definitions for entities, like here for the Party entity:

The general idea is to specify ‘detail’ relationships to follow to form the overall ‘master’ definition… or maybe it would be better to always refer to it as a master/detail definition.