ilscipio/scipio-erp

View on GitHub
applications/product/entitydef/entitymodel.xml

Summary

Maintainability
Test Coverage
<!--
This file is subject to the terms and conditions defined in the
files 'LICENSE' and 'NOTICE', which are part of this source
code package.
-->

<entitymodel xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/entitymodel.xsd">
    <!-- ========================================================= -->
    <!-- ======================== Defaults ======================= -->
    <!-- ========================================================= -->
    <title>Entity of an Apache OFBiz Component</title>
    <description>None</description>
    <version>1.0</version>
    <default-resource-name>ProductEntityLabels</default-resource-name>

    <!-- ========================================================= -->
    <!-- ======================== Data Model ===================== -->
    <!-- The modules in this file are as follows:                  -->
    <!--  - org.ofbiz.product.catalog -->
    <!--  - org.ofbiz.product.category -->
    <!--  - org.ofbiz.product.config -->
    <!--  - org.ofbiz.product.cost -->
    <!--  - org.ofbiz.product.facility -->
    <!--  - org.ofbiz.product.feature -->
    <!--  - org.ofbiz.product.inventory -->
    <!--  - org.ofbiz.product.price -->
    <!--  - org.ofbiz.product.product -->
    <!--  - org.ofbiz.product.promo -->
    <!--  - org.ofbiz.product.store -->
    <!--  - org.ofbiz.product.subscription -->
    <!--  - org.ofbiz.product.supplier -->
    <!-- ========================================================= -->


    <!-- ========================================================= -->
    <!-- org.ofbiz.product.catalog -->
    <!-- ========================================================= -->

    <entity entity-name="ProdCatalog"
            package-name="org.ofbiz.product.catalog"
            title="Catalog" default-resource-name="ProductEntityLabels">
      <field name="prodCatalogId" type="id-ne"></field>
      <field name="catalogName" type="name"></field>
      <field name="useQuickAdd" type="indicator"></field>
      <field name="styleSheet" type="url"></field>
      <field name="headerLogo" type="url"></field>
      <field name="contentPathPrefix" type="long-varchar"></field>
      <field name="templatePathPrefix" type="long-varchar"></field>
      <field name="viewAllowPermReqd" type="indicator"></field>
      <field name="purchaseAllowPermReqd" type="indicator"></field>
      <prim-key field="prodCatalogId"/>
    </entity>
    <entity entity-name="ProdCatalogCategory"
            package-name="org.ofbiz.product.catalog"
            default-resource-name="ProductEntityLabels"
            title="Catalog Category Association">
      <field name="prodCatalogId" type="id-ne"></field>
      <field name="productCategoryId" type="id-ne"></field>
      <field name="prodCatalogCategoryTypeId" type="id"></field>
      <field name="fromDate" type="date-time"></field>
      <field name="thruDate" type="date-time"></field>
      <field name="sequenceNum" type="numeric"></field>
      <prim-key field="prodCatalogId"/>
      <prim-key field="productCategoryId"/>
      <prim-key field="prodCatalogCategoryTypeId"/>
      <prim-key field="fromDate"/>
      <relation type="one" fk-name="PROD_CC_CATALOG" rel-entity-name="ProdCatalog">
        <key-map field-name="prodCatalogId"/>
      </relation>
      <relation type="one" fk-name="PROD_CC_CATEGORY" rel-entity-name="ProductCategory">
        <key-map field-name="productCategoryId"/>
      </relation>
      <relation type="one" fk-name="PROD_CC_TYPE" rel-entity-name="ProdCatalogCategoryType">
        <key-map field-name="prodCatalogCategoryTypeId"/>
      </relation>
    </entity>
    <entity entity-name="ProdCatalogCategoryType"
            package-name="org.ofbiz.product.catalog"
            default-resource-name="ProductEntityLabels"
            title="Catalog Category Association Type">
      <field name="prodCatalogCategoryTypeId" type="id-ne"></field>
      <field name="parentTypeId" type="id"></field>
      <field name="description" type="description"></field>
      <prim-key field="prodCatalogCategoryTypeId"/>
      <relation type="one" fk-name="PROD_PCCT_TYPEPAR" title="Parent" rel-entity-name="ProdCatalogCategoryType">
        <key-map field-name="parentTypeId" rel-field-name="prodCatalogCategoryTypeId"/>
      </relation>
    </entity>
    <entity entity-name="ProdCatalogInvFacility"
            package-name="org.ofbiz.product.catalog"
            title="Product Catalog Inventory Facility Applicability">
      <field name="prodCatalogId" type="id-ne"></field>
      <field name="facilityId" type="id-ne"></field>
      <field name="fromDate" type="date-time"></field>
      <field name="thruDate" type="date-time"></field>
      <field name="sequenceNum" type="numeric"></field>
      <prim-key field="prodCatalogId"/>
      <prim-key field="facilityId"/>
      <prim-key field="fromDate"/>
      <relation type="one" fk-name="PROD_CIF_CATALOG" rel-entity-name="ProdCatalog">
        <key-map field-name="prodCatalogId"/>
      </relation>
      <relation type="one" fk-name="PROD_CIF_FACILITY" rel-entity-name="Facility">
        <key-map field-name="facilityId"/>
      </relation>
    </entity>
    <entity entity-name="ProdCatalogRole"
            package-name="org.ofbiz.product.catalog"
            title="ProdCatalog Role Association">
      <field name="partyId" type="id-ne"></field>
      <field name="roleTypeId" type="id-ne"></field>
      <field name="prodCatalogId" type="id-ne"></field>
      <field name="fromDate" type="date-time"></field>
      <field name="thruDate" type="date-time"></field>
      <field name="sequenceNum" type="numeric"></field>
      <prim-key field="partyId"/>
      <prim-key field="roleTypeId"/>
      <prim-key field="prodCatalogId"/>
      <prim-key field="fromDate"/>
      <relation type="one-nofk" rel-entity-name="Party">
        <key-map field-name="partyId"/>
      </relation>
      <relation type="one-nofk" rel-entity-name="RoleType">
        <key-map field-name="roleTypeId"/>
      </relation>
      <relation type="one-nofk" rel-entity-name="Person">
        <key-map field-name="partyId"/>
      </relation>
      <relation type="one-nofk" rel-entity-name="PartyGroup">
        <key-map field-name="partyId"/>
      </relation>
      <relation type="one" fk-name="PCATRLE_PTYRLE" rel-entity-name="PartyRole">
        <key-map field-name="partyId"/>
        <key-map field-name="roleTypeId"/>
      </relation>
      <relation type="one" fk-name="PCATRLE_CATALOG" rel-entity-name="ProdCatalog">
        <key-map field-name="prodCatalogId"/>
      </relation>
    </entity>

  <!-- ========================================================= -->
  <!-- org.ofbiz.product.category -->
  <!-- ========================================================= -->

    <view-entity entity-name="ProductAndCategoryMember"
        package-name="org.ofbiz.product.category"
        title="Product And ProductCategoryMember View">
        <member-entity entity-alias="PROD" entity-name="Product"/>
        <member-entity entity-alias="PCM" entity-name="ProductCategoryMember"/>
        <alias-all entity-alias="PROD"/>
        <alias-all entity-alias="PCM">
            <exclude field="comments"/>
        </alias-all>
        <alias name="memberComments" entity-alias="PCM" field="comments"/>
        <view-link entity-alias="PROD" rel-entity-alias="PCM">
            <key-map field-name="productId"/>
        </view-link>
        <relation type="one-nofk" rel-entity-name="ProductCategoryMember">
            <key-map field-name="productCategoryId"/>
            <key-map field-name="productId"/>
            <key-map field-name="fromDate"/>
        </relation>
        <relation type="one-nofk" rel-entity-name="Product">
            <key-map field-name="productId"/>
        </relation>
    </view-entity>
    <entity entity-name="ProductCategory"
            package-name="org.ofbiz.product.category"
            title="Product Category">
      <field name="productCategoryId" type="id-ne"></field>
      <field name="productCategoryTypeId" type="id"></field>
      <field name="primaryParentCategoryId" type="id"></field>
      <field name="categoryName" type="name"></field>
      <field name="description" type="description"></field>
      <field name="longDescription" type="very-long"></field>
      <field name="categoryImageUrl" type="url"></field>
      <field name="linkOneImageUrl" type="url"></field>
      <field name="linkTwoImageUrl" type="url"></field>

      <field name="smallImageUrl" type="url"></field>
      <field name="mediumImageUrl" type="url"></field>
      <field name="largeImageUrl" type="url"></field>
      <field name="detailImageUrl" type="url"></field>
      <field name="originalImageUrl" type="url"></field>

      <field name="detailScreen" type="long-varchar"></field>
      <field name="showInSelect" type="indicator"></field>
      <field name="mediaImageId" type="id"><description>Content.contentId value of a CMS media image, for manual use (SCIPIO)</description></field>
      <prim-key field="productCategoryId"/>
      <relation type="one" fk-name="PROD_CTGRY_TYPE" rel-entity-name="ProductCategoryType">
        <key-map field-name="productCategoryTypeId"/>
      </relation>
      <relation type="many" rel-entity-name="ProductCategoryTypeAttr">
        <key-map field-name="productCategoryTypeId"/>
      </relation>
      <relation type="one" fk-name="PROD_CTGRY_PARENT" title="PrimaryParent" rel-entity-name="ProductCategory">
        <key-map field-name="primaryParentCategoryId" rel-field-name="productCategoryId"/>
      </relation>
      <relation type="many" title="PrimaryChild" rel-entity-name="ProductCategory">
        <key-map field-name="productCategoryId" rel-field-name="primaryParentCategoryId"/>
      </relation>
    </entity>

    <extend-entity entity-name="ProductCategory"><!-- SCIPIO -->
        <field name="imageProfile" type="id"><description>Name of a media profile for the main product category image, either ImageSizePreset.presetId or media profile name from mediaprofiles.properties, defaults to IMAGE_PRODUCT-ORIGINAL_IMAGE_URL (SCIPIO)</description></field>
    </extend-entity>
    <!-- SCIPIO: Category inline image equivalents of DataResource fields scpWidth, scpHeight, srcPresetJson, ... -->
    <entity entity-name="CategoryMediaDetails"
            package-name="org.ofbiz.product.product"
            title="Inline Category Media Details">
        <field name="productCategoryId" type="id-ne"></field>
        <field name="smallImageWidth" type="numeric"></field>
        <field name="smallImageHeight" type="numeric"></field>
        <field name="smallImageMimeTypeId" type="id-vlong"></field>
        <field name="smallImagePresetJson" type="very-long"></field>
        <field name="mediumImageWidth" type="numeric"></field>
        <field name="mediumImageHeight" type="numeric"></field>
        <field name="mediumImageMimeTypeId" type="id-vlong"></field>
        <field name="mediumImagePresetJson" type="very-long"></field>
        <field name="largeImageWidth" type="numeric"></field>
        <field name="largeImageHeight" type="numeric"></field>
        <field name="largeImageMimeTypeId" type="id-vlong"></field>
        <field name="largeImagePresetJson" type="very-long"></field>
        <field name="detailImageWidth" type="numeric"></field>
        <field name="detailImageHeight" type="numeric"></field>
        <field name="detailImageMimeTypeId" type="id-vlong"></field>
        <field name="detailImagePresetJson" type="very-long"></field>
        <field name="originalImageWidth" type="numeric"></field>
        <field name="originalImageHeight" type="numeric"></field>
        <field name="originalImageMimeTypeId" type="id-vlong"></field>
        <field name="originalImagePresetJson" type="very-long"></field>
        <field name="originalImageFileName" type="value"></field><!-- TODO: not currently populated by inconsistent upload functions -->
        <prim-key field="productCategoryId"/>
        <relation type="one" fk-name="CATEGMEDDET_CATID" rel-entity-name="ProductCategory">
            <key-map field-name="productCategoryId"/>
        </relation>
    </entity>

    <view-entity entity-name="ProductCategoryAndMember"
            package-name="org.ofbiz.product.category"
            title="ProductCategory And ProductCategoryMember View">
      <member-entity entity-alias="PC" entity-name="ProductCategory"/>
      <member-entity entity-alias="PCM" entity-name="ProductCategoryMember"/>
      <alias-all entity-alias="PC"/>
      <alias-all entity-alias="PCM"/>
      <view-link entity-alias="PC" rel-entity-alias="PCM">
        <key-map field-name="productCategoryId"/>
      </view-link>
      <relation type="one-nofk" rel-entity-name="ProductCategoryMember">
        <key-map field-name="productCategoryId"/>
        <key-map field-name="productId"/>
        <key-map field-name="fromDate"/>
      </relation>
      <relation type="one-nofk" rel-entity-name="ProductCategory">
        <key-map field-name="productCategoryId"/>
      </relation>
      <relation type="one-nofk" rel-entity-name="Product">
        <key-map field-name="productId"/>
      </relation>
    </view-entity>
    <entity entity-name="ProductCategoryAttribute"
            package-name="org.ofbiz.product.category"
            title="Product Category Attribute">
      <field name="productCategoryId" type="id-ne"></field>
      <field name="attrName" type="id-long-ne"></field>
      <field name="attrValue" type="value"></field>
      <field name="attrDescription" type="description"></field>
      <prim-key field="productCategoryId"/>
      <prim-key field="attrName"/>
      <relation type="one" fk-name="PROD_CTGRY_ATTR" rel-entity-name="ProductCategory">
        <key-map field-name="productCategoryId"/>
      </relation>
      <relation type="many" rel-entity-name="ProductCategoryTypeAttr">
        <key-map field-name="attrName"/>
      </relation>
    </entity>
    <entity entity-name="ProductCategoryContent"
            package-name="org.ofbiz.product.category"
            title="Product Category Data Object">
      <field name="productCategoryId" type="id-ne"></field>
      <field name="contentId" type="id-ne"></field>
      <field name="prodCatContentTypeId" type="id-ne"></field>
      <field name="fromDate" type="date-time"></field>
      <field name="thruDate" type="date-time"></field>
      <field name="purchaseFromDate" type="date-time"></field>
      <field name="purchaseThruDate" type="date-time"></field>
      <field name="useCountLimit" type="numeric"></field>
      <field name="useDaysLimit" type="fixed-point"></field>
      <prim-key field="productCategoryId"/>
      <prim-key field="contentId"/>
      <prim-key field="prodCatContentTypeId"/>
      <prim-key field="fromDate"/>
      <relation type="one" fk-name="PRDCAT_CNT_PRDCAT" rel-entity-name="ProductCategory">
        <key-map field-name="productCategoryId"/>
      </relation>
      <relation type="one" fk-name="PRDCAT_CNT_CNT" rel-entity-name="Content">
        <key-map field-name="contentId"/>
      </relation>
      <relation type="one" fk-name="PRDCAT_CNT_TYPE" rel-entity-name="ProductCategoryContentType">
        <key-map field-name="prodCatContentTypeId"/>
      </relation>
        <index name="PRDCAT_CNT_CTTP">
            <index-field name="productCategoryId"/>
            <index-field name="prodCatContentTypeId"/>
        </index>
        <!-- Scipio: Experimental index
        <index name="PRDCAT_CNT_JINFO">
            <index-field name="fromDate"/>
            <index-field name="productCategoryId"/>
            <index-field name="contentId"/>
            <index-field name="prodCatContentTypeId"/>
        </index>-->
    </entity>
    <view-entity entity-name="ProductCategoryContentAndInfo"
                package-name="org.ofbiz.product.category"
                title="ProductCategoryContent, Content and DataResource View">
      <member-entity entity-alias="PCC" entity-name="ProductCategoryContent"/>
      <member-entity entity-alias="CO" entity-name="Content"/>
      <member-entity entity-alias="DR" entity-name="DataResource"/>
      <alias-all entity-alias="PCC"/>
      <alias-all entity-alias="CO"/>
      <alias-all entity-alias="DR" prefix="dr"/>
      <view-link entity-alias="PCC" rel-entity-alias="CO">
        <key-map field-name="contentId"/>
      </view-link>
      <view-link entity-alias="CO" rel-entity-alias="DR">
        <key-map field-name="dataResourceId"/>
      </view-link>
      <relation type="one-nofk" rel-entity-name="ElectronicText">
        <key-map field-name="dataResourceId"/>
      </relation>
      <relation type="one-nofk" rel-entity-name="ImageDataResource">
        <key-map field-name="dataResourceId"/>
      </relation>
      <relation type="one-nofk" rel-entity-name="OtherDataResource">
        <key-map field-name="dataResourceId"/>
      </relation>
      <relation type="many" rel-entity-name="ContentAssocDataResourceViewFrom">
        <key-map field-name="contentId" rel-field-name="contentIdStart"/>
      </relation>
      <relation type="many" rel-entity-name="ContentAssocDataResourceViewTo">
        <key-map field-name="contentId" rel-field-name="contentIdStart"/>
      </relation>
    </view-entity>
    <!-- SCIPIO: 2017-10-27: new entity that covers 4 entities, most useful for simple text content values e.g. ALTERNATE_TEXT -->
    <view-entity entity-name="ProductCategoryContentAndElectronicText"
                package-name="org.ofbiz.product.category"
                title="ProductCategoryContent and ElectronicText Required View">
      <member-entity entity-alias="PCC" entity-name="ProductCategoryContent"/>
      <member-entity entity-alias="CO" entity-name="Content"/>
      <member-entity entity-alias="DR" entity-name="DataResource"/>
      <member-entity entity-alias="EL" entity-name="ElectronicText"/>
      <alias-all entity-alias="PCC"/>
      <alias-all entity-alias="CO"/>
      <alias-all entity-alias="DR" prefix="dr"/>
      <alias-all entity-alias="EL"/>
      <view-link entity-alias="PCC" rel-entity-alias="CO">
        <key-map field-name="contentId"/>
      </view-link>
      <view-link entity-alias="CO" rel-entity-alias="DR" rel-optional="false">
        <key-map field-name="dataResourceId"/>
      </view-link>
      <view-link entity-alias="CO" rel-entity-alias="EL" rel-optional="false">
        <key-map field-name="dataResourceId"/>
      </view-link>
    </view-entity>
    <!-- SCIPIO: 2017-11-08: same as ProductCategoryContentAndElectronicText but skips DataResource for performance -->
    <view-entity entity-name="ProductCategoryContentAndElecTextShort"
                package-name="org.ofbiz.product.category"
                title="ProductCategoryContent and ElectronicText Required Short View">
      <member-entity entity-alias="PCC" entity-name="ProductCategoryContent"/>
      <member-entity entity-alias="CO" entity-name="Content"/>
      <member-entity entity-alias="EL" entity-name="ElectronicText"/>
      <alias-all entity-alias="PCC"/>
      <alias-all entity-alias="CO"/>
      <alias-all entity-alias="EL"/>
      <view-link entity-alias="PCC" rel-entity-alias="CO">
        <key-map field-name="contentId"/>
      </view-link>
      <view-link entity-alias="CO" rel-entity-alias="EL" rel-optional="false">
        <key-map field-name="dataResourceId"/>
      </view-link>
    </view-entity>
    <!-- SCIPIO: 2017-11-08: new partially optimized entity that goes from ProductCategoryContent to ContentAssoc to ElectronicText, skipping some intermediates -->
    <view-entity entity-name="ProductCategoryContentAssocAndElecTextShort"
                package-name="org.ofbiz.product.category"
                title="ProductCategoryContent and ContentAssoc and ElectronicText Required Short View">
      <member-entity entity-alias="PCC" entity-name="ProductCategoryContent"/>
      <member-entity entity-alias="CA" entity-name="ContentAssoc"/>
      <member-entity entity-alias="TOCO" entity-name="Content"/>
      <member-entity entity-alias="EL" entity-name="ElectronicText"/>
        <alias entity-alias="PCC" name="productCategoryId" />
        <alias entity-alias="PCC" name="prodCatContentTypeId" />
        <alias entity-alias="PCC" name="fromDate" field="fromDate"/>
        <alias entity-alias="PCC" name="thruDate" field="thruDate"/>
        <alias entity-alias="CA" name="contentAssocTypeId" />
        <alias entity-alias="CA" name="contentId"/>
        <alias entity-alias="CA" name="contentIdTo" />
        <alias entity-alias="CA" name="caFromDate" field="fromDate" />
        <alias entity-alias="CA" name="caThruDate" field="thruDate" />
        <alias entity-alias="TOCO" name="localeString" />
        <alias entity-alias="TOCO" name="dataResourceId" />
        <alias entity-alias="EL" name="textData" />
      <view-link entity-alias="PCC" rel-entity-alias="CA">
        <key-map field-name="contentId"/>
      </view-link>
      <view-link entity-alias="CA" rel-entity-alias="TOCO">
        <key-map field-name="contentIdTo" rel-field-name="contentId"/>
      </view-link>
      <view-link entity-alias="TOCO" rel-entity-alias="EL" rel-optional="false">
        <key-map field-name="dataResourceId"/>
      </view-link>
    </view-entity>
    <entity entity-name="ProductCategoryContentType"
            package-name="org.ofbiz.product.category"
            default-resource-name="ProductEntityLabels"
            title="Product Category Content Type">
      <field name="prodCatContentTypeId" type="id-ne"></field>
      <field name="parentTypeId" type="id"></field>
      <field name="hasTable" type="indicator"></field>
      <field name="description" type="description"></field>
      <field name="viewType" type="name"><description>For images: main, additional or a custom type (SCIPIO)</description></field>
      <field name="viewNumber" type="value"><description>For images: 0 for main, 1-4 or greater for additional images (SCIPIO)</description></field>
      <field name="viewSize" type="name"><description>For images: original, detail, large, 320x240, etc., also known as sizeType (SCIPIO)</description></field>
      <field name="viewVariantId" type="name"><description>For images: flexible expression pattern for generating variant productCategoryContentTypeId of an original image URL (SCIPIO)</description></field>
      <field name="viewVariantDesc" type="name"><description>For images: flexible expression pattern for generating variant description of an original image URL (SCIPIO)</description></field>
      <prim-key field="prodCatContentTypeId"/>
      <relation type="one" fk-name="PRDCATCNT_TYP_PAR" title="Parent" rel-entity-name="ProductCategoryContentType">
        <key-map field-name="parentTypeId" rel-field-name="prodCatContentTypeId"/>
      </relation>
    </entity>
    <entity entity-name="ProductCategoryGlAccount" package-name="org.ofbiz.product.category" title="Product Category GlAccount">
        <field name="productCategoryId" type="id-ne"></field>
        <field name="organizationPartyId" type="id-ne"></field>
        <field name="glAccountTypeId" type="id-ne"></field>
        <field name="glAccountId" type="id-ne"></field>
        <prim-key field="productCategoryId"/>
        <prim-key field="organizationPartyId"/>
        <prim-key field="glAccountTypeId"/>
        <relation type="one" fk-name="PRD_CT_GLACT_PCAT" rel-entity-name="ProductCategory">
            <key-map field-name="productCategoryId"/>
        </relation>
        <relation type="one" fk-name="PRD_CT_GLACT_PRTY" rel-entity-name="Party">
            <key-map field-name="organizationPartyId" rel-field-name="partyId"/>
        </relation>
        <relation type="one" fk-name="PRD_CT_GLACT_TYPE" rel-entity-name="GlAccountType">
            <key-map field-name="glAccountTypeId"/>
        </relation>
        <relation type="one" fk-name="PRD_CT_GLACT_GLACT" rel-entity-name="GlAccount">
            <key-map field-name="glAccountId"/>
        </relation>
    </entity>
    <entity entity-name="ProductCategoryLink"
        package-name="org.ofbiz.product.category"
        title="Product Category Link">
        <field name="productCategoryId" type="id-ne"></field>
        <field name="linkSeqId" type="id-ne"></field>
        <field name="fromDate" type="date-time"></field>
        <field name="thruDate" type="date-time"></field>
        <field name="comments" type="comment"><description>Internal comments, not for public display.</description></field>
        <field name="sequenceNum" type="numeric"><description>This field is used to sort the links. The linkSeqId field is not used because it is part of the primary key and cannot be changed.</description></field>
        <field name="titleText" type="description"></field>
        <field name="detailText" type="very-long"></field>
        <field name="imageUrl" type="url"></field>
        <field name="imageTwoUrl" type="url"></field>
        <field name="linkTypeEnumId" type="id"></field>
        <field name="linkInfo" type="long-varchar"></field>
        <field name="detailSubScreen" type="long-varchar"><description>This is optional. If not specified a default should be used by the category detail template.</description></field>
        <prim-key field="productCategoryId"/>
        <prim-key field="linkSeqId"/>
        <prim-key field="fromDate"/>
        <relation type="one" fk-name="PROD_CLNK_CATEGORY" rel-entity-name="ProductCategory">
            <key-map field-name="productCategoryId"/>
        </relation>
        <relation type="one" fk-name="PROD_CLNK_LKTPENM" title="LinkType" rel-entity-name="Enumeration">
            <key-map field-name="linkTypeEnumId" rel-field-name="enumId"/>
        </relation>
    </entity>
    <entity entity-name="ProductCategoryMember"
        package-name="org.ofbiz.product.category"
        title="Product Category Member">
        <field name="productCategoryId" type="id-ne"></field>
        <field name="productId" type="id-ne"></field>
        <field name="fromDate" type="date-time"></field>
        <field name="thruDate" type="date-time"></field>
        <field name="comments" type="comment"></field>
        <field name="sequenceNum" type="numeric"></field>
        <field name="quantity" type="fixed-point"></field>
        <field name="sortPriority" type="fixed-point"><description>Search priority; between 0-1.0 is less than default, higher prioritizes (opposite sequenceNum)</description></field><!-- SCIPIO: 2.1.0: Added -->
        <prim-key field="productCategoryId"/>
        <prim-key field="productId"/>
        <prim-key field="fromDate"/>
        <relation type="one" fk-name="PROD_CMBR_PRODUCT" rel-entity-name="Product">
            <key-map field-name="productId"/>
        </relation>
        <relation type="one" fk-name="PROD_CMBR_CATEGORY" rel-entity-name="ProductCategory">
            <key-map field-name="productCategoryId"/>
        </relation>
        <index name="PRD_CMBR_PCT">
            <index-field name="productCategoryId"/>
        </index>
    </entity>
    <view-entity entity-name="ProductCategoryMemberAndRole"
            package-name="org.ofbiz.product.category"
            title="ProductCategoryMember And ProductCategoryRole View">
      <member-entity entity-alias="PCM" entity-name="ProductCategoryMember"/>
      <member-entity entity-alias="PCR" entity-name="ProductCategoryRole"/>
      <alias entity-alias="PCM" name="productId"/>
      <alias entity-alias="PCM" name="productCategoryId"/>
      <alias entity-alias="PCM" name="fromDate"/>
      <alias entity-alias="PCM" name="thruDate"/>
      <alias entity-alias="PCM" name="comments"/>
      <alias entity-alias="PCM" name="sequenceNum"/>
      <alias entity-alias="PCM" name="quantity"/>
      <alias entity-alias="PCR" name="partyId"/>
      <alias entity-alias="PCR" name="roleTypeId"/>
      <alias entity-alias="PCR" name="roleFromDate" field="fromDate"/>
      <alias entity-alias="PCR" name="roleThruDate" field="thruDate"/>
      <alias entity-alias="PCR" name="roleComments" field="comments"/>
      <view-link entity-alias="PCM" rel-entity-alias="PCR">
        <key-map field-name="productCategoryId"/>
      </view-link>
      <relation type="one-nofk" rel-entity-name="ProductCategoryMember">
        <key-map field-name="productCategoryId"/>
        <key-map field-name="productId"/>
        <key-map field-name="fromDate"/>
      </relation>
      <relation type="one-nofk" rel-entity-name="ProductCategoryRole">
        <key-map field-name="productCategoryId"/>
        <key-map field-name="partyId"/>
        <key-map field-name="roleTypeId"/>
        <key-map field-name="roleFromDate" rel-field-name="fromDate"/>
      </relation>
      <relation type="one-nofk" rel-entity-name="ProductCategory">
        <key-map field-name="productCategoryId"/>
      </relation>
      <relation type="one-nofk" rel-entity-name="Product">
        <key-map field-name="productId"/>
      </relation>
    </view-entity>
    <entity entity-name="ProductCategoryRole"
            package-name="org.ofbiz.product.category"
            title="Product Category Role">
      <field name="productCategoryId" type="id-ne"></field>
      <field name="partyId" type="id-ne"></field>
      <field name="roleTypeId" type="id-ne"></field>
      <field name="fromDate" type="date-time"></field>
      <field name="thruDate" type="date-time"></field>
      <field name="comments" type="comment"></field>
      <prim-key field="productCategoryId"/>
      <prim-key field="partyId"/>
      <prim-key field="roleTypeId"/>
      <prim-key field="fromDate"/>
      <relation type="one-nofk" rel-entity-name="Party">
        <key-map field-name="partyId"/>
      </relation>
      <relation type="one-nofk" rel-entity-name="RoleType">
        <key-map field-name="roleTypeId"/>
      </relation>
      <relation type="one" fk-name="PROD_CRLE_PTYRLE" rel-entity-name="PartyRole">
        <key-map field-name="partyId"/>
        <key-map field-name="roleTypeId"/>
      </relation>
      <relation type="one" fk-name="PROD_CRLE_CATEGORY" rel-entity-name="ProductCategory">
        <key-map field-name="productCategoryId"/>
      </relation>
    </entity>
    <entity entity-name="ProductCategoryRollup"
            package-name="org.ofbiz.product.category"
            title="Product Category Rollup">
      <field name="productCategoryId" type="id-ne"></field>
      <field name="parentProductCategoryId" type="id-ne"><description>The parent category; it should be one of productCategoryId already setup in ProductCategory or ProductCategoryRollup</description></field>
      <field name="fromDate" type="date-time"></field>
      <field name="thruDate" type="date-time"></field>
      <field name="sequenceNum" type="numeric"></field>
      <prim-key field="productCategoryId"/>
      <prim-key field="parentProductCategoryId"/>
      <prim-key field="fromDate"/>
      <relation type="one" fk-name="PROD_CRLP_CURRENT" title="Current" rel-entity-name="ProductCategory">
        <key-map field-name="productCategoryId"/>
      </relation>
      <relation type="one" fk-name="PROD_CRLP_PARENT" title="Parent" rel-entity-name="ProductCategory">
        <key-map field-name="parentProductCategoryId" rel-field-name="productCategoryId"/>
      </relation>
      <relation type="many" title="Child" rel-entity-name="ProductCategoryRollup">
        <key-map field-name="productCategoryId" rel-field-name="parentProductCategoryId"/>
      </relation>
      <relation type="many" title="Parent" rel-entity-name="ProductCategoryRollup">
        <key-map field-name="parentProductCategoryId" rel-field-name="productCategoryId"/>
      </relation>
      <relation type="many" title="Sibling" rel-entity-name="ProductCategoryRollup">
        <key-map field-name="parentProductCategoryId"/>
      </relation>
        <index name="PRDCR_PARPC">
            <index-field name="parentProductCategoryId"/>
        </index>
    </entity>
    <view-entity entity-name="ProductCategoryRollupAndChild" package-name="org.ofbiz.product.category">
        <member-entity entity-alias="PCR" entity-name="ProductCategoryRollup"/>
        <member-entity entity-alias="CPC" entity-name="ProductCategory"/>
        <alias-all entity-alias="CPC"/>
        <alias entity-alias="PCR" name="parentProductCategoryId"/>
        <alias entity-alias="PCR" name="fromDate"/>
        <alias entity-alias="PCR" name="thruDate"/>
        <alias entity-alias="PCR" name="sequenceNum"/>
        <view-link entity-alias="PCR" rel-entity-alias="CPC">
            <key-map field-name="productCategoryId"/>
        </view-link>
    </view-entity>
    <view-entity entity-name="ProductCategoryRollupAndRole"
            package-name="org.ofbiz.product.category"
            title="ProductCategoryRollup And ProductCategoryRole View">
      <description>Allow the lookup of a category that is in another category that a party/role is related to. So, the party/role is related to the parent category.</description>
      <member-entity entity-alias="PCRLP" entity-name="ProductCategoryRollup"/>
      <member-entity entity-alias="PCR" entity-name="ProductCategoryRole"/>
      <alias entity-alias="PCRLP" name="productCategoryId"/>
      <alias entity-alias="PCRLP" name="parentProductCategoryId"/>
      <alias entity-alias="PCRLP" name="fromDate"/>
      <alias entity-alias="PCRLP" name="thruDate"/>
      <alias entity-alias="PCRLP" name="sequenceNum"/>
      <alias entity-alias="PCR" name="partyId"/>
      <alias entity-alias="PCR" name="roleTypeId"/>
      <alias entity-alias="PCR" name="roleFromDate" field="fromDate"/>
      <alias entity-alias="PCR" name="roleThruDate" field="thruDate"/>
      <alias entity-alias="PCR" name="roleComments" field="comments"/>
      <view-link entity-alias="PCRLP" rel-entity-alias="PCR">
        <key-map field-name="parentProductCategoryId" rel-field-name="productCategoryId"/>
      </view-link>
      <relation type="one-nofk" rel-entity-name="ProductCategoryRollup">
        <key-map field-name="productCategoryId"/>
        <key-map field-name="parentProductCategoryId"/>
        <key-map field-name="fromDate"/>
      </relation>
      <relation type="one-nofk" rel-entity-name="ProductCategoryRole">
        <key-map field-name="parentProductCategoryId" rel-field-name="productCategoryId"/>
        <key-map field-name="partyId"/>
        <key-map field-name="roleTypeId"/>
        <key-map field-name="roleFromDate" rel-field-name="fromDate"/>
      </relation>
      <relation type="one-nofk" rel-entity-name="ProductCategory">
        <key-map field-name="productCategoryId"/>
      </relation>
      <relation type="one-nofk" title="Parent" rel-entity-name="ProductCategory">
        <key-map field-name="parentProductCategoryId" rel-field-name="productCategoryId"/>
      </relation>
    </view-entity>
    <entity entity-name="ProductCategoryType"
            package-name="org.ofbiz.product.category"
            default-resource-name="ProductEntityLabels"
            title="Product Category Type">
      <field name="productCategoryTypeId" type="id-ne"></field>
      <field name="parentTypeId" type="id"></field>
      <field name="hasTable" type="indicator"></field>
      <field name="description" type="description"></field>
      <prim-key field="productCategoryTypeId"/>
      <relation type="one" fk-name="PROD_CTGRY_TYPEPAR" title="Parent" rel-entity-name="ProductCategoryType">
        <key-map field-name="parentTypeId" rel-field-name="productCategoryTypeId"/>
      </relation>
    </entity>
    <entity entity-name="ProductCategoryTypeAttr"
            package-name="org.ofbiz.product.category"
            title="Product Category Type Attribute">
      <field name="productCategoryTypeId" type="id-ne"></field>
      <field name="attrName" type="id-long-ne"></field>
      <field name="description" type="description"></field>
      <prim-key field="productCategoryTypeId"/>
      <prim-key field="attrName"/>
      <relation type="one" fk-name="PROD_CTGRY_TATTR" rel-entity-name="ProductCategoryType">
        <key-map field-name="productCategoryTypeId"/>
      </relation>
      <relation type="many" rel-entity-name="ProductCategoryAttribute">
        <key-map field-name="attrName"/>
      </relation>
      <relation type="many" rel-entity-name="ProductCategory">
        <key-map field-name="productCategoryTypeId"/>
      </relation>
    </entity>

    <!-- ========================================================= -->
    <!-- org.ofbiz.product.config -->
    <!-- ========================================================= -->

    <entity entity-name="ProductConfig"
            package-name="org.ofbiz.product.config"
            title="Product Configuration Templates">
        <field name="productId" type="id-ne"></field>
        <field name="configItemId" type="id-ne"></field>
        <field name="sequenceNum" type="numeric"></field>
        <field name="fromDate" type="date-time"></field>
        <field name="description" type="description"></field>
        <field name="longDescription" type="very-long"></field>
        <field name="configTypeId" type="id"></field>
        <field name="defaultConfigOptionId" type="id"></field>
        <field name="thruDate" type="date-time"></field>
        <field name="isMandatory" type="indicator"></field>
        <prim-key field="productId"/>
        <prim-key field="configItemId"/>
        <prim-key field="sequenceNum"/>
        <prim-key field="fromDate"/>
        <relation type="one" fk-name="PROD_CONF_PROD" title="Product" rel-entity-name="Product">
            <key-map field-name="productId"/>
        </relation>
        <relation type="one" fk-name="PROD_CONF_ITEM" title="ConfigItem" rel-entity-name="ProductConfigItem">
            <key-map field-name="configItemId"/>
        </relation>
    </entity>
    <view-entity entity-name="ProductConfigAndProduct"
      package-name="org.ofbiz.product.config"
      title="Product Config And Product  View Entity, to be able to see which products use a certain configuration item">
      <member-entity entity-alias="PDC" entity-name="ProductConfig"/>
      <member-entity entity-alias="PD" entity-name="Product"/>
      <alias-all entity-alias="PDC">
        <exclude field="description"/>
        <exclude field="longDescription"/>
      </alias-all>
      <alias-all entity-alias="PD"/>
      <view-link entity-alias="PDC" rel-entity-alias="PD">
        <key-map field-name="productId"/>
      </view-link>
    </view-entity>
    <entity entity-name="ProductConfigItem"
            package-name="org.ofbiz.product.config"
            title="Product Configuration Question">
        <field name="configItemId" type="id-ne"></field>
        <field name="configItemTypeId" type="id"></field>
        <field name="configItemName" type="name"></field>
        <field name="description" type="description"></field>
        <field name="longDescription" type="very-long"></field>
        <field name="imageUrl" type="url"></field>
        <prim-key field="configItemId"/>
    </entity>
    <entity entity-name="ProdConfItemContent"
            package-name="org.ofbiz.product.config"
            title="Product Configuration Question Data Object">
        <field name="configItemId" type="id-ne"></field>
        <field name="contentId" type="id-ne"></field>
        <field name="confItemContentTypeId" type="id-ne"></field>
        <field name="fromDate" type="date-time"></field>
        <field name="thruDate" type="date-time"></field>
        <prim-key field="configItemId"/>
        <prim-key field="contentId"/>
        <prim-key field="confItemContentTypeId"/>
        <prim-key field="fromDate"/>
        <relation type="one" fk-name="CIMT_CNT_PCIT" rel-entity-name="ProductConfigItem">
            <key-map field-name="configItemId"/>
        </relation>
        <relation type="one" fk-name="CIMT_CNT_CNT" rel-entity-name="Content">
            <key-map field-name="contentId"/>
        </relation>
        <relation type="one" fk-name="CIMT_CNT_TYPE" rel-entity-name="ProdConfItemContentType">
            <key-map field-name="confItemContentTypeId"/>
        </relation>
    </entity>
    <entity entity-name="ProdConfItemContentType"
            package-name="org.ofbiz.product.config"
            title="Product Content Type"
            default-resource-name="ProductEntityLabels">
        <field name="confItemContentTypeId" type="id-ne"></field>
        <field name="parentTypeId" type="id"></field>
        <field name="hasTable" type="indicator"></field>
        <field name="description" type="description"></field>
        <prim-key field="confItemContentTypeId"/>
        <relation type="one" fk-name="PCICT_TYP_PARENT" title="Parent" rel-entity-name="ProdConfItemContentType">
            <key-map field-name="parentTypeId" rel-field-name="confItemContentTypeId"/>
        </relation>
    </entity>
    <entity entity-name="ProductConfigOption"
            package-name="org.ofbiz.product.config"
            title="Product Configuration Options">
        <field name="configItemId" type="id-ne"></field>
        <field name="configOptionId" type="id-ne"></field>
        <field name="configOptionName" type="name"></field>
        <field name="description" type="description"></field>
        <field name="sequenceNum" type="numeric"></field>
        <prim-key field="configItemId"/>
        <prim-key field="configOptionId"/>
        <relation type="one" fk-name="PROD_OPTN_ITEM" title="ConfigItem" rel-entity-name="ProductConfigItem">
            <key-map field-name="configItemId"/>
        </relation>
    </entity>
    <entity entity-name="ProductConfigOptionIactn"
            package-name="org.ofbiz.product.config"
            title="Product Configuration Options">
        <field name="configItemId" type="id-ne"></field>
        <field name="configOptionId" type="id-ne"></field>
        <field name="configItemIdTo" type="id-ne"></field>
        <field name="configOptionIdTo" type="id-ne"></field>
        <field name="sequenceNum" type="numeric"></field>
        <field name="configIactnTypeId" type="id"><description>INCOMPATIBLE, etc...</description></field>
        <field name="description" type="description"></field>
        <prim-key field="configItemId"/>
        <prim-key field="configOptionId"/>
        <prim-key field="configItemIdTo"/>
        <prim-key field="configOptionIdTo"/>
        <prim-key field="sequenceNum"/> <!-- OPTIONAL -->
        <relation type="one" fk-name="PROD_OPTIA_ITEM" title="ConfigItem" rel-entity-name="ProductConfigItem">
            <key-map field-name="configItemId"/>
        </relation>
        <relation type="one" fk-name="PROD_OPTIA_OPTN" title="ConfigOption" rel-entity-name="ProductConfigOption">
            <key-map field-name="configItemId"/>
            <key-map field-name="configOptionId"/>
        </relation>
        <relation type="one" fk-name="PROD_OPTIA_ITMT" title="ConfigItemTo" rel-entity-name="ProductConfigItem">
            <key-map field-name="configItemIdTo" rel-field-name="configItemId"/>
        </relation>
        <relation type="one" fk-name="PROD_OPTIA_OPTT" title="ConfigOptionTo" rel-entity-name="ProductConfigOption">
            <key-map field-name="configItemIdTo" rel-field-name="configItemId"/>
            <key-map field-name="configOptionIdTo" rel-field-name="configOptionId"/>
        </relation>
    </entity>
    <entity entity-name="ProductConfigProduct"
            package-name="org.ofbiz.product.config"
            title="Product Configuration Option to Products">
        <field name="configItemId" type="id-ne"></field>
        <field name="configOptionId" type="id-ne"></field>
        <field name="productId" type="id-ne"></field>
        <field name="quantity" type="fixed-point"></field>
        <field name="sequenceNum" type="numeric"></field>
        <prim-key field="configItemId"/>
        <prim-key field="configOptionId"/>
        <prim-key field="productId"/>
        <relation type="one" fk-name="PROD_CONFP_ITEM" title="ConfigItem" rel-entity-name="ProductConfigItem">
            <key-map field-name="configItemId"/>
        </relation>
        <relation type="one" fk-name="PROD_CONFP_OPTN" title="ConfigOption" rel-entity-name="ProductConfigOption">
            <key-map field-name="configItemId"/>
            <key-map field-name="configOptionId"/>
        </relation>
        <relation type="one" fk-name="PROD_CONFP_PROD" title="Product" rel-entity-name="Product">
            <key-map field-name="productId"/>
        </relation>
    </entity>
    <!-- SCIPIO -->
    <view-entity entity-name="ProductConfigAndConfigProduct"
            package-name="org.ofbiz.product.config"
            title="Product Config and Product Config Product">
        <member-entity entity-alias="PC" entity-name="ProductConfig"/>
        <member-entity entity-alias="PCP" entity-name="ProductConfigProduct"/>
        <alias-all entity-alias="PC"/>
        <alias-all entity-alias="PCP" prefix="config"/>
        <view-link entity-alias="PC" rel-entity-alias="PCP">
            <key-map field-name="configItemId"/>
        </view-link>
    </view-entity>
    <entity entity-name="ProductConfigConfig"
            package-name="org.ofbiz.product.config"
            title="Existing Product Configurations">
        <field name="configId" type="id-ne"></field>
        <field name="configItemId" type="id-ne"></field>
        <field name="sequenceNum" type="numeric"></field>
        <field name="configOptionId" type="id-ne"></field>
        <field name="description" type="description"></field>
        <prim-key field="configId"/>
        <prim-key field="configItemId"/>
        <prim-key field="configOptionId"/>
        <prim-key field="sequenceNum"/>
        <relation type="one" fk-name="PROD_CONFC_ITEM" title="ConfigItem" rel-entity-name="ProductConfigItem">
            <key-map field-name="configItemId"/>
        </relation>
        <relation type="one" fk-name="PROD_CONFC_OPTN" title="ConfigOption" rel-entity-name="ProductConfigOption">
            <key-map field-name="configItemId"/>
            <key-map field-name="configOptionId"/>
        </relation>
    </entity>
    <entity entity-name="ProductConfigStats"
            package-name="org.ofbiz.product.config"
            title="Product Configurations Stats">
        <field name="configId" type="id-ne"></field>
        <field name="productId" type="id-ne"></field>
        <field name="numOfConfs" type="numeric"></field>
        <field name="configTypeId" type="id"><description>HIDDEN, TEMPLATE, etc...</description></field>
        <prim-key field="configId"/>
        <prim-key field="productId"/>
        <relation type="one" fk-name="PROD_CONFS_PROD" title="Product" rel-entity-name="Product">
            <key-map field-name="productId"/>
        </relation>
    </entity>
    <entity entity-name="ConfigOptionProductOption"
            package-name="org.ofbiz.product.config"
            title="Config Option Product Options">
        <field name="configId" type="id-ne"></field>
        <field name="configItemId" type="id-ne"></field>
        <field name="sequenceNum" type="numeric"></field>
        <field name="configOptionId" type="id-ne"></field>
        <field name="productId" type="id-ne"></field>
        <field name="productOptionId" type="id-ne"></field>
        <field name="description" type="description"></field>
        <prim-key field="configId"/>
        <prim-key field="configItemId"/>
        <prim-key field="configOptionId"/>
        <prim-key field="sequenceNum"/>
        <prim-key field="productId"/>
        <relation type="one" fk-name="PROD_OPTN_CONF" title="Config" rel-entity-name="ProductConfigConfig">
            <key-map field-name="configId"/>
            <key-map field-name="configItemId"/>
            <key-map field-name="configOptionId"/>
            <key-map field-name="sequenceNum"/>
        </relation>
        <relation type="one" fk-name="PROD_OPTN_PROD" title="Product" rel-entity-name="ProductConfigProduct">
            <key-map field-name="configItemId"/>
            <key-map field-name="configOptionId"/>
            <key-map field-name="productId"/>
        </relation>
    </entity>

  <!-- ========================================================= -->
  <!-- org.ofbiz.product.cost -->
  <!-- ========================================================= -->

    <entity entity-name="CostComponent"
            package-name="org.ofbiz.product.cost"
            default-resource-name="ProductEntityLabels"
            title="Cost Component">
      <field name="costComponentId" type="id-ne"></field>
      <field name="costComponentTypeId" type="id"></field>
      <field name="productId" type="id"></field>
      <field name="productFeatureId" type="id"></field>
      <field name="partyId" type="id"></field>
      <field name="geoId" type="id"></field>
      <field name="workEffortId" type="id"></field>
      <field name="fixedAssetId" type="id"></field>
      <field name="costComponentCalcId" type="id"></field>
      <field name="fromDate" type="date-time"></field>
      <field name="thruDate" type="date-time"></field>
      <field name="cost" type="fixed-point"><description>Higher precision in case it is a calculated number</description></field>
      <field name="costUomId" type="id"></field>
      <prim-key field="costComponentId"/>
      <relation type="one" fk-name="COST_COMP_TYPE" rel-entity-name="CostComponentType">
        <key-map field-name="costComponentTypeId"/>
      </relation>
      <relation type="many" rel-entity-name="CostComponentTypeAttr">
        <key-map field-name="costComponentTypeId"/>
      </relation>
      <relation type="one" fk-name="COST_COMP_PRODUCT" rel-entity-name="Product">
        <key-map field-name="productId"/>
      </relation>
      <relation type="one" fk-name="COST_COMP_PRODFEAT" rel-entity-name="ProductFeature">
        <key-map field-name="productFeatureId"/>
      </relation>
      <relation type="one" fk-name="COST_COMP_PARTY" rel-entity-name="Party">
        <key-map field-name="partyId"/>
      </relation>
      <relation type="one" fk-name="COST_COMP_GEO" rel-entity-name="Geo">
        <key-map field-name="geoId"/>
      </relation>
      <relation type="one" fk-name="COST_COMP_WEFF" rel-entity-name="WorkEffort">
        <key-map field-name="workEffortId"/>
      </relation>
      <relation type="one" fk-name="COST_COMP_FXADSST" rel-entity-name="FixedAsset">
        <key-map field-name="fixedAssetId"/>
      </relation>
      <relation type="one" fk-name="COST_COMP_CALC" rel-entity-name="CostComponentCalc">
        <key-map field-name="costComponentCalcId"/>
      </relation>
      <relation type="one" fk-name="COST_COMP_CUOM" title="Currency" rel-entity-name="Uom">
        <key-map field-name="costUomId" rel-field-name="uomId"/>
      </relation>
    </entity>
    <entity entity-name="CostComponentAttribute"
            package-name="org.ofbiz.product.cost"
            title="Cost Component Attribute">
      <field name="costComponentId" type="id-ne"></field>
      <field name="attrName" type="id-long-ne"></field>
      <field name="attrValue" type="value"></field>
      <field name="attrDescription" type="description"></field>
      <prim-key field="costComponentId"/>
      <prim-key field="attrName"/>
      <relation type="one" fk-name="COST_COMP_ATTR" rel-entity-name="CostComponent">
        <key-map field-name="costComponentId"/>
      </relation>
      <relation type="many" rel-entity-name="CostComponentTypeAttr">
        <key-map field-name="attrName"/>
      </relation>
    </entity>
    <entity entity-name="CostComponentType"
            package-name="org.ofbiz.product.cost"
            default-resource-name="ProductEntityLabels"
            title="Cost Component Type">
      <field name="costComponentTypeId" type="id-ne"></field>
      <field name="parentTypeId" type="id-ne"></field>
      <field name="hasTable" type="indicator"></field>
      <field name="description" type="description"></field>
      <prim-key field="costComponentTypeId"/>
      <relation type="one" fk-name="COST_COMP_TYPE_PAR" title="Parent" rel-entity-name="CostComponentType">
        <key-map field-name="parentTypeId" rel-field-name="costComponentTypeId"/>
      </relation>
    </entity>
    <entity entity-name="CostComponentTypeAttr"
            package-name="org.ofbiz.product.cost"
            title="Cost Component Type Attribute">
      <field name="costComponentTypeId" type="id-ne"></field>
      <field name="attrName" type="id-long-ne"></field>
      <field name="description" type="description"></field>
      <prim-key field="costComponentTypeId"/>
      <prim-key field="attrName"/>
      <relation type="one" fk-name="COST_COMP_TATTR" rel-entity-name="CostComponentType">
        <key-map field-name="costComponentTypeId"/>
      </relation>
      <relation type="many" rel-entity-name="CostComponentAttribute">
        <key-map field-name="attrName"/>
      </relation>
      <relation type="many" rel-entity-name="CostComponent">
        <key-map field-name="costComponentTypeId"/>
      </relation>
    </entity>
    <entity entity-name="CostComponentCalc"
            package-name="org.ofbiz.product.cost"
            title="Cost Component Calculation">
        <field name="costComponentCalcId" type="id-ne"></field>
        <field name="description" type="description"></field>
        <field name="costGlAccountTypeId" type="id"></field>
        <field name="offsettingGlAccountTypeId" type="id"></field>
        <field name="fixedCost" type="currency-amount"></field>
        <field name="variableCost" type="currency-amount"></field>
        <field name="perMilliSecond" type="numeric"></field>
        <field name="currencyUomId" type="id"></field>
        <field name="costCustomMethodId" type="id"></field>
        <prim-key field="costComponentCalcId"/>
        <relation type="one" fk-name="COST_COM_CGLAT" title="Cost" rel-entity-name="GlAccountType">
            <key-map field-name="costGlAccountTypeId" rel-field-name="glAccountTypeId"/>
        </relation>
        <relation type="one" fk-name="COST_COM_OGLAT" title="Offsetting" rel-entity-name="GlAccountType">
            <key-map field-name="offsettingGlAccountTypeId" rel-field-name="glAccountTypeId"/>
        </relation>
        <relation type="one" fk-name="COST_COM_CUOM" rel-entity-name="Uom">
            <key-map field-name="currencyUomId" rel-field-name="uomId"/>
        </relation>
        <relation type="one" fk-name="COST_COM_CMET" rel-entity-name="CustomMethod">
            <key-map field-name="costCustomMethodId" rel-field-name="customMethodId"/>
        </relation>
    </entity>
    <entity entity-name="ProductCostComponentCalc"
            package-name="org.ofbiz.product.cost"
            title="Product Cost Calculation">
        <field name="productId" type="id-ne"></field>
        <field name="costComponentTypeId" type="id-ne"></field>
        <field name="costComponentCalcId" type="id-ne"></field>
        <field name="fromDate" type="date-time"></field>
        <field name="sequenceNum" type="numeric"></field>
        <field name="thruDate" type="date-time"></field>
        <prim-key field="productId"/>
        <prim-key field="costComponentTypeId"/>
        <prim-key field="fromDate"/>
        <relation type="one" fk-name="PR_COS_COMPCALC" rel-entity-name="Product">
            <key-map field-name="productId"/>
        </relation>
        <relation type="one" fk-name="PR_COS_CCT" rel-entity-name="CostComponentType">
            <key-map field-name="costComponentTypeId"/>
        </relation>
        <relation type="one" fk-name="PR_COS_CCC" rel-entity-name="CostComponentCalc">
            <key-map field-name="costComponentCalcId"/>
        </relation>
    </entity>

    <!-- ========================================================= -->
    <!-- org.ofbiz.product.facility -->
    <!-- ========================================================= -->

    <entity entity-name="Container" package-name="org.ofbiz.product.facility" title="Container">
        <field name="containerId" type="id-ne"></field>
        <field name="containerTypeId" type="id"></field>
        <field name="facilityId" type="id"></field>
        <field name="description" type="description"></field>
        <prim-key field="containerId"/>
        <relation type="one" fk-name="CONTAINER_CTTYP" rel-entity-name="ContainerType">
            <key-map field-name="containerTypeId"/>
        </relation>
        <relation type="one" fk-name="CONTAINER_FACILITY" rel-entity-name="Facility">
            <key-map field-name="facilityId"/>
        </relation>
    </entity>
    <entity entity-name="ContainerType" package-name="org.ofbiz.product.facility" title="Container Type">
        <field name="containerTypeId" type="id-ne"></field>
        <field name="description" type="description"></field>
        <prim-key field="containerTypeId"/>
    </entity>
    <entity entity-name="ContainerGeoPoint" package-name="org.ofbiz.product.facility" title="Container Geo Location with history">
      <field name="containerId" type="id-ne"></field>
      <field name="geoPointId" type="id-ne"></field>
      <field name="fromDate" type="date-time"></field>
      <field name="thruDate" type="date-time"></field>
      <prim-key field="containerId"/>
      <prim-key field="geoPointId"/>
      <prim-key field="fromDate"/>
      <relation type="one" fk-name="CONTNRGEOPT_CONTNR" rel-entity-name="Container">
        <key-map field-name="containerId"/>
      </relation>
      <relation type="one" fk-name="CONTNRGEOPT_GEOPT" rel-entity-name="GeoPoint">
        <key-map field-name="geoPointId"/>
      </relation>
    </entity>
    <view-entity entity-name="ContainerAndGeoPoint" package-name="org.ofbiz.product.facility"  title="Container and Geo Point View">
      <member-entity entity-alias="CT" entity-name="Container"/>
      <member-entity entity-alias="CTGPT" entity-name="ContainerGeoPoint"/>
      <member-entity entity-alias="GPT" entity-name="GeoPoint"/>
      <alias-all entity-alias="GPT"/>
      <alias entity-alias="CT" name="containerId"/>
      <alias entity-alias="CTGPT" name="fromDate"/>
      <alias entity-alias="CTGPT" name="thruDate"/>
      <view-link entity-alias="CT" rel-entity-alias="CTGPT">
        <key-map field-name="containerId"/>
      </view-link>
      <view-link entity-alias="CTGPT" rel-entity-alias="GPT">
        <key-map field-name="geoPointId"/>
      </view-link>
      <relation type="many" rel-entity-name="ContainerGeoPoint">
        <key-map field-name="containerId"/>
        <key-map field-name="geoPointId"/>
      </relation>
      <relation type="one-nofk" rel-entity-name="Container">
        <key-map field-name="containerId"/>
      </relation>
      <relation type="one-nofk" rel-entity-name="GeoPoint">
        <key-map field-name="geoPointId"/>
      </relation>
    </view-entity>

    <entity entity-name="Facility" package-name="org.ofbiz.product.facility" title="Facility">
        <field name="facilityId" type="id-ne"></field>
        <field name="facilityTypeId" type="id"></field>
        <field name="parentFacilityId" type="id"></field>
        <field name="ownerPartyId" type="id-ne"/>
        <field name="defaultInventoryItemTypeId" type="id"></field>
        <field name="facilityName" type="name"></field>
        <field name="primaryFacilityGroupId" type="id"></field>
        <field name="oldSquareFootage" type="numeric" col-name="SQUARE_FOOTAGE"></field>
        <field name="facilitySize" type="fixed-point"></field>
        <field name="facilitySizeUomId" type="id"></field>
        <field name="productStoreId" type="id"></field>
        <field name="defaultDaysToShip" type="numeric"><description>In the absence of a product specific days to ship in ProductFacility, this will be used</description></field>
        <field name="openedDate" type="date-time"></field>
        <field name="closedDate" type="date-time"></field>
        <field name="description" type="description"></field>
        <field name="defaultDimensionUomId" type="id"><description>This field store the unit of measurement of dimension (length, width and height)</description></field>
        <field name="defaultWeightUomId" type="id"></field>
        <field name="geoPointId" type="id"></field>
        <prim-key field="facilityId"/>
        <relation type="one" fk-name="FACILITY_FCTYP" rel-entity-name="FacilityType">
            <key-map field-name="facilityTypeId"/>
        </relation>
        <relation type="one" fk-name="FACILITY_PARENT" title="Parent" rel-entity-name="Facility">
            <key-map field-name="parentFacilityId" rel-field-name="facilityId"/>
        </relation>
        <relation type="one" fk-name="FACILITY_PGRP" rel-entity-name="FacilityGroup">
            <key-map field-name="primaryFacilityGroupId" rel-field-name="facilityGroupId"/>
        </relation>
        <relation type="one" fk-name="FACILITY_OWNER" title="Owner" rel-entity-name="Party">
            <key-map field-name="ownerPartyId" rel-field-name="partyId"/>
        </relation>
        <relation type="one" fk-name="FAC_INVITM_TYPE" title="Default" rel-entity-name="InventoryItemType">
            <key-map field-name="defaultInventoryItemTypeId" rel-field-name="inventoryItemTypeId"/>
        </relation>
        <relation type="one" fk-name="FAC_DEF_DUOM" title="Dimension" rel-entity-name="Uom">
            <key-map field-name="defaultDimensionUomId" rel-field-name="uomId"/>
        </relation>
        <relation type="one" fk-name="FAC_DEF_WUOM" title="Weight" rel-entity-name="Uom">
            <key-map field-name="defaultWeightUomId" rel-field-name="uomId"/>
        </relation>
        <relation type="one-nofk" rel-entity-name="ProductStore">
            <description>this was changed from the FK to better handle syncronization; this may be set back to be a FK in the future</description>
            <key-map field-name="productStoreId"/>
        </relation>
        <relation type="many" rel-entity-name="FacilityTypeAttr">
            <key-map field-name="facilityTypeId"/>
        </relation>
        <relation type="one" fk-name="FACILITY_GEOPT" rel-entity-name="GeoPoint">
          <key-map field-name="geoPointId"/>
        </relation>
      <relation type="one" fk-name="FACILITY_SUOM" title="FacilitySize" rel-entity-name="Uom">
        <key-map field-name="facilitySizeUomId" rel-field-name="uomId"/>
      </relation>      
    </entity>
    <!-- SCIPIO: 2018-10-19: New -->
    <view-entity entity-name="FacilityContactMechAndContactMech" package-name="org.ofbiz.product.facility" title="Facility Contact Mech and Contact Mech View">
        <member-entity entity-alias="CM" entity-name="FacilityContactMech"/>
        <member-entity entity-alias="MC" entity-name="ContactMech"/>
        <alias-all entity-alias="CM"/>
        <alias-all entity-alias="MC"/>
        <view-link entity-alias="CM" rel-entity-alias="MC">
            <key-map field-name="contactMechId"/>
        </view-link>
        <relation type="one-nofk" rel-entity-name="FacilityContactMech">
            <key-map field-name="facilityId"/>
            <key-map field-name="contactMechId"/>
            <key-map field-name="fromDate"/>
        </relation>
        <relation type="one-nofk" rel-entity-name="ContactMech">
            <key-map field-name="contactMechId"/>
        </relation>
    </view-entity>
    <view-entity entity-name="FacilityAndContactMech" package-name="org.ofbiz.product.facility" title="Facility and Contact Mech View">
        <member-entity entity-alias="FA" entity-name="Facility"/>
        <member-entity entity-alias="CM" entity-name="FacilityContactMech"/>
        <member-entity entity-alias="MC" entity-name="ContactMech"/>
        <alias-all entity-alias="FA"/>
        <alias-all entity-alias="CM"/>
        <alias-all entity-alias="MC"/>
        <view-link entity-alias="FA" rel-entity-alias="CM">
            <key-map field-name="facilityId"/>
        </view-link>
        <view-link entity-alias="CM" rel-entity-alias="MC">
            <key-map field-name="contactMechId"/>
        </view-link>
    </view-entity>
    <entity entity-name="FacilityAttribute" package-name="org.ofbiz.product.facility" title="Facility Attribute">
        <field name="facilityId" type="id-ne"></field>
        <field name="attrName" type="id-long-ne"></field>
        <field name="attrValue" type="value"></field>
        <field name="attrDescription" type="description"></field>
        <prim-key field="facilityId"/>
        <prim-key field="attrName"/>
        <relation type="one" fk-name="FACILITY_ATTR" rel-entity-name="Facility">
            <key-map field-name="facilityId"/>
        </relation>
        <relation type="many" rel-entity-name="FacilityTypeAttr">
            <key-map field-name="attrName"/>
        </relation>
    </entity>

    <entity entity-name="FacilityCalendar" package-name="org.ofbiz.product.facility" title="Facility Calendar">
        <field name="facilityId" type="id"/>
        <field name="calendarId" type="id"/>
        <field name="facilityCalendarTypeId" type="id"/>
        <field name="fromDate" type="date-time"/>
        <field name="thruDate" type="date-time"/>
        <prim-key field="facilityId"/>
        <prim-key field="calendarId"/>
        <prim-key field="facilityCalendarTypeId"/>
        <prim-key field="fromDate"/>
        <relation type="one" fk-name="FACILITY_CAL_FAC" rel-entity-name="Facility">
            <key-map field-name="facilityId"/>
        </relation>
        <relation type="many" fk-name="FACILITY_TEC_CAL" rel-entity-name="TechDataCalendar">
            <key-map field-name="calendarId"/>
        </relation>
        <relation type="one" fk-name="FACILITY_CAL_TYPE" rel-entity-name="FacilityCalendarType">
            <key-map field-name="facilityCalendarTypeId"/>
        </relation>
    </entity>

    <entity entity-name="FacilityCalendarType" package-name="org.ofbiz.product.facility" title="Facility Calendar Type">
        <field name="facilityCalendarTypeId" type="id"/>
        <field name="parentTypeId" type="id"/>
        <field name="description" type="description"/>
        <prim-key field="facilityCalendarTypeId"/>
    </entity>

    <entity entity-name="FacilityCarrierShipment" package-name="org.ofbiz.product.facility" title="Facility Role Type">
        <field name="facilityId" type="id-ne"></field>
        <field name="partyId" type="id-ne"></field>
        <field name="roleTypeId" type="id-ne"></field>
        <field name="shipmentMethodTypeId" type="id-ne"></field>
        <prim-key field="facilityId"/>
        <prim-key field="partyId"/>
        <prim-key field="roleTypeId"/>
        <prim-key field="shipmentMethodTypeId"/>
        <relation type="one" fk-name="FACILITY_CSH_PTY" rel-entity-name="Party">
            <key-map field-name="partyId"/>
        </relation>
        <relation type="one" fk-name="FACILITY_CSH_FAC" rel-entity-name="Facility">
            <key-map field-name="facilityId"/>
        </relation>
        <relation type="one" fk-name="FACILITY_CSH_STP" rel-entity-name="ShipmentMethodType">
            <key-map field-name="shipmentMethodTypeId"/>
        </relation>
        <relation type="one" fk-name="FACILITY_CSH_CSM" rel-entity-name="CarrierShipmentMethod">
            <key-map field-name="shipmentMethodTypeId"/>
            <key-map field-name="partyId"/>
            <key-map field-name="roleTypeId"/>
        </relation>
    </entity>
    <entity entity-name="FacilityContactMech" package-name="org.ofbiz.product.facility" title="Facility Contact Mechanism">
        <field name="facilityId" type="id-ne"></field>
        <field name="contactMechId" type="id-ne"></field>
        <field name="fromDate" type="date-time"></field>
        <field name="thruDate" type="date-time"></field>
        <field name="extension" type="very-short"></field>
        <field name="comments" type="comment"></field>
        <prim-key field="facilityId"/>
        <prim-key field="contactMechId"/>
        <prim-key field="fromDate"/>
        <relation type="one" fk-name="FACIL_CMECH_FACIL" rel-entity-name="Facility">
            <key-map field-name="facilityId"/>
        </relation>
        <relation type="one" fk-name="FACIL_CMECH_CMECH" rel-entity-name="ContactMech">
            <key-map field-name="contactMechId"/>
        </relation>
        <relation type="one-nofk" rel-entity-name="TelecomNumber">
            <key-map field-name="contactMechId"/>
        </relation>
        <relation type="many" rel-entity-name="FacilityContactMechPurpose">
            <key-map field-name="facilityId"/>
            <key-map field-name="contactMechId"/>
        </relation>
    </entity>
    <entity entity-name="FacilityContactMechPurpose" package-name="org.ofbiz.product.facility" title="Facility Contact Mechanism Purpose">
        <field name="facilityId" type="id-ne"></field>
        <field name="contactMechId" type="id-ne"></field>
        <field name="contactMechPurposeTypeId" type="id-ne"></field>
        <field name="fromDate" type="date-time"></field>
        <field name="thruDate" type="date-time"></field>
        <prim-key field="facilityId"/>
        <prim-key field="contactMechId"/>
        <prim-key field="contactMechPurposeTypeId"/>
        <prim-key field="fromDate"/>
        <relation type="many" rel-entity-name="FacilityContactMech">
            <key-map field-name="facilityId"/>
            <key-map field-name="contactMechId"/>
        </relation>
        <relation type="one" fk-name="FACIL_CMPRP_TYPE" rel-entity-name="ContactMechPurposeType">
            <key-map field-name="contactMechPurposeTypeId"/>
        </relation>
        <relation type="one" fk-name="FACIL_CMPRP_FACIL" rel-entity-name="Facility">
            <key-map field-name="facilityId"/>
        </relation>
        <relation type="one" fk-name="FACIL_CMPRP_CMECH" rel-entity-name="ContactMech">
            <key-map field-name="contactMechId"/>
        </relation>
    </entity>
    <!-- SCIPIO: 2018-10-30: New -->
    <view-entity entity-name="FacilityContactMechAndPurpose" package-name="org.ofbiz.product.facility" title="Facility Contact Mech and Purpose View">
        <member-entity entity-alias="FCM" entity-name="FacilityContactMech"/>
        <member-entity entity-alias="FCMP" entity-name="FacilityContactMechPurpose"/>
        <alias-all entity-alias="FCM">
            <exclude field="fromDate"/>
            <exclude field="thruDate"/>
        </alias-all>
        <alias-all entity-alias="FCMP">
            <exclude field="fromDate"/>
            <exclude field="thruDate"/>
        </alias-all>
        <alias entity-alias="FCM" name="contactFromDate" field="fromDate"/>
        <alias entity-alias="FCM" name="contactThruDate" field="thruDate"/>
        <alias entity-alias="FCMP" name="purposeFromDate" field="fromDate"/>
        <alias entity-alias="FCMP" name="purposeThruDate" field="thruDate"/>
        <view-link entity-alias="FCM" rel-entity-alias="FCMP">
            <key-map field-name="facilityId"/>
            <key-map field-name="contactMechId"/>
        </view-link>
        <relation type="one-nofk" rel-entity-name="FacilityContactMech">
            <key-map field-name="facilityId"/>
            <key-map field-name="contactMechId"/>
            <key-map field-name="fromDate"/>
        </relation>
        <relation type="one-nofk" rel-entity-name="ContactMech">
            <key-map field-name="contactMechId"/>
        </relation>
    </view-entity>
    <!-- SCIPIO: 2018-02-01: Joins Facility's PostalAddress and FacilityContactMechPurposes -->
    <view-entity entity-name="FacilityPostalAddressAndPurpose"
        package-name="org.ofbiz.product.facility"
        title="FacilityContactMech And ContactMech And PostalAddress And FacilityContactMechPurpose">
        <member-entity entity-alias="FTCT" entity-name="FacilityContactMech"/>
        <member-entity entity-alias="FTCTP" entity-name="FacilityContactMechPurpose"/>
        <member-entity entity-alias="CT" entity-name="ContactMech"/>
        <member-entity entity-alias="PTA" entity-name="PostalAddress"/>
        <alias-all entity-alias="FTCT"/>
        <alias-all entity-alias="CT"/>
        <alias-all entity-alias="PTA"/>
        <alias-all entity-alias="FTCTP">
            <exclude field="fromDate"/>
            <exclude field="thruDate"/>
        </alias-all>
        <alias entity-alias="FTCTP" name="puFromDate" field="fromDate"/>
        <alias entity-alias="FTCTP" name="puThruDate" field="thruDate"/>
        <view-link entity-alias="FTCT" rel-entity-alias="FTCTP">
          <key-map field-name="facilityId"/>
          <key-map field-name="contactMechId"/>
        </view-link>
        <view-link entity-alias="FTCT" rel-entity-alias="CT">
          <key-map field-name="contactMechId"/>
        </view-link>
        <view-link entity-alias="CT" rel-entity-alias="PTA">
          <key-map field-name="contactMechId"/>
        </view-link>
    </view-entity>
    <entity entity-name="FacilityGroup" package-name="org.ofbiz.product.facility" title="Facility Group">
        <field name="facilityGroupId" type="id-ne"></field>
        <field name="facilityGroupTypeId" type="id"></field>
        <field name="primaryParentGroupId" type="id"></field>
        <field name="facilityGroupName" type="name"></field>
        <field name="description" type="description"></field>
        <prim-key field="facilityGroupId"/>
        <relation type="one" fk-name="FACILITY_GP_TYPE" rel-entity-name="FacilityGroupType">
            <key-map field-name="facilityGroupTypeId"/>
        </relation>
        <relation type="one" fk-name="FACILITY_GP_PGRP" title="PrimaryParent" rel-entity-name="FacilityGroup">
            <key-map field-name="primaryParentGroupId" rel-field-name="facilityGroupId"/>
        </relation>
    </entity>
    <entity entity-name="FacilityGroupMember" package-name="org.ofbiz.product.facility" title="Facility Group">
        <field name="facilityId" type="id-ne"></field>
        <field name="facilityGroupId" type="id-ne"></field>
        <field name="fromDate" type="date-time"></field>
        <field name="thruDate" type="date-time"></field>
        <field name="sequenceNum" type="numeric"></field>
        <prim-key field="facilityId"/>
        <prim-key field="facilityGroupId"/>
        <prim-key field="fromDate"/>
        <relation type="one" fk-name="FACILITY_MEM_FAC" rel-entity-name="Facility">
            <key-map field-name="facilityId"/>
        </relation>
        <relation type="one" fk-name="FACILITY_MEM_FGRP" rel-entity-name="FacilityGroup">
            <key-map field-name="facilityGroupId"/>
        </relation>
    </entity>
    <entity entity-name="FacilityGroupRole" package-name="org.ofbiz.product.facility" title="Facility Group Role">
        <field name="facilityGroupId" type="id-ne"></field>
        <field name="partyId" type="id"></field>
        <field name="roleTypeId" type="id"></field>
        <prim-key field="facilityGroupId"/>
        <prim-key field="partyId"/>
        <prim-key field="roleTypeId"/>
        <relation type="one" fk-name="FGROUP_RLE_FGRP" rel-entity-name="FacilityGroup">
            <key-map field-name="facilityGroupId"/>
        </relation>
        <relation type="one" fk-name="FGROUP_RLE_PTRLE" rel-entity-name="PartyRole">
            <key-map field-name="partyId"/>
            <key-map field-name="roleTypeId"/>
        </relation>
        <relation type="one-nofk" rel-entity-name="Party">
            <key-map field-name="partyId"/>
        </relation>
        <relation type="one-nofk" rel-entity-name="RoleType">
            <key-map field-name="roleTypeId"/>
        </relation>
    </entity>
    <entity entity-name="FacilityGroupRollup" package-name="org.ofbiz.product.facility" title="Facility Group Rollup">
        <field name="facilityGroupId" type="id-ne"></field>
        <field name="parentFacilityGroupId" type="id-ne"></field>
        <field name="fromDate" type="date-time"></field>
        <field name="thruDate" type="date-time"></field>
        <field name="sequenceNum" type="numeric"></field>
        <prim-key field="facilityGroupId"/>
        <prim-key field="parentFacilityGroupId"/>
        <prim-key field="fromDate"/>
        <relation type="one" fk-name="FGRP_FRLP_CURRENT" title="Current" rel-entity-name="FacilityGroup">
            <key-map field-name="facilityGroupId"/>
        </relation>
        <relation type="one" fk-name="FGRP_FRLP_PARENT" title="Parent" rel-entity-name="FacilityGroup">
            <key-map field-name="parentFacilityGroupId" rel-field-name="facilityGroupId"/>
        </relation>
        <relation type="many" title="Child" rel-entity-name="FacilityGroupRollup">
            <key-map field-name="facilityGroupId" rel-field-name="parentFacilityGroupId"/>
        </relation>
        <relation type="many" title="Parent" rel-entity-name="FacilityGroupRollup">
            <key-map field-name="parentFacilityGroupId" rel-field-name="facilityGroupId"/>
        </relation>
        <relation type="many" title="Sibling" rel-entity-name="FacilityGroupRollup">
            <key-map field-name="parentFacilityGroupId"/>
        </relation>
    </entity>
    <entity entity-name="FacilityGroupType" package-name="org.ofbiz.product.facility" title="Facility Group Type"
        default-resource-name="ProductEntityLabels">
        <field name="facilityGroupTypeId" type="id-ne"></field>
        <field name="description" type="description"></field>
        <prim-key field="facilityGroupTypeId"/>
    </entity>
    <entity entity-name="FacilityLocation" package-name="org.ofbiz.product.facility" title="Facility Location">
        <field name="facilityId" type="id-ne"></field>
        <field name="locationSeqId" type="id-ne"></field>
        <field name="locationTypeEnumId" type="id-ne"></field>
        <field name="areaId" type="id"></field>
        <field name="aisleId" type="id"></field>
        <field name="sectionId" type="id"></field>
        <field name="levelId" type="id"></field>
        <field name="positionId" type="id"></field>
        <field name="geoPointId" type="id"></field>      
        <prim-key field="facilityId"/>
        <prim-key field="locationSeqId"/>
        <relation type="one" fk-name="FACILITY_LOC_FAC" rel-entity-name="Facility">
            <key-map field-name="facilityId"/>
        </relation>
        <relation type="one" fk-name="FACILITY_LOC_TENM" title="Type" rel-entity-name="Enumeration">
            <key-map field-name="locationTypeEnumId" rel-field-name="enumId"/>
        </relation>
      <relation type="one" fk-name="FACILITY_LOC_GEOPT" rel-entity-name="GeoPoint">
        <key-map field-name="geoPointId"/>
      </relation>      
    </entity>
    <entity entity-name="FacilityLocationGeoPoint" package-name="org.ofbiz.product.facility" title="Facility Location Geo Location with history">
        <field name="facilityId" type="id-ne"></field>
        <field name="locationSeqId" type="id-ne"></field>
        <field name="geoPointId" type="id-ne"></field>
        <field name="fromDate" type="date-time"></field>
        <field name="thruDate" type="date-time"></field>
        <prim-key field="facilityId"/>
        <prim-key field="locationSeqId"/>
        <prim-key field="geoPointId"/>
        <prim-key field="fromDate"/>
        <relation type="one" fk-name="FACLOCGEOPT_FACLOC" rel-entity-name="FacilityLocation">
            <key-map field-name="facilityId"/>
            <key-map field-name="locationSeqId"/>
        </relation>
        <relation type="one" fk-name="FACLOCGEOPT_GEOPT" rel-entity-name="GeoPoint">
            <key-map field-name="geoPointId"/>
        </relation>
    </entity>
    <view-entity entity-name="FacilityLocationAndGeoPoint" package-name="org.ofbiz.product.facility"  title="Facility Location and Geo Point View">
      <member-entity entity-alias="FL" entity-name="FacilityLocation"/>
      <member-entity entity-alias="FLGPT" entity-name="FacilityLocationGeoPoint"/>
      <member-entity entity-alias="GPT" entity-name="GeoPoint"/>
      <alias-all entity-alias="GPT"/>
      <alias entity-alias="FL" name="facilityId"/>
      <alias entity-alias="FL" name="locationSeqId"/>
      <alias entity-alias="FLGPT" name="fromDate"/>
      <alias entity-alias="FLGPT" name="thruDate"/>
      <view-link entity-alias="FL" rel-entity-alias="FLGPT">
        <key-map field-name="facilityId"/>
        <key-map field-name="locationSeqId"/>
      </view-link>
      <view-link entity-alias="FLGPT" rel-entity-alias="GPT">
        <key-map field-name="geoPointId"/>
      </view-link>
      <relation type="many" rel-entity-name="FacilityLocationGeoPoint">
        <key-map field-name="facilityId"/>
        <key-map field-name="locationSeqId"/>
        <key-map field-name="geoPointId"/>
      </relation>
      <relation type="one-nofk" rel-entity-name="FacilityLocation">
        <key-map field-name="facilityId"/>
        <key-map field-name="locationSeqId"/>
      </relation>
      <relation type="one-nofk" rel-entity-name="GeoPoint">
        <key-map field-name="geoPointId"/>
      </relation>
    </view-entity>
    <entity entity-name="FacilityParty" package-name="org.ofbiz.product.facility" title="Facility Party">
        <field name="facilityId" type="id"></field>
        <field name="partyId" type="id"></field>
        <field name="roleTypeId" type="id"></field>
        <field name="fromDate" type="date-time"></field>
        <field name="thruDate" type="date-time"></field>
        <prim-key field="facilityId"/>
        <prim-key field="partyId"/>
        <prim-key field="roleTypeId"/>
        <prim-key field="fromDate"/>
        <relation type="one" fk-name="FACILITY_RLE_FACI" rel-entity-name="Facility">
            <key-map field-name="facilityId"/>
        </relation>
        <relation type="one" fk-name="FACILITY_RLE_PRT" rel-entity-name="Party">
            <key-map field-name="partyId"/>
        </relation>
        <relation type="one" fk-name="FACILITY_RLE_ROL" rel-entity-name="RoleType">
            <key-map field-name="roleTypeId"/>
        </relation>
        <relation type="one" fk-name="FACILITY_PRTY_ROLE" rel-entity-name="PartyRole">
            <key-map field-name="partyId"/>
            <key-map field-name="roleTypeId"/>
        </relation>
    </entity>
    <entity entity-name="FacilityContent" package-name="org.ofbiz.product.facility" title="Facility Content">
        <field name="facilityId" type="id-ne"></field>
        <field name="contentId" type="id-ne"></field>
        <field name="fromDate" type="date-time"></field>
        <field name="thruDate" type="date-time"></field>
        <prim-key field="facilityId"/>
        <prim-key field="contentId"/>
        <prim-key field="fromDate"/>
        <relation type="one" fk-name="FAC_CNT_FAC" rel-entity-name="Facility">
            <key-map field-name="facilityId"/>
        </relation>
        <relation type="one" fk-name="FAC_CNT_CNT" rel-entity-name="Content">
            <key-map field-name="contentId"/>
        </relation>
    </entity>      
    <view-entity entity-name="FacilityContentDetail" package-name="org.ofbiz.product.facility" title="Facility Content Detail View">
        <member-entity entity-alias="FCT" entity-name="FacilityContent"/>
        <member-entity entity-alias="CNT" entity-name="Content"/>
        <alias-all entity-alias="FCT"/>
        <alias-all entity-alias="CNT"/>
        <view-link entity-alias="FCT" rel-entity-alias="CNT">
            <key-map field-name="contentId"/>
        </view-link>
        <relation type="one-nofk" rel-entity-name="DataResource">
            <key-map field-name="dataResourceId"/>
        </relation>
        <relation type="one-nofk" rel-entity-name="ContentType">
            <key-map field-name="contentTypeId"/>
        </relation>
    </view-entity>
    <entity entity-name="FacilityType" package-name="org.ofbiz.product.facility" default-resource-name="ProductEntityLabels"
        title="Facility Type">
        <field name="facilityTypeId" type="id-ne"></field>
        <field name="parentTypeId" type="id-ne"></field>
        <field name="hasTable" type="indicator"></field>
        <field name="description" type="description"></field>
        <prim-key field="facilityTypeId"/>
        <relation type="one" fk-name="FACILITY_TYPEPAR" title="Parent" rel-entity-name="FacilityType">
            <key-map field-name="parentTypeId" rel-field-name="facilityTypeId"/>
        </relation>
    </entity>
    <entity entity-name="FacilityTypeAttr" package-name="org.ofbiz.product.facility" title="Facility Type Attribute">
        <field name="facilityTypeId" type="id-ne"></field>
        <field name="attrName" type="id-long-ne"></field>
        <field name="description" type="description"></field>
        <prim-key field="facilityTypeId"/>
        <prim-key field="attrName"/>
        <relation type="one" fk-name="FACILITY_TPAT_FT" rel-entity-name="FacilityType">
            <key-map field-name="facilityTypeId"/>
        </relation>
        <relation type="many" rel-entity-name="FacilityAttribute">
            <key-map field-name="attrName"/>
        </relation>
        <relation type="many" rel-entity-name="Facility">
            <key-map field-name="facilityTypeId"/>
        </relation>
    </entity>
    <entity entity-name="ProductFacility" package-name="org.ofbiz.product.facility" title="Product Facility">
        <field name="productId" type="id-ne"></field>
        <field name="facilityId" type="id-ne"></field>
        <field name="minimumStock" type="fixed-point"></field>
        <field name="reorderQuantity" type="fixed-point"></field>
        <field name="daysToShip" type="numeric"></field>
        <field name="lastInventoryCount" type="fixed-point"><description>This field represents availableToPromiseTotal of a product at a certain point of time and is being updated regularly by a schedule service every hour (or ECA)</description></field>
        <field name="lastInventoryCountQoh" type="fixed-point"><description>This field represents quantityOnHandTotal of a product at a certain point of time and is being updated regularly by a schedule service every hour (or ECA) (SCIPIO)</description></field>
        <field name="updatesSinceLastCount" type="numeric"><description>Number of setLastInventoryCount calls below recount threshold left to trigger another recalc - see inventory.properties#inventory.cache.recountThreshold (SCIPIO)</description></field>
        <field name="lastInvStamp" type="date-time"><description>Last time lastInventoryCount is updated (SCIPIO)</description></field>
        <field name="lastInvMode" type="id"><description>Last way that lastInventoryCount updated: AUTO (DEFAULT), SCHEDULED, MANUAL (SCIPIO)</description></field>
        <field name="lastInvModeCount" type="numeric"><description>Number of times lastInventoryCount has been updated using the value in lastInvMode, resets anytime mode changes (SCIPIO)</description></field>
        <prim-key field="productId"/>
        <prim-key field="facilityId"/>
        <relation type="one" fk-name="PROD_FAC_PROD" rel-entity-name="Product">
            <key-map field-name="productId"/>
        </relation>
        <relation type="one" fk-name="PROD_FAC_FAC" rel-entity-name="Facility">
            <key-map field-name="facilityId"/>
        </relation>
    </entity>
  <view-entity entity-name="ProductFacilityAndPostalAddress"
        package-name="org.ofbiz.product.facility"
        title="Product Facility And Contactmech And Postal Address View Entity, to be able to list products by geographic location">
    <member-entity entity-alias="PDFT" entity-name="ProductFacility"/>
    <member-entity entity-alias="FTCT" entity-name="FacilityContactMech"/>
    <member-entity entity-alias="CT" entity-name="ContactMech"/>
    <member-entity entity-alias="PTA" entity-name="PostalAddress"/>
    <alias-all entity-alias="PDFT"/>
    <alias-all entity-alias="FTCT"/>
    <alias-all entity-alias="CT"/>
    <alias-all entity-alias="PTA"/>
    <view-link entity-alias="PDFT" rel-entity-alias="FTCT">
      <key-map field-name="facilityId"/>
    </view-link>
    <view-link entity-alias="FTCT" rel-entity-alias="CT">
      <key-map field-name="contactMechId"/>
    </view-link>
    <view-link entity-alias="CT" rel-entity-alias="PTA">
      <key-map field-name="contactMechId"/>
    </view-link>
  </view-entity>
    <entity entity-name="ProductFacilityLocation" package-name="org.ofbiz.product.facility" title="Product Facility">
        <field name="productId" type="id-ne"></field>
        <field name="facilityId" type="id-ne"></field>
        <field name="locationSeqId" type="id-ne"></field>
        <field name="minimumStock" type="fixed-point"></field>
        <field name="moveQuantity" type="fixed-point"></field>
        <prim-key field="productId"/>
        <prim-key field="facilityId"/>
        <prim-key field="locationSeqId"/>
        <relation type="one" fk-name="PROD_FCL_PROD" rel-entity-name="Product">
            <key-map field-name="productId"/>
        </relation>
        <relation type="one-nofk" rel-entity-name="Facility">
            <key-map field-name="facilityId"/>
        </relation>
        <relation type="one" fk-name="PROD_FCL_FCL" rel-entity-name="FacilityLocation">
            <key-map field-name="facilityId"/>
            <key-map field-name="locationSeqId"/>
        </relation>
    </entity>
    <view-entity entity-name="ProductFacilityLocationQuantityTest" package-name="org.ofbiz.product.facility" title="ProductFacilityLocation Quantity Test View">
        <member-entity entity-alias="PFL" entity-name="ProductFacilityLocation"/>
        <member-entity entity-alias="FL" entity-name="FacilityLocation"/>
        <member-entity entity-alias="II" entity-name="InventoryItem"/>
        <alias entity-alias="PFL" name="productId" group-by="true"/>
        <alias entity-alias="PFL" name="facilityId" group-by="true"/>
        <alias entity-alias="PFL" name="locationSeqId" group-by="true"/>
        <alias entity-alias="PFL" name="minimumStock" group-by="true"/>
        <alias entity-alias="PFL" name="moveQuantity" group-by="true"/>
        <alias entity-alias="FL" name="locationTypeEnumId" group-by="true"/>
        <alias entity-alias="II" name="availableToPromiseTotal" function="sum"/>
        <alias entity-alias="II" name="quantityOnHandTotal" function="sum"/>
        <view-link entity-alias="PFL" rel-entity-alias="FL">
            <key-map field-name="facilityId"/>
            <key-map field-name="locationSeqId"/>
        </view-link>
        <view-link entity-alias="PFL" rel-entity-alias="II">
            <key-map field-name="productId"/>
            <key-map field-name="facilityId"/>
            <key-map field-name="locationSeqId"/>
        </view-link>
        <relation type="one-nofk" rel-entity-name="Product">
            <key-map field-name="productId"/>
        </relation>
        <relation type="one-nofk" rel-entity-name="FacilityLocation">
            <key-map field-name="facilityId"/>
            <key-map field-name="locationSeqId"/>
        </relation>
        <relation type="one-nofk" rel-entity-name="ProductFacilityLocation">
            <key-map field-name="productId"/>
            <key-map field-name="facilityId"/>
            <key-map field-name="locationSeqId"/>
        </relation>
    </view-entity>
    <view-entity entity-name="ProductFacilityLocationView" package-name="org.ofbiz.product.facility" title="ProductFacilityLocation And FacilityLocation View">
        <member-entity entity-alias="PFL" entity-name="ProductFacilityLocation"/>
        <member-entity entity-alias="FL" entity-name="FacilityLocation"/>
        <alias-all entity-alias="PFL"/>
        <alias-all entity-alias="FL"/>
        <view-link entity-alias="PFL" rel-entity-alias="FL">
            <key-map field-name="facilityId"/>
            <key-map field-name="locationSeqId"/>
        </view-link>
        <relation type="one-nofk" rel-entity-name="FacilityLocation">
            <key-map field-name="facilityId"/>
            <key-map field-name="locationSeqId"/>
        </relation>
        <relation type="one-nofk" rel-entity-name="ProductFacilityLocation">
            <key-map field-name="productId"/>
            <key-map field-name="facilityId"/>
            <key-map field-name="locationSeqId"/>
        </relation>
        <relation type="many" rel-entity-name="InventoryItem">
            <key-map field-name="productId"/>
            <key-map field-name="facilityId"/>
            <key-map field-name="locationSeqId"/>
        </relation>
    </view-entity>

    <!-- ========================================================= -->
    <!-- org.ofbiz.product.feature -->
    <!-- ========================================================= -->

    <entity entity-name="ProductFeature"
            package-name="org.ofbiz.product.feature"
            default-resource-name="ProductEntityLabels"
            title="Product Feature">
      <field name="productFeatureId" type="id-ne"></field>
      <field name="productFeatureTypeId" type="id-ne"></field>
      <field name="productFeatureCategoryId" type="id"></field>
      <field name="description" type="description"></field>
      <field name="uomId" type="id"></field>
      <field name="numberSpecified" type="fixed-point"></field>
      <field name="defaultAmount" type="currency-amount"></field>
      <field name="defaultSequenceNum" type="numeric"></field>
      <field name="abbrev" type="id"></field>
      <field name="idCode" type="id-long"></field>
      <prim-key field="productFeatureId"/>
      <relation type="one" fk-name="PROD_FEAT_CATEGORY" rel-entity-name="ProductFeatureCategory">
        <key-map field-name="productFeatureCategoryId"/>
      </relation>
      <relation type="one" fk-name="PROD_FEAT_TYPE" rel-entity-name="ProductFeatureType">
        <key-map field-name="productFeatureTypeId"/>
      </relation>
      <relation type="one" fk-name="PROD_FEAT_UOM" rel-entity-name="Uom">
          <key-map field-name="uomId"/>
      </relation>
    </entity>
    <view-entity entity-name="ProductFeatureAndAppl"
            package-name="org.ofbiz.product.feature"
            title="ProductFeature And ProductFeatureAppl View">
      <member-entity entity-alias="PF" entity-name="ProductFeature"/>
      <member-entity entity-alias="PFA" entity-name="ProductFeatureAppl"/>
      <alias entity-alias="PF" name="productFeatureId"/>
      <alias entity-alias="PF" name="productFeatureTypeId"/>
      <alias entity-alias="PF" name="productFeatureCategoryId"/>
      <alias entity-alias="PF" name="description"/>
      <alias entity-alias="PF" name="uomId"/>
      <alias entity-alias="PF" name="numberSpecified"/>
      <alias entity-alias="PF" name="defaultAmount"/>
      <alias entity-alias="PF" name="defaultSequenceNum"/>
      <alias entity-alias="PF" name="abbrev"/>
      <alias entity-alias="PF" name="idCode"/>
      <alias entity-alias="PFA" name="productId"/>
      <alias entity-alias="PFA" name="productFeatureApplTypeId"/>
      <alias entity-alias="PFA" name="fromDate"/>
      <alias entity-alias="PFA" name="thruDate"/>
      <alias entity-alias="PFA" name="sequenceNum"/>
      <alias entity-alias="PFA" name="amount"/>
      <alias entity-alias="PFA" name="recurringAmount"/>
      <view-link entity-alias="PF" rel-entity-alias="PFA">
        <key-map field-name="productFeatureId"/>
      </view-link>
      <relation type="one-nofk" rel-entity-name="ProductFeature">
        <key-map field-name="productFeatureId"/>
      </relation>
      <relation type="one-nofk" rel-entity-name="ProductFeatureAppl">
        <key-map field-name="productId"/>
        <key-map field-name="productFeatureId"/>
        <key-map field-name="fromDate"/>
      </relation>
      <relation type="one-nofk" rel-entity-name="ProductFeatureType">
        <key-map field-name="productFeatureTypeId"/>
      </relation>
      <relation type="one-nofk" rel-entity-name="ProductFeatureApplType">
        <key-map field-name="productFeatureApplTypeId"/>
      </relation>
      <relation type="one-nofk" rel-entity-name="ProductFeatureCategory">
        <key-map field-name="productFeatureCategoryId"/>
      </relation>
      <relation type="many" rel-entity-name="SupplierProductFeature">
        <key-map field-name="productFeatureId"/>
      </relation>
    </view-entity>
    <entity entity-name="ProductFeatureAppl"
            package-name="org.ofbiz.product.feature"
            title="Product Feature Applicability">
      <field name="productId" type="id-ne"></field>
      <field name="productFeatureId" type="id-ne"></field>
      <field name="productFeatureApplTypeId" type="id"></field>
      <field name="fromDate" type="date-time"></field>
      <field name="thruDate" type="date-time"></field>
      <field name="sequenceNum" type="numeric"></field>
      <field name="amount" type="currency-amount"></field>
      <field name="recurringAmount" type="currency-amount"></field>
      <prim-key field="productId"/>
      <prim-key field="productFeatureId"/>
      <prim-key field="fromDate"/>
      <relation type="one" fk-name="PROD_FAPPL_TYPE" rel-entity-name="ProductFeatureApplType">
        <key-map field-name="productFeatureApplTypeId"/>
      </relation>
      <relation type="one" fk-name="PROD_FAPPL_PRODUCT" rel-entity-name="Product">
        <key-map field-name="productId"/>
      </relation>
      <relation type="one" fk-name="PROD_FAPPL_FEATURE" rel-entity-name="ProductFeature">
        <key-map field-name="productFeatureId"/>
      </relation>
    </entity>
    <entity entity-name="ProductFeatureApplType"
            package-name="org.ofbiz.product.feature"
            default-resource-name="ProductEntityLabels"
            title="Product Feature Applicability Type">
      <field name="productFeatureApplTypeId" type="id-ne"></field>
      <field name="parentTypeId" type="id"></field>
      <field name="hasTable" type="indicator"></field>
      <field name="description" type="description"></field>
      <prim-key field="productFeatureApplTypeId"/>
      <relation type="one" fk-name="PROD_FAPPL_TYPPAR" title="Parent" rel-entity-name="ProductFeatureApplType">
        <key-map field-name="parentTypeId" rel-field-name="productFeatureApplTypeId"/>
      </relation>
    </entity>
    <entity entity-name="ProductFeatureApplAttr"
            package-name="org.ofbiz.product.feature"
            title="Product Feature Applicability Attribute">
      <field name="productId" type="id-ne"></field>
      <field name="productFeatureId" type="id-ne"></field>
      <field name="fromDate" type="date-time"></field>
      <field name="attrName" type="id-long-ne"></field>
      <field name="attrValue" type="value"></field>
      <prim-key field="productId"/>
      <prim-key field="productFeatureId"/>
      <prim-key field="fromDate"/>
      <prim-key field="attrName"/>
      <relation type="one" fk-name="PROD_FAPPA_PRODUCT" rel-entity-name="Product">
        <key-map field-name="productId"/>
      </relation>
      <relation type="one" fk-name="PROD_FAPPA_FEATURE" rel-entity-name="ProductFeature">
        <key-map field-name="productFeatureId"/>
      </relation>
      <relation type="one" fk-name="PROD_FAPPA_FEATAPP" rel-entity-name="ProductFeatureAppl">
        <key-map field-name="productId"/>
        <key-map field-name="productFeatureId"/>
        <key-map field-name="fromDate"/>
      </relation>
    </entity>
    <entity entity-name="ProductFeatureCategory"
            package-name="org.ofbiz.product.feature"
            default-resource-name="ProductEntityLabels"
            title="Product Feature Category">
      <field name="productFeatureCategoryId" type="id-ne"></field>
      <field name="parentCategoryId" type="id"></field>
      <field name="description" type="description"></field>
      <prim-key field="productFeatureCategoryId"/>
      <relation type="one" fk-name="PROD_FEAT_CAT_PAR" title="Parent" rel-entity-name="ProductFeatureCategory">
        <key-map field-name="parentCategoryId" rel-field-name="productFeatureCategoryId"/>
      </relation>
    </entity>
    <entity entity-name="ProductFeatureCategoryAppl"
            package-name="org.ofbiz.product.feature"
            title="Product Feature Category Application">
      <field name="productCategoryId" type="id-ne"></field>
      <field name="productFeatureCategoryId" type="id-ne"></field>
      <field name="fromDate" type="date-time"></field>
      <field name="thruDate" type="date-time"></field>
      <prim-key field="productCategoryId"/>
      <prim-key field="productFeatureCategoryId"/>
      <prim-key field="fromDate"/>
      <relation type="one" fk-name="PROD_FCAPPL_CAT" rel-entity-name="ProductCategory">
        <key-map field-name="productCategoryId"/>
      </relation>
      <relation type="one" fk-name="PROD_FCAPPL_FCAT" rel-entity-name="ProductFeatureCategory">
        <key-map field-name="productFeatureCategoryId"/>
      </relation>
    </entity>
    <entity entity-name="ProductFeatureCatGrpAppl"
            package-name="org.ofbiz.product.feature"
            title="Product Category Feature Group Application">
      <field name="productCategoryId" type="id-ne"></field>
      <field name="productFeatureGroupId" type="id-ne"></field>
      <field name="fromDate" type="date-time"></field>
      <field name="thruDate" type="date-time"></field>
      <prim-key field="productCategoryId"/>
      <prim-key field="productFeatureGroupId"/>
      <prim-key field="fromDate"/>
      <relation type="one" fk-name="PROD_FCGAPL_CAT" rel-entity-name="ProductCategory">
        <key-map field-name="productCategoryId"/>
      </relation>
      <relation type="one" fk-name="PROD_FCGAPL_FGRP" rel-entity-name="ProductFeatureGroup">
        <key-map field-name="productFeatureGroupId"/>
      </relation>
    </entity>
    <entity entity-name="ProductFeatureDataResource"
            package-name="org.ofbiz.product.feature"
            title="Product Feature Data Resource">
      <field name="dataResourceId" type="id-ne"></field>
      <field name="productFeatureId" type="id-ne"></field>
      <prim-key field="dataResourceId"/>
      <prim-key field="productFeatureId"/>
      <relation type="one" fk-name="PFEAT_DR_DATRES" rel-entity-name="DataResource">
        <key-map field-name="dataResourceId"/>
      </relation>
      <relation type="one" fk-name="PFEAT_DR_FEATURE" rel-entity-name="ProductFeature">
        <key-map field-name="productFeatureId"/>
      </relation>
    </entity>
    <entity entity-name="ProductFeatureGroup"
            package-name="org.ofbiz.product.feature"
            title="Product Feature Group">
      <field name="productFeatureGroupId" type="id-ne"></field>
      <field name="description" type="description"></field>
      <prim-key field="productFeatureGroupId"/>
    </entity>
    <view-entity entity-name="ProductFeatureGroupAndAppl"
            package-name="org.ofbiz.product.feature"
            title="Product Feature Group And Applicability View">
      <member-entity entity-alias="PFGA" entity-name="ProductFeatureGroupAppl"/>
      <member-entity entity-alias="PF" entity-name="ProductFeature"/>
      <alias-all entity-alias="PFGA"/>
      <alias-all entity-alias="PF"/>
      <view-link entity-alias="PFGA" rel-entity-alias="PF">
        <key-map field-name="productFeatureId"/>
      </view-link>
    </view-entity>
    <view-entity entity-name="ProdFeaGrpAppAndProdFeaApp"
            package-name="org.ofbiz.product.feature"
            title="ProductFeatureGroupAppl And ProductFeatureAppl View">
      <member-entity entity-alias="PFGA" entity-name="ProductFeatureGroupAppl"/>
      <member-entity entity-alias="PFA" entity-name="ProductFeatureAppl"/>
      <alias entity-alias="PFGA" name="productFeatureGroupId"/>
      <alias entity-alias="PFGA" name="productFeatureId"/>
      <alias entity-alias="PFA" name="groupFromDate" field="fromDate"/>
      <alias entity-alias="PFA" name="groupThruDate" field="thruDate"/>
      <alias entity-alias="PFA" name="productId"/>
      <alias entity-alias="PFA" name="productFeatureApplTypeId"/>
      <alias entity-alias="PFA" name="fromDate"/>
      <alias entity-alias="PFA" name="thruDate"/>
      <alias entity-alias="PFA" name="sequenceNum"/>
      <alias entity-alias="PFA" name="amount"/>
      <alias entity-alias="PFA" name="recurringAmount"/>
      <view-link entity-alias="PFGA" rel-entity-alias="PFA">
        <key-map field-name="productFeatureId"/>
      </view-link>
    </view-entity>
    <entity entity-name="ProductFeatureGroupAppl"
            package-name="org.ofbiz.product.feature"
            title="Product Feature Group Applicability">
      <field name="productFeatureGroupId" type="id-ne"></field>
      <field name="productFeatureId" type="id-ne"></field>
      <field name="fromDate" type="date-time"></field>
      <field name="thruDate" type="date-time"></field>
      <field name="sequenceNum" type="numeric"></field>
      <prim-key field="productFeatureGroupId"/>
      <prim-key field="productFeatureId"/>
      <prim-key field="fromDate"/>
      <relation type="one" fk-name="PROD_FGAPP_PRODUCT" rel-entity-name="ProductFeatureGroup">
        <key-map field-name="productFeatureGroupId"/>
      </relation>
      <relation type="one" fk-name="PROD_FGAPP_FEATURE" rel-entity-name="ProductFeature">
        <key-map field-name="productFeatureId"/>
      </relation>
    </entity>
    <entity entity-name="ProductFeatureIactn"
            package-name="org.ofbiz.product.feature"
            title="Product Feature Interaction">
      <field name="productFeatureId" type="id-ne"></field>
      <field name="productFeatureIdTo" type="id-ne"></field>
      <field name="productFeatureIactnTypeId" type="id"></field>
      <field name="productId" type="id"></field>
      <prim-key field="productFeatureId"/>
      <prim-key field="productFeatureIdTo"/>
      <relation type="one" fk-name="PROD_FICTN_TYPE" rel-entity-name="ProductFeatureIactnType">
        <key-map field-name="productFeatureIactnTypeId"/>
      </relation>
      <relation type="one" fk-name="PROD_FICTN_MFEAT" title="Main" rel-entity-name="ProductFeature">
        <key-map field-name="productFeatureId"/>
      </relation>
      <relation type="one" fk-name="PROD_FICTN_AFEAT" title="Assoc" rel-entity-name="ProductFeature">
        <key-map field-name="productFeatureIdTo" rel-field-name="productFeatureId"/>
      </relation>
    </entity>
    <entity entity-name="ProductFeatureIactnType"
            package-name="org.ofbiz.product.feature"
            title="Product Feature Interaction Type">
      <field name="productFeatureIactnTypeId" type="id-ne"></field>
      <field name="parentTypeId" type="id"></field>
      <field name="hasTable" type="indicator"></field>
      <field name="description" type="description"></field>
      <prim-key field="productFeatureIactnTypeId"/>
      <relation type="one" fk-name="PROD_FICTN_TYPPAR" title="Parent" rel-entity-name="ProductFeatureIactnType">
        <key-map field-name="parentTypeId" rel-field-name="productFeatureIactnTypeId"/>
      </relation>
    </entity>
    <entity entity-name="ProductFeatureType"
            package-name="org.ofbiz.product.feature"
            default-resource-name="ProductEntityLabels"
            title="Product Feature Type">
      <field name="productFeatureTypeId" type="id-ne"></field>
      <field name="parentTypeId" type="id"></field>
      <field name="hasTable" type="indicator"></field>
      <field name="description" type="description"></field>
      <prim-key field="productFeatureTypeId"/>
      <relation type="one" fk-name="PROD_FEAT_TYPPAR" title="Parent" rel-entity-name="ProductFeatureType">
        <key-map field-name="parentTypeId" rel-field-name="productFeatureTypeId"/>
      </relation>
    </entity>

  <entity entity-name="ProductFeaturePrice"
    package-name="org.ofbiz.product.price"
    title="Product Feature Price">
    <field name="productFeatureId" type="id-ne"></field>
    <field name="productPriceTypeId" type="id-ne"></field>
    <field name="currencyUomId" type="id"></field>
    <field name="fromDate" type="date-time"></field>
    <field name="thruDate" type="date-time"></field>
    <field name="price" type="currency-precise"></field>
    <field name="createdDate" type="date-time"></field>
    <field name="createdByUserLogin" type="id-vlong"></field>
    <field name="lastModifiedDate" type="date-time"></field>
    <field name="lastModifiedByUserLogin" type="id-vlong"></field>
    <prim-key field="productFeatureId"/>
    <prim-key field="productPriceTypeId"/>
    <prim-key field="currencyUomId"/>
    <prim-key field="fromDate"/>
    <relation type="one" fk-name="PROD_F_PRICE_TYPE" rel-entity-name="ProductPriceType">
      <key-map field-name="productPriceTypeId"/>
    </relation>
    <relation type="one" fk-name="PROD_F_PRICE_CUOM" title="Currency" rel-entity-name="Uom">
      <key-map field-name="currencyUomId" rel-field-name="uomId"/>
    </relation>
   <relation type="one" fk-name="PROD_F_PRICE_CBUL" title="CreatedBy" rel-entity-name="UserLogin">
      <key-map field-name="createdByUserLogin" rel-field-name="userLoginId"/>
    </relation>
    <relation type="one" fk-name="PROD_F_PRICE_LMBUL" title="LastModifiedBy" rel-entity-name="UserLogin">
      <key-map field-name="lastModifiedByUserLogin" rel-field-name="userLoginId"/>
    </relation>
    <index name="PRD_FT_PRC_GENLKP">
      <index-field name="productFeatureId"/>
      <index-field name="currencyUomId"/>
    </index>
  </entity>

  <!-- ========================================================= -->
  <!-- org.ofbiz.product.inventory -->
  <!-- ========================================================= -->

    <view-entity entity-name="BalanceInventoryItemsView"
            package-name="org.ofbiz.product.inventory"
            title="Balance Inventory Items View">
      <member-entity entity-alias="INV" entity-name="InventoryItem"/>
      <member-entity entity-alias="RES" entity-name="OrderItemShipGrpInvRes"/>
      <alias entity-alias="INV" name="inventoryItemId"/>
      <alias entity-alias="INV" name="productId"/>
      <alias entity-alias="INV" name="facilityId"/>
      <alias entity-alias="INV" name="inventoryItemTypeId"/>
      <alias entity-alias="INV" name="availableToPromiseTotal"/>
      <alias entity-alias="INV" name="quantityOnHandTotal"/>
      <alias entity-alias="RES" name="orderId"/>
      <alias entity-alias="RES" name="shipGroupSeqId"/>
      <alias entity-alias="RES" name="orderItemSeqId"/>
      <alias entity-alias="RES" name="quantity"/>
      <alias entity-alias="RES" name="quantityNotAvailable"/>
      <alias entity-alias="RES" name="reserveOrderEnumId"/>
      <alias entity-alias="RES" name="reservedDatetime"/>
      <alias entity-alias="RES" name="sequenceId"/>
      <view-link entity-alias="INV" rel-entity-alias="RES">
        <key-map field-name="inventoryItemId"/>
      </view-link>
    </view-entity>
    <entity entity-name="InventoryItem"
            package-name="org.ofbiz.product.inventory"
            title="Inventory Item">
      <field name="inventoryItemId" type="id-ne"></field>
      <field name="inventoryItemTypeId" type="id"></field>
      <field name="productId" type="id"></field>
      <field name="partyId" type="id"></field>
      <field name="ownerPartyId" type="id"><description>The owner of the inventory item.</description></field>
      <field name="statusId" type="id"></field>
      <field name="datetimeReceived" type="date-time"></field>
      <field name="datetimeManufactured" type="date-time"></field>
      <field name="expireDate" type="date-time"></field>
      <field name="facilityId" type="id"></field>
      <field name="containerId" type="id"></field>
      <field name="lotId" type="id"></field>
      <field name="uomId" type="id"></field>
      <field name="binNumber" type="id"></field>
      <field name="locationSeqId" type="id"></field>
      <field name="comments" type="comment"></field>
      <field name="quantityOnHandTotal" type="fixed-point"></field>
      <field name="availableToPromiseTotal" type="fixed-point"></field>
      <field name="accountingQuantityTotal" type="fixed-point"></field>
      <field name="oldQuantityOnHand" col-name="QUANTITY_ON_HAND" type="fixed-point"></field>
      <field name="oldAvailableToPromise" col-name="AVAILABLE_TO_PROMISE" type="fixed-point"></field>
      <field name="serialNumber" type="value"></field>
      <field name="softIdentifier" type="value"></field>
      <field name="activationNumber" type="value"></field>
      <field name="activationValidThru" type="date-time"></field>
      <field name="unitCost" type="fixed-point"><description>Higher precision in case it is a calculated number</description></field>
      <field name="currencyUomId" type="id"><description>The currency Uom of the unit cost.</description></field>
      <prim-key field="inventoryItemId"/>
      <relation type="one" fk-name="INV_ITEM_TYPE" rel-entity-name="InventoryItemType">
        <key-map field-name="inventoryItemTypeId"/>
      </relation>
      <relation type="many" rel-entity-name="InventoryItemTypeAttr">
        <key-map field-name="inventoryItemTypeId"/>
      </relation>
      <relation type="one" fk-name="INV_ITEM_PRODUCT" rel-entity-name="Product">
        <key-map field-name="productId"/>
      </relation>
      <relation type="one" fk-name="INV_ITEM_PARTY" rel-entity-name="Party">
        <key-map field-name="partyId"/>
      </relation>
      <relation type="one" fk-name="INV_ITEM_OWNPARTY" title="Owner" rel-entity-name="Party">
        <key-map field-name="ownerPartyId" rel-field-name="partyId"/>
      </relation>
      <relation type="one" fk-name="INV_ITEM_STTSITM" rel-entity-name="StatusItem">
        <key-map field-name="statusId"/>
      </relation>
      <relation type="one" fk-name="INV_ITEM_FACILITY" rel-entity-name="Facility">
        <key-map field-name="facilityId"/>
      </relation>
      <relation type="one" fk-name="INV_ITEM_CONTAINER" rel-entity-name="Container">
        <key-map field-name="containerId"/>
      </relation>
      <relation type="one" fk-name="INV_ITEM_LOT" rel-entity-name="Lot">
        <key-map field-name="lotId"/>
      </relation>
      <relation type="one-nofk" rel-entity-name="ProductFacility">
        <key-map field-name="productId"/>
        <key-map field-name="facilityId"/>
      </relation>
      <relation type="one-nofk" rel-entity-name="FacilityLocation">
        <key-map field-name="facilityId"/>
        <key-map field-name="locationSeqId"/>
      </relation>
      <relation type="one-nofk" rel-entity-name="ProductFacilityLocation">
        <key-map field-name="productId"/>
        <key-map field-name="facilityId"/>
        <key-map field-name="locationSeqId"/>
      </relation>
      <relation type="one" fk-name="INV_ITEM_UOM" rel-entity-name="Uom">
        <key-map field-name="uomId"/>
      </relation>
      <relation type="one" fk-name="INV_ITEM_CUOM" title="Currency" rel-entity-name="Uom">
        <key-map field-name="currencyUomId" rel-field-name="uomId"/>
      </relation>
      <index name="INVITEM_SOFID" unique="true">
        <index-field name="softIdentifier"/>
      </index>
      <index name="INVITEM_ACTNM" unique="true">
        <index-field name="activationNumber"/>
      </index>
      <index name="INV_ITEM_SN">
        <index-field name="serialNumber"/>
      </index>
        <!-- SCIPIO: Untested indices
        <index name="INV_DATE">
            <index-field name="datetimeReceived"/>
            <index-field name="inventoryItemId"/>
            <index-field name="productId"/>
            <index-field name="facilityId"/>
        </index>-->
    </entity>
    <view-entity entity-name="InventoryItemAndLocation"
            package-name="org.ofbiz.product.inventory"
            title="InventoryItem And FacilityLocation View">
      <member-entity entity-alias="II" entity-name="InventoryItem"/>
      <member-entity entity-alias="PR" entity-name="Product"/>
      <member-entity entity-alias="FL" entity-name="FacilityLocation"/>
      <alias-all entity-alias="II">
        <exclude field="comments"/>
      </alias-all>
      <alias-all entity-alias="PR">
        <exclude field="facilityId"/>
        <exclude field="inventoryItemTypeId"/>
      </alias-all>
      <alias-all entity-alias="FL"/>
      <view-link entity-alias="II" rel-entity-alias="FL" rel-optional="true">
        <key-map field-name="facilityId"/>
        <key-map field-name="locationSeqId"/>
      </view-link>
      <view-link entity-alias="II" rel-entity-alias="PR" rel-optional="true">
        <key-map field-name="productId"/>
      </view-link>
      <relation type="one-nofk" rel-entity-name="ProductFacilityLocation">
        <key-map field-name="productId"/>
        <key-map field-name="facilityId"/>
        <key-map field-name="locationSeqId"/>
      </relation>
      <relation type="one-nofk" rel-entity-name="FacilityLocation">
        <key-map field-name="facilityId"/>
        <key-map field-name="locationSeqId"/>
      </relation>
      <relation type="one-nofk" rel-entity-name="InventoryItem">
        <key-map field-name="inventoryItemId"/>
      </relation>
    </view-entity>
    <entity entity-name="InventoryItemAttribute"
            package-name="org.ofbiz.product.inventory"
            title="Inventory Item Attribute">
      <field name="inventoryItemId" type="id-ne"></field>
      <field name="attrName" type="id-long-ne"></field>
      <field name="attrValue" type="value"></field>
      <field name="attrDescription" type="description"></field>
      <prim-key field="inventoryItemId"/>
      <prim-key field="attrName"/>
      <relation type="one" fk-name="INV_ITEM_ATTR" rel-entity-name="InventoryItem">
        <key-map field-name="inventoryItemId"/>
      </relation>
      <relation type="many" rel-entity-name="InventoryItemTypeAttr">
        <key-map field-name="attrName"/>
      </relation>
    </entity>
    <view-entity entity-name="InventoryItemAndDetail" package-name="org.ofbiz.product.inventory">
        <member-entity entity-alias="II" entity-name="InventoryItem"/>
        <member-entity entity-alias="IID" entity-name="InventoryItemDetail"/>
        <alias-all entity-alias="IID"/>
        <alias entity-alias="II" name="inventoryItemId"/>
        <alias entity-alias="II" name="inventoryItemTypeId"/>
        <alias entity-alias="II" name="productId"/>
        <alias entity-alias="II" name="partyId"/>
        <alias entity-alias="II" name="ownerPartyId"/>
        <alias entity-alias="II" name="statusId"/>
        <alias entity-alias="II" name="datetimeReceived"/>
        <alias entity-alias="II" name="datetimeManufactured"/>
        <alias entity-alias="II" name="expireDate"/>
        <alias entity-alias="II" name="facilityId"/>
        <alias entity-alias="II" name="containerId"/>
        <alias entity-alias="II" name="lotId"/>
        <alias entity-alias="II" name="uomId"/>
        <alias entity-alias="II" name="binNumber"/>
        <alias entity-alias="II" name="locationSeqId"/>
        <alias entity-alias="II" name="comments"/>
        <alias entity-alias="II" name="quantityOnHandTotal"/>
        <alias entity-alias="II" name="availableToPromiseTotal"/>
        <alias entity-alias="II" name="accountingQuantityTotal"/>
        <alias entity-alias="II" name="oldQuantityOnHand"/>
        <alias entity-alias="II" name="oldAvailableToPromise"/>
        <alias entity-alias="II" name="serialNumber"/>
        <alias entity-alias="II" name="softIdentifier"/>
        <alias entity-alias="II" name="activationNumber"/>
        <alias entity-alias="II" name="activationValidThru"/>
        <alias entity-alias="II" name="currencyUomId"/>
        <alias entity-alias="II" name="inventoryItemFixedAssetId" field="fixedAssetId"/>
        <view-link entity-alias="II" rel-entity-alias="IID">
            <key-map field-name="inventoryItemId"/>
        </view-link>
    </view-entity>
    <entity entity-name="InventoryItemDetail"
            package-name="org.ofbiz.product.inventory"
            title="Inventory Item Detail">
      <field name="inventoryItemId" type="id-ne"></field>
      <field name="inventoryItemDetailSeqId" type="id-ne"></field>
      <field name="effectiveDate" type="date-time"></field>
      <field name="quantityOnHandDiff" type="fixed-point"></field>
      <field name="availableToPromiseDiff" type="fixed-point"></field>
      <field name="accountingQuantityDiff" type="fixed-point"></field>
      <field name="unitCost" type="fixed-point"></field>
      <field name="orderId" type="id"></field>
      <field name="orderItemSeqId" type="id"></field>
      <field name="shipGroupSeqId" type="id"></field>
      <field name="shipmentId" type="id"></field>
      <field name="shipmentItemSeqId" type="id"></field>
      <field name="returnId" type="id"></field>
      <field name="returnItemSeqId" type="id"></field>
      <field name="workEffortId" type="id"></field>
      <field name="fixedAssetId" type="id"></field>
      <field name="maintHistSeqId" type="id"></field>
      <field name="itemIssuanceId" type="id"></field>
      <field name="receiptId" type="id"></field>
      <field name="physicalInventoryId" type="id"></field>
      <field name="reasonEnumId" type="id"></field>
      <field name="description" type="description"></field>
      <prim-key field="inventoryItemId"/>
      <prim-key field="inventoryItemDetailSeqId"/>
      <relation type="one" fk-name="INV_ITDTL_INVIT" rel-entity-name="InventoryItem">
        <key-map field-name="inventoryItemId"/>
      </relation>
      <relation type="one" fk-name="INV_ITDTL_WEFF" rel-entity-name="WorkEffort">
        <key-map field-name="workEffortId"/>
      </relation>
      <relation type="one-nofk" rel-entity-name="OrderItemShipGrpInvRes">
        <key-map field-name="orderId"/>
        <key-map field-name="orderItemSeqId"/>
        <key-map field-name="shipGroupSeqId"/>
        <key-map field-name="inventoryItemId"/>
      </relation>
      <relation type="one" fk-name="INV_ITDTL_FAMNT" rel-entity-name="FixedAssetMaint">
        <key-map field-name="fixedAssetId"/>
        <key-map field-name="maintHistSeqId"/>
      </relation>
      <relation type="one" fk-name="INV_ITDTL_ITMIS" rel-entity-name="ItemIssuance">
        <key-map field-name="itemIssuanceId"/>
      </relation>
      <relation type="one-nofk" rel-entity-name="WorkEffortInventoryAssign">
        <key-map field-name="workEffortId"/>
        <key-map field-name="inventoryItemId"/>
      </relation>
      <relation type="one-nofk" rel-entity-name="WorkEffortInventoryProduced">
        <key-map field-name="workEffortId"/>
        <key-map field-name="inventoryItemId"/>
      </relation>
      <relation type="one" fk-name="INV_ITDTL_SHRCT" rel-entity-name="ShipmentReceipt">
        <key-map field-name="receiptId"/>
      </relation>
      <relation type="one" fk-name="INV_ITDTL_PHINV" rel-entity-name="PhysicalInventory">
        <key-map field-name="physicalInventoryId"/>
      </relation>
      <relation title="Reason" fk-name="INV_ITDTL_REAS" rel-entity-name="Enumeration" type="one">
        <key-map field-name="reasonEnumId" rel-field-name="enumId"/>
      </relation>
      <relation type="one-nofk" rel-entity-name="InventoryItemVariance">
        <key-map field-name="inventoryItemId"/>
        <key-map field-name="physicalInventoryId"/>
      </relation>
        <index name="INVITEM_DETAIL_DATE">
            <index-field name="inventoryItemId"/>
            <index-field name="createdStamp"/>
        </index>
    </entity>
    <view-entity entity-name="InventoryItemDetailSummary"
            package-name="org.ofbiz.product.inventory"
            title="Inventory Item Detail Summary View">
      <member-entity entity-alias="IID" entity-name="InventoryItemDetail"/>
      <alias entity-alias="IID" name="inventoryItemId" group-by="true"/>
      <alias entity-alias="IID" name="availableToPromiseTotal" field="availableToPromiseDiff" function="sum"/>
      <alias entity-alias="IID" name="quantityOnHandTotal" field="quantityOnHandDiff" function="sum"/>
      <alias entity-alias="IID" name="accountingQuantityTotal" field="accountingQuantityDiff" function="sum"/>
    </view-entity>
    <view-entity entity-name="InventoryItemDetailForSum" package-name="org.ofbiz.product.inventory"
        title="Inventory Item And Inventory Item Detail for Summation View">
        <member-entity entity-alias="II" entity-name="InventoryItem"/>
        <member-entity entity-alias="IID" entity-name="InventoryItemDetail"/>
        <alias entity-alias="IID" name="quantityOnHandSum" field="quantityOnHandDiff" function="sum"/>
        <alias entity-alias="IID" name="accountingQuantitySum" field="accountingQuantityDiff" function="sum"/>
        <alias entity-alias="II" name="inventoryItemTypeId" group-by="true"></alias>
        <alias entity-alias="II" name="facilityId" group-by="true"></alias>
        <alias entity-alias="II" name="productId" group-by="true"></alias>
        <alias entity-alias="II" name="unitCost" group-by="true"></alias>
        <alias entity-alias="II" name="currencyUomId" group-by="true"></alias>
        <alias entity-alias="IID" name="effectiveDate"><description>For query only, not in fields to select.</description></alias>
        <alias entity-alias="IID" name="orderId"><description>For query only, not in fields to select.</description></alias>
        <alias entity-alias="II" name="ownerPartyId"><description>For query only, not in fields to select.</description></alias>
        <alias entity-alias="IID" name="quantityOnHandDiff"><description>For query only, not in fields to select.</description></alias>
        <alias entity-alias="IID" name="accountingQuantityDiff"><description>For query only, not in fields to select.</description></alias>
        <view-link entity-alias="II" rel-entity-alias="IID">
            <key-map field-name="inventoryItemId"/>
        </view-link>
    </view-entity>
    <entity entity-name="InventoryItemStatus"
            package-name="org.ofbiz.product.inventory"
            title="Inventory Item Status History">
      <field name="inventoryItemId" type="id-ne"></field>
      <field name="statusId" type="id-ne"></field>
      <field name="statusDatetime" type="date-time"></field>
      <field name="statusEndDatetime" type="date-time"></field>
      <field name="changeByUserLoginId" type="id-vlong"></field>
      <field name="ownerPartyId" type="id"><description>Used to track a changed (new) ownerPartyId as a status changes.</description></field>
      <field name="productId" type="id"><description>Used to track a changed (new) productId as a status changes. In other words over time the item may be represented by a different Product (like new versus refurbished).</description></field>
      <prim-key field="inventoryItemId"/>
      <prim-key field="statusId"/>
      <prim-key field="statusDatetime"/>
      <relation type="one" fk-name="INV_ITEM_STTS_II" rel-entity-name="InventoryItem">
        <key-map field-name="inventoryItemId"/>
      </relation>
      <relation type="one" fk-name="INV_ITEM_STTS_SI" rel-entity-name="StatusItem">
        <key-map field-name="statusId"/>
      </relation>
      <relation type="one" fk-name="INV_ITEM_STTS_USER" rel-entity-name="UserLogin">
        <key-map field-name="changeByUserLoginId" rel-field-name="userLoginId"/>
      </relation>
    </entity>
    <view-entity entity-name="InventoryItemStatusForCount" package-name="org.ofbiz.product.inventory">
        <description>This view-entity is for querying a count (findCountByCondition) of InventoryItems that were in a certain status at a certain point in time.</description>
        <member-entity entity-alias="IIS" entity-name="InventoryItemStatus"/>
        <member-entity entity-alias="II" entity-name="InventoryItem"/>
        <alias name="facilityId" entity-alias="II"/>
        <alias name="inventoryItemTypeId" entity-alias="II"/>
        <alias name="inventoryItemId" entity-alias="IIS"/>
        <alias name="productId" entity-alias="IIS"><description>Note that this is from the status entity because it may change over time.</description></alias>
        <alias name="statusId" entity-alias="IIS"/>
        <alias name="statusDatetime" entity-alias="IIS"/>
        <alias name="statusEndDatetime" entity-alias="IIS"/>
        <view-link entity-alias="IIS" rel-entity-alias="II">
            <key-map field-name="inventoryItemId"/>
        </view-link>
    </view-entity>
    <entity entity-name="InventoryItemTempRes"
            package-name="org.ofbiz.product.inventory"
            title="Inventory Item Temporary Reservation">
      <field name="visitId" type="id-ne"></field>
      <field name="productId" type="id-ne"></field>
      <field name="productStoreId" type="id-ne"></field>
      <field name="quantity" type="fixed-point"></field>
      <field name="reservedDate" type="date-time"></field>
      <prim-key field="visitId"/>
      <prim-key field="productId"/>
      <prim-key field="productStoreId"/>
      <relation type="one" fk-name="INV_ITEM_TR_PROD" rel-entity-name="Product">
        <key-map field-name="productId"/>
      </relation>
      <relation type="one" fk-name="INV_ITEM_TR_PRDS" rel-entity-name="ProductStore">
        <key-map field-name="productStoreId"/>
      </relation>
    </entity>
    <entity entity-name="InventoryItemType"
            package-name="org.ofbiz.product.inventory"
            default-resource-name="ProductEntityLabels"
            title="Inventory Item Type">
      <field name="inventoryItemTypeId" type="id-ne"></field>
      <field name="parentTypeId" type="id-ne"></field>
      <field name="hasTable" type="indicator"></field>
      <field name="description" type="description"></field>
      <prim-key field="inventoryItemTypeId"/>
      <relation type="one" fk-name="INV_ITEM_TYPPAR" title="Parent" rel-entity-name="InventoryItemType">
        <key-map field-name="parentTypeId" rel-field-name="inventoryItemTypeId"/>
      </relation>
    </entity>
    <entity entity-name="InventoryItemTypeAttr"
            package-name="org.ofbiz.product.inventory"
            title="Inventory Item Type Attribute">
      <field name="inventoryItemTypeId" type="id-ne"></field>
      <field name="attrName" type="id-long-ne"></field>
      <field name="description" type="description"></field>
      <prim-key field="inventoryItemTypeId"/>
      <prim-key field="attrName"/>
      <relation type="one" fk-name="INV_ITEM_TYP_ATTR" rel-entity-name="InventoryItemType">
        <key-map field-name="inventoryItemTypeId"/>
      </relation>
      <relation type="many" rel-entity-name="InventoryItemAttribute">
        <key-map field-name="attrName"/>
      </relation>
      <relation type="many" rel-entity-name="InventoryItem">
        <key-map field-name="inventoryItemTypeId"/>
      </relation>
    </entity>
    <entity entity-name="InventoryItemVariance"
            package-name="org.ofbiz.product.inventory"
            title="Inventory Item Variance">
      <field name="inventoryItemId" type="id-ne"></field>
      <field name="physicalInventoryId" type="id-ne"></field>
      <field name="varianceReasonId" type="id"></field>
      <field name="availableToPromiseVar" type="fixed-point"></field>
      <field name="quantityOnHandVar" type="fixed-point"></field>
      <field name="comments" type="comment"></field>
      <prim-key field="inventoryItemId"/>
      <prim-key field="physicalInventoryId"/>
      <relation type="one" fk-name="INV_ITEM_VAR_PINV" rel-entity-name="PhysicalInventory">
        <key-map field-name="physicalInventoryId"/>
      </relation>
      <relation type="one" fk-name="INV_ITEM_VAR_RSN" rel-entity-name="VarianceReason">
        <key-map field-name="varianceReasonId"/>
      </relation>
      <relation type="one" fk-name="INV_ITEM_VAR_ITEM" rel-entity-name="InventoryItem">
        <key-map field-name="inventoryItemId"/>
      </relation>
    </entity>
    <entity entity-name="InventoryItemLabelType"
            package-name="org.ofbiz.product.inventory"
            title="Inventory Item Label Type">
      <field name="inventoryItemLabelTypeId" type="id-ne"></field>
      <field name="parentTypeId" type="id"></field>
      <field name="hasTable" type="indicator"></field>
      <field name="description" type="description"></field>
      <prim-key field="inventoryItemLabelTypeId"/>
      <relation type="one" fk-name="INV_ITLT_TYPPAR" title="Parent" rel-entity-name="InventoryItemLabelType">
        <key-map field-name="parentTypeId" rel-field-name="inventoryItemLabelTypeId"/>
      </relation>
    </entity>
    <entity entity-name="InventoryItemLabel"
            package-name="org.ofbiz.product.inventory"
            title="Inventory Item Label">
      <field name="inventoryItemLabelId" type="id-ne"></field>
      <field name="inventoryItemLabelTypeId" type="id-ne"></field>
      <field name="description" type="description"></field>
      <prim-key field="inventoryItemLabelId"/>
      <relation type="one" fk-name="INV_ITLA_TYPE" rel-entity-name="InventoryItemLabelType">
        <key-map field-name="inventoryItemLabelTypeId"/>
      </relation>
    </entity>
    <entity entity-name="InventoryItemLabelAppl"
            package-name="org.ofbiz.product.inventory"
            title="Inventory Item Label Applicability">
      <field name="inventoryItemId" type="id-ne"></field>
      <field name="inventoryItemLabelTypeId" type="id-ne"></field>
      <field name="inventoryItemLabelId" type="id-ne"></field>
      <field name="sequenceNum" type="numeric"></field>
      <prim-key field="inventoryItemId"/>
      <prim-key field="inventoryItemLabelTypeId"/>
      <relation type="one" fk-name="INV_ITLAP_ITEM" rel-entity-name="InventoryItem">
        <key-map field-name="inventoryItemId"/>
      </relation>
      <relation type="one" fk-name="INV_ITLAP_TYPE" rel-entity-name="InventoryItemLabelType">
        <key-map field-name="inventoryItemLabelTypeId"/>
      </relation>
      <relation type="one" fk-name="INV_ITLAP_LAB" rel-entity-name="InventoryItemLabel">
        <key-map field-name="inventoryItemLabelId"/>
      </relation>
    </entity>
    <entity entity-name="InventoryTransfer"
            package-name="org.ofbiz.product.inventory"
            title="Inventory Transfer">
      <field name="inventoryTransferId" type="id-ne"></field>
      <field name="statusId" type="id-ne"></field>
      <field name="inventoryItemId" type="id-ne"></field>
      <field name="facilityId" type="id"></field>
      <field name="locationSeqId" type="id"></field>
      <field name="containerId" type="id"></field>
      <field name="facilityIdTo" type="id"></field>
      <field name="locationSeqIdTo" type="id"></field>
      <field name="containerIdTo" type="id"></field>
      <field name="itemIssuanceId" type="id"></field>
      <field name="sendDate" type="date-time"></field>
      <field name="receiveDate" type="date-time"></field>
      <field name="comments" type="comment"></field>
      <prim-key field="inventoryTransferId"/>
      <relation type="one" fk-name="INV_XFER_ITEM" rel-entity-name="InventoryItem">
        <key-map field-name="inventoryItemId"/>
      </relation>
      <relation type="one" fk-name="INV_XFER_STTS" rel-entity-name="StatusItem">
        <key-map field-name="statusId"/>
      </relation>
      <relation type="one" fk-name="INV_XFER_FAC" rel-entity-name="Facility">
        <key-map field-name="facilityId"/>
      </relation>
      <relation type="one-nofk" rel-entity-name="FacilityLocation">
        <key-map field-name="facilityId"/>
        <key-map field-name="locationSeqId"/>
      </relation>
      <relation type="one" fk-name="INV_XFER_CONT" rel-entity-name="Container">
        <key-map field-name="containerId"/>
      </relation>
      <relation type="one" fk-name="INV_XFER_TFAC" title="To" rel-entity-name="Facility">
        <key-map field-name="facilityIdTo" rel-field-name="facilityId"/>
      </relation>
      <relation type="one-nofk" title="To" rel-entity-name="FacilityLocation">
        <key-map field-name="facilityIdTo" rel-field-name="facilityId"/>
        <key-map field-name="locationSeqIdTo" rel-field-name="locationSeqId"/>
      </relation>
      <relation type="one" fk-name="INV_XFER_TCNT" title="To" rel-entity-name="Container">
        <key-map field-name="containerIdTo" rel-field-name="containerId"/>
      </relation>
      <relation type="one" fk-name="INV_XFER_ISSU" rel-entity-name="ItemIssuance">
        <key-map field-name="itemIssuanceId"/>
      </relation>
    </entity>
    <entity entity-name="Lot"
            package-name="org.ofbiz.product.inventory"
            title="Lot">
      <field name="lotId" type="id-ne"></field>
      <field name="creationDate" type="date-time"></field>
      <field name="quantity" type="fixed-point"></field>
      <field name="expirationDate" type="date-time"></field>
      <prim-key field="lotId"/>
    </entity>
    <entity entity-name="PhysicalInventory"
            package-name="org.ofbiz.product.inventory"
            title="Physical Inventory">
      <field name="physicalInventoryId" type="id-ne"></field>
      <field name="physicalInventoryDate" type="date-time"></field>
      <field name="partyId" type="id"></field>
      <field name="generalComments" type="comment"></field>
      <prim-key field="physicalInventoryId"/>
    </entity>
    <view-entity entity-name="PhysicalInventoryAndVariance"
            package-name="org.ofbiz.product.inventory"
            title="PhysicalInventory and InventoryItemVariance View">
      <member-entity entity-alias="PHINV" entity-name="PhysicalInventory"/>
      <member-entity entity-alias="IIV" entity-name="InventoryItemVariance"/>
      <alias entity-alias="PHINV" name="physicalInventoryId"/>
      <alias entity-alias="PHINV" name="physicalInventoryDate"/>
      <alias entity-alias="PHINV" name="partyId"/>
      <alias entity-alias="PHINV" name="generalComments"/>
      <alias entity-alias="IIV" name="inventoryItemId"/>
      <alias entity-alias="IIV" name="varianceReasonId"/>
      <alias entity-alias="IIV" name="availableToPromiseVar"/>
      <alias entity-alias="IIV" name="quantityOnHandVar"/>
      <alias entity-alias="IIV" name="comments"/>
      <view-link entity-alias="PHINV" rel-entity-alias="IIV">
        <key-map field-name="physicalInventoryId"/>
      </view-link>
      <relation type="one-nofk" rel-entity-name="VarianceReason">
        <key-map field-name="varianceReasonId"/>
      </relation>
      <relation type="one-nofk" rel-entity-name="InventoryItem">
        <key-map field-name="inventoryItemId"/>
      </relation>
      <relation type="one-nofk" rel-entity-name="Party">
        <key-map field-name="partyId"/>
      </relation>
      <relation type="one-nofk" rel-entity-name="Person">
        <key-map field-name="partyId"/>
      </relation>
      <relation type="one-nofk" rel-entity-name="PartyGroup">
        <key-map field-name="partyId"/>
      </relation>
    </view-entity>
    <entity entity-name="VarianceReason"
            package-name="org.ofbiz.product.inventory"
            default-resource-name="ProductEntityLabels"
            title="Variance Reason">
      <field name="varianceReasonId" type="id-ne"></field>
      <field name="description" type="description"></field>
      <prim-key field="varianceReasonId"/>
    </entity>

  <!-- ========================================================= -->
  <!-- org.ofbiz.product.price -->
  <!-- ========================================================= -->

    <entity entity-name="ProductPaymentMethodType"
            package-name="org.ofbiz.product.price"
            title="Product PaymentMethodType">
        <field name="productId" type="id-ne"></field>
        <field name="paymentMethodTypeId" type="id-ne"></field>
        <field name="productPricePurposeId" type="id-ne"></field>
        <field name="fromDate" type="date-time"></field>
        <field name="thruDate" type="date-time"></field>
        <field name="sequenceNum" type="numeric"></field>
        <prim-key field="productId"/>
        <prim-key field="paymentMethodTypeId"/>
        <prim-key field="productPricePurposeId"/>
        <prim-key field="fromDate"/>
        <relation type="one" fk-name="PROD_PMT_PROD" rel-entity-name="Product">
            <key-map field-name="productId"/>
        </relation>
        <relation type="one" fk-name="PROD_PMT_PMT" rel-entity-name="PaymentMethodType">
            <key-map field-name="paymentMethodTypeId"/>
        </relation>
        <relation type="one" fk-name="PROD_PMT_PPRP" rel-entity-name="ProductPricePurpose">
            <key-map field-name="productPricePurposeId"/>
        </relation>
    </entity>
    <entity entity-name="ProductPrice"
            package-name="org.ofbiz.product.price"
            title="Product Price">
      <field name="productId" type="id-ne"></field>
      <field name="productPriceTypeId" type="id-ne"></field>
      <field name="productPricePurposeId" type="id-ne"></field>
      <field name="currencyUomId" type="id"></field>
      <field name="productStoreGroupId" type="id"></field>
      <field name="fromDate" type="date-time"></field>
      <field name="thruDate" type="date-time"></field>
      <field name="price" type="currency-precise"></field>
      <field name="termUomId" type="id"><description>Mainly used for recurring and usage prices to specify a time/freq measure, or a usage unit measure (bits, minutes, etc)</description></field>
      <field name="customPriceCalcService" type="id"><description>Points to a CustomMethod used to specify a service for the calculation of the unit price of the product (NOTE: a better name for this field might be priceCalcCustomMethodId)</description></field>
      <field name="priceWithoutTax" type="currency-precise"><description>Always without tax if populated, regardless of if price does or does not include tax.</description></field>
      <field name="priceWithTax" type="currency-precise"><description>Always with tax if populated, regardless of if price does or does not include tax.</description></field>
      <field name="taxAmount" type="currency-precise"/>
      <field name="taxPercentage" type="fixed-point"/>
      <field name="taxAuthPartyId" type="id-ne"/>
      <field name="taxAuthGeoId" type="id-ne"/>
      <field name="taxInPrice" type="indicator"><description>If Y the price field has tax included for the given taxAuthPartyId/taxAuthGeoId at the taxPercentage.</description></field>
      <field name="createdDate" type="date-time"></field>
      <field name="createdByUserLogin" type="id-vlong"></field>
      <field name="lastModifiedDate" type="date-time"></field>
      <field name="lastModifiedByUserLogin" type="id-vlong"></field>
      <prim-key field="productId"/>
      <prim-key field="productPriceTypeId"/>
      <prim-key field="productPricePurposeId"/>
      <prim-key field="currencyUomId"/>
      <prim-key field="productStoreGroupId"/>
      <prim-key field="fromDate"/>
      <relation type="one" fk-name="PROD_PRICE_PROD" rel-entity-name="Product">
        <key-map field-name="productId"/>
      </relation>
      <relation type="one" fk-name="PROD_PRICE_TYPE" rel-entity-name="ProductPriceType">
        <key-map field-name="productPriceTypeId"/>
      </relation>
      <relation type="one" fk-name="PROD_PRICE_PURP" rel-entity-name="ProductPricePurpose">
        <key-map field-name="productPricePurposeId"/>
      </relation>
      <relation type="one" fk-name="PROD_PRICE_CUOM" title="Currency" rel-entity-name="Uom">
        <key-map field-name="currencyUomId" rel-field-name="uomId"/>
      </relation>
      <relation type="one" fk-name="PROD_PRICE_TUOM" title="Term" rel-entity-name="Uom">
        <key-map field-name="termUomId" rel-field-name="uomId"/>
      </relation>
      <relation type="one" fk-name="PROD_PRICE_PSTG" rel-entity-name="ProductStoreGroup">
        <key-map field-name="productStoreGroupId"/>
      </relation>
      <relation type="one" fk-name="PROD_PRICE_CMET" rel-entity-name="CustomMethod">
        <key-map field-name="customPriceCalcService" rel-field-name="customMethodId"/>
      </relation>
      <relation type="one" fk-name="PROD_PRC_TAXPTY" title="TaxAuthority" rel-entity-name="Party">
        <key-map field-name="taxAuthPartyId" rel-field-name="partyId"/>
      </relation>
      <relation type="one" fk-name="PROD_PRC_TAXGEO" title="TaxAuthority" rel-entity-name="Geo">
        <key-map field-name="taxAuthGeoId" rel-field-name="geoId"/>
      </relation>
      <relation type="one" fk-name="PROD_PRICE_CBUL" title="CreatedBy" rel-entity-name="UserLogin">
        <key-map field-name="createdByUserLogin" rel-field-name="userLoginId"/>
      </relation>
      <relation type="one" fk-name="PROD_PRICE_LMBUL" title="LastModifiedBy" rel-entity-name="UserLogin">
        <key-map field-name="lastModifiedByUserLogin" rel-field-name="userLoginId"/>
      </relation>
        <index name="PRD_PRC_GENLKP">
            <index-field name="productId"/>
            <index-field name="productPricePurposeId"/>
            <index-field name="currencyUomId"/>
            <index-field name="productStoreGroupId"/>
        </index>
    </entity>
    <entity entity-name="ProductPriceAction"
            package-name="org.ofbiz.product.price"
            title="Product Price Action">
      <field name="productPriceRuleId" type="id-ne"></field>
      <field name="productPriceActionSeqId" type="id-ne"></field>
      <field name="productPriceActionTypeId" type="id-ne"></field>
      <field name="amount" type="fixed-point"></field>
      <field name="rateCode" type="short-varchar"></field>
      <prim-key field="productPriceRuleId"/>
      <prim-key field="productPriceActionSeqId"/>
      <relation type="one" fk-name="PROD_PCACT_TYPE" rel-entity-name="ProductPriceActionType">
        <key-map field-name="productPriceActionTypeId"/>
      </relation>
      <relation type="one" fk-name="PROD_PCACT_RL" rel-entity-name="ProductPriceRule">
        <key-map field-name="productPriceRuleId"/>
      </relation>
    </entity>
    <entity entity-name="ProductPriceActionType"
            package-name="org.ofbiz.product.price"
            default-resource-name="ProductEntityLabels"
            title="Product Price Type">
      <field name="productPriceActionTypeId" type="id-ne"></field>
      <field name="description" type="description"></field>
      <prim-key field="productPriceActionTypeId"/>
    </entity>
    <entity entity-name="ProductPriceAutoNotice"
            package-name="org.ofbiz.product.price"
            title="Product Price Automatic Notice History">
      <field name="productPriceNoticeId" type="id-ne"></field>
      <field name="facilityId" type="id"></field>
      <field name="runDate" type="date-time"></field>
      <field name="fromDate" type="date-time"></field>
      <field name="thruDate" type="date-time"></field>
      <prim-key field="productPriceNoticeId"/>
    </entity>
    <entity entity-name="ProductPriceChange"
            package-name="org.ofbiz.product.price"
            title="Product Price Change History">
      <field name="productPriceChangeId" type="id-ne"></field>
      <field name="productId" type="id-ne"></field>
      <field name="productPriceTypeId" type="id-ne"></field>
      <field name="productPricePurposeId" type="id-ne"></field>
      <field name="currencyUomId" type="id"></field>
      <field name="productStoreGroupId" type="id"></field>
      <field name="fromDate" type="date-time"></field>
      <field name="thruDate" type="date-time"></field>
      <field name="price" type="currency-amount"></field>
      <field name="oldPrice" type="currency-amount"></field>
      <field name="changedDate" type="date-time"></field>
      <field name="changedByUserLogin" type="id-vlong"></field>
      <prim-key field="productPriceChangeId"/>
      <relation type="one-nofk" rel-entity-name="ProductPrice">
        <key-map field-name="productId"/>
        <key-map field-name="productPriceTypeId"/>
        <key-map field-name="productPricePurposeId"/>
        <key-map field-name="currencyUomId"/>
        <key-map field-name="productStoreGroupId"/>
        <key-map field-name="fromDate"/>
      </relation>
      <relation type="one" fk-name="PROD_PRCHNG_CHUL" title="ChangedBy" rel-entity-name="UserLogin">
        <key-map field-name="changedByUserLogin" rel-field-name="userLoginId"/>
      </relation>
    </entity>
    <entity entity-name="ProductPriceCond"
            package-name="org.ofbiz.product.price"
            title="Product Price Condition">
      <field name="productPriceRuleId" type="id-ne"></field>
      <field name="productPriceCondSeqId" type="id-ne"></field>
      <field name="inputParamEnumId" type="id"></field>
      <field name="operatorEnumId" type="id"></field>
      <field name="condValue" type="long-varchar"></field>
      <prim-key field="productPriceRuleId"/>
      <prim-key field="productPriceCondSeqId"/>
      <relation type="one" fk-name="PROD_PCCOND_RULE" rel-entity-name="ProductPriceRule">
        <key-map field-name="productPriceRuleId"/>
      </relation>
      <relation type="one" fk-name="PROD_PCCOND_INENUM" title="InputParam" rel-entity-name="Enumeration">
        <key-map field-name="inputParamEnumId" rel-field-name="enumId"/>
      </relation>
      <relation type="one" fk-name="PROD_PCCOND_OPENUM" title="Operator" rel-entity-name="Enumeration">
        <key-map field-name="operatorEnumId" rel-field-name="enumId"/>
      </relation>
    </entity>
    <entity entity-name="ProductPricePurpose"
            package-name="org.ofbiz.product.price"
            default-resource-name="ProductEntityLabels"
            title="Product Price Purpose">
        <field name="productPricePurposeId" type="id-ne"></field>
        <field name="description" type="description"></field>
        <prim-key field="productPricePurposeId"/>
    </entity>
    <entity entity-name="ProductPriceRule"
            package-name="org.ofbiz.product.price"
            title="Product Pice Rule">
      <field name="productPriceRuleId" type="id-ne"></field>
      <field name="ruleName" type="name"></field>
      <field name="description" type="description"></field>
      <field name="isSale" type="indicator"></field>
      <field name="fromDate" type="date-time"></field>
      <field name="thruDate" type="date-time"></field>
      <prim-key field="productPriceRuleId"/>
    </entity>
    <entity entity-name="ProductPriceType"
            package-name="org.ofbiz.product.price"
            default-resource-name="ProductEntityLabels"
            title="Product Price Type">
      <field name="productPriceTypeId" type="id-ne"></field>
      <field name="description" type="description"></field>
      <prim-key field="productPriceTypeId"/>
    </entity>
    <entity entity-name="QuantityBreak"
            package-name="org.ofbiz.product.price"
            title="Quantity Break">
      <field name="quantityBreakId" type="id-ne"></field>
      <field name="quantityBreakTypeId" type="id"></field>
      <field name="fromQuantity" type="fixed-point"></field>
      <field name="thruQuantity" type="fixed-point"></field>
      <prim-key field="quantityBreakId"/>
      <relation type="one" fk-name="QUANT_BRK_TYPE" rel-entity-name="QuantityBreakType">
        <key-map field-name="quantityBreakTypeId"/>
      </relation>
    </entity>
    <entity entity-name="QuantityBreakType"
            package-name="org.ofbiz.product.price"
            default-resource-name="ProductEntityLabels"
            title="Quantity Break Type">
      <field name="quantityBreakTypeId" type="id-ne"></field>
      <field name="description" type="description"></field>
      <prim-key field="quantityBreakTypeId"/>
    </entity>
    <entity entity-name="SaleType"
            package-name="org.ofbiz.product.price"
            title="Sale Type">
      <field name="saleTypeId" type="id-ne"></field>
      <field name="description" type="description"></field>
      <prim-key field="saleTypeId"/>
    </entity>

  <!-- ========================================================= -->
  <!-- org.ofbiz.product.product -->
  <!-- ========================================================= -->

    <entity entity-name="GoodIdentification"
            package-name="org.ofbiz.product.product"
            title="Good Identification">
      <field name="goodIdentificationTypeId" type="id-ne"></field>
      <field name="productId" type="id-ne"></field>
      <field name="idValue" type="id-long"></field>
      <prim-key field="goodIdentificationTypeId"/>
      <prim-key field="productId"/>
      <relation type="one" fk-name="GOOD_ID_TYPE" rel-entity-name="GoodIdentificationType">
        <key-map field-name="goodIdentificationTypeId"/>
      </relation>
      <relation type="one" fk-name="GOOD_ID_PRODICT" rel-entity-name="Product">
        <key-map field-name="productId"/>
      </relation>
      <index name="GOOD_ID_VALIDX" unique="false">
          <index-field name="idValue"/>
      </index>
    </entity>
    <view-entity entity-name="GoodIdentificationAndProduct"
                package-name="org.ofbiz.product.product"
                title="GoodIdentification and Product View">
      <member-entity entity-alias="GI" entity-name="GoodIdentification"/>
      <member-entity entity-alias="PR" entity-name="Product"/>
      <alias-all entity-alias="GI"/>
      <alias-all entity-alias="PR"/>
      <view-link entity-alias="GI" rel-entity-alias="PR">
        <key-map field-name="productId"/>
      </view-link>
      <relation type="one-nofk" rel-entity-name="ProductType">
        <key-map field-name="productTypeId"/>
      </relation>
      <relation type="one-nofk" title="Primary" rel-entity-name="ProductCategory">
        <key-map field-name="primaryProductCategoryId" rel-field-name="productCategoryId"/>
      </relation>
      <relation type="one-nofk" rel-entity-name="Facility">
        <key-map field-name="facilityId"/>
      </relation>
      <relation type="one-nofk" title="Manufacturer" rel-entity-name="Party">
        <key-map field-name="manufacturerPartyId" rel-field-name="partyId"/>
      </relation>
      <relation type="one-nofk" title="Quantity" rel-entity-name="Uom">
        <key-map field-name="quantityUomId" rel-field-name="uomId"/>
      </relation>
      <relation type="one-nofk" title="Amount" rel-entity-name="UomType">
        <key-map field-name="amountUomTypeId" rel-field-name="uomTypeId"/>
      </relation>
      <relation type="one-nofk" title="Weight" rel-entity-name="Uom">
        <key-map field-name="weightUomId" rel-field-name="uomId"/>
      </relation>
      <relation type="one-nofk" title="Height" rel-entity-name="Uom">
        <key-map field-name="heightUomId" rel-field-name="uomId"/>
      </relation>
      <relation type="one-nofk" title="Width" rel-entity-name="Uom">
        <key-map field-name="widthUomId" rel-field-name="uomId"/>
      </relation>
      <relation type="one-nofk" title="Depth" rel-entity-name="Uom">
        <key-map field-name="depthUomId" rel-field-name="uomId"/>
      </relation>
      <relation type="one-nofk" rel-entity-name="Enumeration">
        <key-map field-name="ratingTypeEnum" rel-field-name="enumId"/>
      </relation>
      <relation type="one-nofk" title="CreatedBy" rel-entity-name="UserLogin">
        <key-map field-name="createdByUserLogin" rel-field-name="userLoginId"/>
      </relation>
      <relation type="one-nofk" title="LastModifiedBy" rel-entity-name="UserLogin">
        <key-map field-name="lastModifiedByUserLogin" rel-field-name="userLoginId"/>
      </relation>
      <relation type="one" rel-entity-name="Product">
        <key-map field-name="productId"/>
      </relation>
    </view-entity>
    <entity entity-name="GoodIdentificationType"
            package-name="org.ofbiz.product.product"
            default-resource-name="ProductEntityLabels"
            title="Good Identification Type">
      <field name="goodIdentificationTypeId" type="id-ne"></field>
      <field name="parentTypeId" type="id"></field>
      <field name="hasTable" type="indicator"></field>
      <field name="description" type="description"></field>
      <prim-key field="goodIdentificationTypeId"/>
      <relation type="one" fk-name="GOOD_ID_TYPE_PAR" title="Parent" rel-entity-name="GoodIdentificationType">
        <key-map field-name="parentTypeId" rel-field-name="goodIdentificationTypeId"/>
      </relation>
    </entity>
    <entity entity-name="Product"
            package-name="org.ofbiz.product.product"
            title="Product">
      <field name="productId" type="id-ne"></field>
      <field name="productTypeId" type="id"></field>
      <field name="primaryProductCategoryId" type="id"><description>The primary category ; it should be one of the productCategoryId already setup in ProductCategoryMember</description></field>
      <field name="manufacturerPartyId" type="id"></field>
      <field name="facilityId" type="id"></field>
      <field name="introductionDate" type="date-time"></field>
      <field name="releaseDate" type="date-time"></field>
      <field name="supportDiscontinuationDate" type="date-time"></field>
      <field name="salesDiscontinuationDate" type="date-time"></field>
      <field name="salesDiscWhenNotAvail" type="indicator"></field>
      <field name="internalName" type="description"></field>
      <field name="brandName" type="name"></field>
      <field name="comments" type="comment"></field>
      <field name="productName" type="name"></field>
      <field name="description" type="description"></field>
      <field name="longDescription" type="very-long"></field>
      <field name="priceDetailText" type="description"></field>
      <field name="smallImageUrl" type="url"></field>
      <field name="mediumImageUrl" type="url"></field>
      <field name="largeImageUrl" type="url"></field>
      <field name="detailImageUrl" type="url"></field>
      <field name="originalImageUrl" type="url"></field>
      <field name="detailScreen" type="long-varchar"></field>
      <field name="inventoryMessage" type="description"></field>
      <field name="inventoryItemTypeId" type="id"></field>
      <field name="requireInventory" type="indicator"></field>
      <field name="quantityUomId" type="id"></field>
      <field name="quantityIncluded" type="fixed-point"><description>If you have a six-pack of 12oz soda cans you would have quantityIncluded=12, quantityUomId=oz, piecesIncluded=6.</description></field> 
      <field name="piecesIncluded" type="numeric"></field>
      <field name="requireAmount" type="indicator"></field>
      <field name="fixedAmount" type="currency-amount"><description>Use this for products which are sold in fixed denominations, such as gift certificates or calling cards.</description></field>
      <field name="amountUomTypeId" type="id"></field>
      <field name="weightUomId" type="id"></field>
      <field name="weight" type="fixed-point"><description>The shipping weight of the product.</description></field>
      <field name="productWeight" type="fixed-point"></field>
      <field name="heightUomId" type="id"></field>
      <field name="productHeight" type="fixed-point"></field>
      <field name="shippingHeight" type="fixed-point"></field>
      <field name="widthUomId" type="id"></field>
      <field name="productWidth" type="fixed-point"></field>
      <field name="shippingWidth" type="fixed-point"></field>
      <field name="depthUomId" type="id"></field>
      <field name="productDepth" type="fixed-point"></field>
      <field name="shippingDepth" type="fixed-point"></field>
      <field name="diameterUomId" type="id"></field>
      <field name="productDiameter" type="fixed-point"></field>
      <field name="productRating" type="fixed-point"></field>
      <field name="ratingTypeEnum" type="id"></field>
      <field name="returnable" type="indicator"></field>
      <field name="taxable" type="indicator"></field>
      <field name="chargeShipping" type="indicator"></field>
      <field name="autoCreateKeywords" type="indicator"></field>
      <field name="includeInPromotions" type="indicator"></field>
      <field name="isVirtual" type="indicator"></field>
      <field name="isVariant" type="indicator"></field>
      <field name="virtualVariantMethodEnum" type="id"><description>This field defines the method of selecting a variant from the selectable features on the virtual product. Either as a variant explosion which will work to about 200 variants or as feature explosion which almost has no limits</description></field>
      <field name="originGeoId" type="id"></field>
      <field name="requirementMethodEnumId" type="id"></field>
      <field name="billOfMaterialLevel" type="numeric"></field>
      <field name="reservMaxPersons" type="fixed-point"><description>maximum number of persons who can rent this asset at the same time</description></field>
      <field name="reserv2ndPPPerc" type="fixed-point"><description>percentage of the end price for the 2nd person renting this asset connected to this product</description></field>
      <field name="reservNthPPPerc" type="fixed-point"><description>percentage of the end price for the Nth person renting this asset connected to this product</description></field>
      <field name="configId" type="id"><description>Used to safe the persisted configuration Id for AGGREGATED products.</description></field>
      <field name="createdDate" type="date-time"></field>
      <field name="createdByUserLogin" type="id-vlong"></field>
      <field name="lastModifiedDate" type="date-time"></field>
      <field name="lastModifiedByUserLogin" type="id-vlong"></field>
      <field name="inShippingBox" type="indicator"></field>
      <field name="defaultShipmentBoxTypeId" type="id"></field>
      <field name="lotIdFilledIn" type="long-varchar"><description>Indicate if the lotId must be informed</description></field>
      <field name="orderDecimalQuantity" type="indicator"><description>use to indicate if decimal quantity can be ordered for this product. Default value is Y</description></field>
      <field name="listed" type="indicator"><description>Whether to include product in public category listings, otherwise considered URL-only, default Y (SCIPIO)</description></field>
      <field name="searchable" type="indicator"><description>Whether to include product in public searches, otherwise considered URL-only, default Y (SCIPIO)</description></field>
      <prim-key field="productId"/>
      <relation type="one" fk-name="PROD_TYPE" rel-entity-name="ProductType">
        <key-map field-name="productTypeId"/>
      </relation>
      <relation type="many" rel-entity-name="ProductTypeAttr">
        <key-map field-name="productTypeId"/>
      </relation>
      <relation type="one" fk-name="PROD_PRIMARY_CAT" title="Primary" rel-entity-name="ProductCategory">
        <key-map field-name="primaryProductCategoryId" rel-field-name="productCategoryId"/>
      </relation>
      <relation type="one" fk-name="PROD_FACILITY" rel-entity-name="Facility">
        <key-map field-name="facilityId"/>
      </relation>
      <relation type="one" fk-name="PROD_MFG_PARTY" title="Manufacturer" rel-entity-name="Party">
        <key-map field-name="manufacturerPartyId" rel-field-name="partyId"/>
      </relation>
      <relation type="one" fk-name="PROD_QUANT_UOM" title="Quantity" rel-entity-name="Uom">
        <key-map field-name="quantityUomId" rel-field-name="uomId"/>
      </relation>
      <relation type="one" fk-name="PROD_AMOUNT_UOMT" title="Amount" rel-entity-name="UomType">
        <key-map field-name="amountUomTypeId" rel-field-name="uomTypeId"/>
      </relation>
      <relation type="one" fk-name="PROD_WEIGHT_UOM" title="Weight" rel-entity-name="Uom">
        <key-map field-name="weightUomId" rel-field-name="uomId"/>
      </relation>
      <relation type="one" fk-name="PROD_HEIGHT_UOM" title="Height" rel-entity-name="Uom">
        <key-map field-name="heightUomId" rel-field-name="uomId"/>
      </relation>
      <relation type="one" fk-name="PROD_WIDTH_UOM" title="Width" rel-entity-name="Uom">
        <key-map field-name="widthUomId" rel-field-name="uomId"/>
      </relation>
      <relation type="one" fk-name="PROD_DEPTH_UOM" title="Depth" rel-entity-name="Uom">
        <key-map field-name="depthUomId" rel-field-name="uomId"/>
      </relation>
      <relation type="one" fk-name="PROD_DIAMTR_UOM" title="Diameter" rel-entity-name="Uom">
        <key-map field-name="diameterUomId" rel-field-name="uomId"/>
      </relation>
      <relation type="one" fk-name="PROD_VVMETHOD_ENUM" title="VirtualVariantMethod" rel-entity-name="Enumeration">
        <key-map field-name="virtualVariantMethodEnum" rel-field-name="enumId"/>
      </relation>
      <relation type="one" fk-name="PROD_RATE_ENUM" title="Rating" rel-entity-name="Enumeration">
        <key-map field-name="ratingTypeEnum" rel-field-name="enumId"/>
      </relation>
      <relation type="one" fk-name="PROD_RQMT_ENUM" title="RequirementMethod" rel-entity-name="Enumeration">
        <key-map field-name="requirementMethodEnumId" rel-field-name="enumId"/>
      </relation>
      <relation type="one" fk-name="PROD_ORG_GEO" title="Origin" rel-entity-name="Geo">
          <key-map field-name="originGeoId" rel-field-name="geoId"/>
      </relation>
      <relation type="one" fk-name="PROD_CB_USERLOGIN" title="CreatedBy" rel-entity-name="UserLogin">
        <key-map field-name="createdByUserLogin" rel-field-name="userLoginId"/>
      </relation>
      <relation type="one" fk-name="PROD_LMB_USERLOGIN" title="LastModifiedBy" rel-entity-name="UserLogin">
        <key-map field-name="lastModifiedByUserLogin" rel-field-name="userLoginId"/>
      </relation>
      <relation type="many" rel-entity-name="ProductFeatureAndAppl">
        <key-map field-name="productId"/>
      </relation>
      <relation type="one" fk-name="PROD_SHBX_TYPE" title="Default" rel-entity-name="ShipmentBoxType">
          <key-map field-name="defaultShipmentBoxTypeId" rel-field-name="shipmentBoxTypeId"/>
      </relation>
      <relation type="one" fk-name="PROD_INV_ITEM_TYPE" rel-entity-name="InventoryItemType">
          <key-map field-name="inventoryItemTypeId" rel-field-name="inventoryItemTypeId"/>
      </relation>
    </entity>
    <extend-entity entity-name="Product"><!-- SCIPIO -->
      <field name="imageProfile" type="id"><description>Name of a media profile for the main product image, either ImageSizePreset.presetId or media profile name from mediaprofiles.properties, defaults to IMAGE_PRODUCT-ORIGINAL_IMAGE_URL (SCIPIO)</description></field>
    </extend-entity>
    <!-- SCIPIO: Product inline image equivalents of DataResource fields scpWidth, scpHeight, srcPresetJson, ... -->
    <entity entity-name="ProductMediaDetails"
            package-name="org.ofbiz.product.product"
            title="Inline Product Media Details">
        <field name="productId" type="id-ne"></field>
        <field name="smallImageWidth" type="numeric"></field>
        <field name="smallImageHeight" type="numeric"></field>
        <field name="smallImageMimeTypeId" type="id-vlong"></field>
        <field name="smallImagePresetJson" type="very-long"></field>
        <field name="mediumImageWidth" type="numeric"></field>
        <field name="mediumImageHeight" type="numeric"></field>
        <field name="mediumImageMimeTypeId" type="id-vlong"></field>
        <field name="mediumImagePresetJson" type="very-long"></field>
        <field name="largeImageWidth" type="numeric"></field>
        <field name="largeImageHeight" type="numeric"></field>
        <field name="largeImageMimeTypeId" type="id-vlong"></field>
        <field name="largeImagePresetJson" type="very-long"></field>
        <field name="detailImageWidth" type="numeric"></field>
        <field name="detailImageHeight" type="numeric"></field>
        <field name="detailImageMimeTypeId" type="id-vlong"></field>
        <field name="detailImagePresetJson" type="very-long"></field>
        <field name="originalImageWidth" type="numeric"></field>
        <field name="originalImageHeight" type="numeric"></field>
        <field name="originalImageMimeTypeId" type="id-vlong"></field>
        <field name="originalImagePresetJson" type="very-long"></field>
        <field name="originalImageFileName" type="value"></field><!-- TODO: not currently populated by inconsistent upload functions -->
        <prim-key field="productId"/>
        <relation type="one" fk-name="PRODMEDDET_PRODID" rel-entity-name="Product">
            <key-map field-name="productId"/>
        </relation>
    </entity>
    <!-- SCIPIO: Insert records into this to queue/trigger (depending on context) automatic productImageAutoRescale or other on ECA-->
    <entity entity-name="ProductImageOpRequest"
            package-name="org.ofbiz.product.product"
            title="Inline Product Media Details">
        <field name="piorId" type="id-ne"></field>
        <field name="serviceId" type="id-ne"><description>Typically service name (e.g.: productImageAutoRescale)</description></field>
        <field name="mode" type="id-ne"><description>Values: sync, async/async-memory, async-persist</description></field>
        <field name="productId" type="id"></field>
        <field name="serviceArgsJson" type="very-long"></field>
        <prim-key field="piorId"/>
        <relation type="one" fk-name="PRODIMOPREQ_PRODID" rel-entity-name="Product">
            <key-map field-name="productId"/>
        </relation>
    </entity>
    <entity entity-name="ProductAssoc"
            package-name="org.ofbiz.product.product"
            title="Product Association">
      <field name="productId" type="id-ne"></field>
      <field name="productIdTo" type="id-ne"></field>
      <field name="productAssocTypeId" type="id-ne"></field>
      <field name="fromDate" type="date-time"></field>
      <field name="thruDate" type="date-time"></field>
      <field name="sequenceNum" type="numeric"></field>
      <field name="reason" type="long-varchar"></field>
      <field name="quantity" type="fixed-point"></field>
      <field name="scrapFactor" type="fixed-point"></field>
      <field name="instruction" type="long-varchar"></field>
      <field name="routingWorkEffortId" type="id"></field>
      <field name="estimateCalcMethod" type="id"></field>
      <field name="recurrenceInfoId" type="id"></field>
      <prim-key field="productId"/>
      <prim-key field="productIdTo"/>
      <prim-key field="productAssocTypeId"/>
      <prim-key field="fromDate"/>
      <relation type="one" fk-name="PROD_ASSOC_TYPE" rel-entity-name="ProductAssocType">
        <key-map field-name="productAssocTypeId"/>
      </relation>
      <relation type="one" fk-name="PROD_ASSOC_MPROD" title="Main" rel-entity-name="Product">
        <key-map field-name="productId"/>
      </relation>
      <relation type="one" fk-name="PROD_ASSOC_APROD" title="Assoc" rel-entity-name="Product">
        <key-map field-name="productIdTo" rel-field-name="productId"/>
      </relation>
      <relation type="one" fk-name="PROD_ASSOC_RTWE" title="Routing" rel-entity-name="WorkEffort">
        <key-map field-name="routingWorkEffortId" rel-field-name="workEffortId"/>
      </relation>
      <relation type="one" fk-name="PROD_ASSOC_CUSM" rel-entity-name="CustomMethod">
        <key-map field-name="estimateCalcMethod" rel-field-name="customMethodId"/>
      </relation>
        <relation type="one" fk-name="PROD_ASSOC_RECINFO" rel-entity-name="RecurrenceInfo">
            <key-map field-name="recurrenceInfoId"/>
        </relation>
    </entity>
    <view-entity entity-name="ProductAndAssoc"
                 package-name="org.ofbiz.product.product"
                 title="Product and ProductAssoc View">
      <member-entity entity-alias="PD" entity-name="Product"/>
      <member-entity entity-alias="PDA" entity-name="ProductAssoc"/>
      <alias name="productId" entity-alias="PD" field="productId"/>
      <alias name="internalName" entity-alias="PD"  field="internalName"/>
      <alias name="productIdTo" entity-alias="PDA" field="productIdTo"/>
      <alias name="productAssocTypeId" entity-alias="PDA" field="productAssocTypeId"/>
      <alias name="quantity" entity-alias="PDA" field="quantity"/>
      <alias name="fromDate" entity-alias="PDA" field="fromDate"/>
      <view-link entity-alias="PD" rel-entity-alias="PDA">
        <key-map field-name="productId"/>
      </view-link>
    </view-entity>
    <view-entity entity-name="ProductAndAssocAll"
                 package-name="org.ofbiz.product.product"
                 title="Product and ProductAssoc To Full View"><!-- SCIPIO -->
      <member-entity entity-alias="PD" entity-name="Product"/>
      <member-entity entity-alias="PDA" entity-name="ProductAssoc"/>
      <alias-all entity-alias="PD" />
      <alias-all entity-alias="PDA"/>
      <view-link entity-alias="PD" rel-entity-alias="PDA">
        <key-map field-name="productId"/>
      </view-link>
    </view-entity>
    <view-entity entity-name="ProductAndAssocToAll"
                 package-name="org.ofbiz.product.product"
                 title="Product and ProductAssoc To Full View"><!-- SCIPIO -->
      <member-entity entity-alias="PD" entity-name="Product"/>
      <member-entity entity-alias="PDA" entity-name="ProductAssoc"/>
      <alias-all entity-alias="PD" />
      <alias-all entity-alias="PDA">
          <exclude field="productId"/>
      </alias-all>
      <alias name="productIdFrom" entity-alias="PDA" field="productId"/>
      <view-link entity-alias="PD" rel-entity-alias="PDA">
        <key-map field-name="productId" rel-field-name="productIdTo"/>
      </view-link>
    </view-entity>
    <entity entity-name="ProductAssocType"
            package-name="org.ofbiz.product.product"
            default-resource-name="ProductEntityLabels"
            title="Product Association Type">
      <field name="productAssocTypeId" type="id-ne"></field>
      <field name="parentTypeId" type="id"></field>
      <field name="hasTable" type="indicator"></field>
      <field name="description" type="description"></field>
      <prim-key field="productAssocTypeId"/>
      <relation type="one" fk-name="PROD_ASSOC_TYPEPAR" title="Parent" rel-entity-name="ProductAssocType">
        <key-map field-name="parentTypeId" rel-field-name="productAssocTypeId"/>
      </relation>
    </entity>
    <entity entity-name="ProductRole"
            package-name="org.ofbiz.product.product"
            title="Product Role">
      <field name="productId" type="id-ne"></field>
      <field name="partyId" type="id-ne"></field>
      <field name="roleTypeId" type="id-ne"></field>
      <field name="fromDate" type="date-time"></field>
      <field name="thruDate" type="date-time"></field>
      <field name="sequenceNum" type="numeric"><description>a product may have several parties associated to it with the same role; this field can be used to define the order of parties associated to the product in that role</description></field>
      <field name="comments" type="comment"></field>
      <prim-key field="productId"/>
      <prim-key field="partyId"/>
      <prim-key field="roleTypeId"/>
      <prim-key field="fromDate"/>
      <relation type="one-nofk" rel-entity-name="Party">
        <key-map field-name="partyId"/>
      </relation>
      <relation type="one-nofk" rel-entity-name="RoleType">
        <key-map field-name="roleTypeId"/>
      </relation>
      <relation type="one" fk-name="PROD_RLE_PTYRLE" rel-entity-name="PartyRole">
        <key-map field-name="partyId"/>
        <key-map field-name="roleTypeId"/>
      </relation>
      <relation type="one" fk-name="PROD_RLE_PRODUCT" rel-entity-name="Product">
        <key-map field-name="productId"/>
      </relation>
    </entity>
    <entity entity-name="ProductAttribute"
            package-name="org.ofbiz.product.product"
            title="Product Attribute">
      <field name="productId" type="id-ne"></field>
      <field name="attrName" type="id-long-ne"></field>
      <field name="attrValue" type="value"></field>
      <field name="attrType" type="value"></field>
      <field name="attrDescription" type="description"></field>
      <prim-key field="productId"/>
      <prim-key field="attrName"/>
      <relation type="one" fk-name="PROD_ATTR" rel-entity-name="Product">
        <key-map field-name="productId"/>
      </relation>
      <relation type="many" rel-entity-name="ProductTypeAttr">
        <key-map field-name="attrName"/>
      </relation>
    </entity>
    <entity entity-name="ProductCalculatedInfo"
            package-name="org.ofbiz.product.product"
            title="Product Calculated Info">
        <field name="productId" type="id-ne"></field>
        <field name="totalQuantityOrdered" type="fixed-point"></field>
        <field name="totalTimesViewed" type="numeric"></field>
        <field name="averageCustomerRating" type="fixed-point"></field>
        <prim-key field="productId"/>
        <relation type="one" fk-name="PRODCI_PROD" rel-entity-name="Product">
            <key-map field-name="productId"/>
        </relation>
    </entity>
    <entity entity-name="ProductContent"
            package-name="org.ofbiz.product.product"
            title="Product Data Object">
      <field name="productId" type="id-ne"></field>
      <field name="contentId" type="id-ne"></field>
      <field name="productContentTypeId" type="id-ne"></field>
      <field name="fromDate" type="date-time"></field>
      <field name="thruDate" type="date-time"></field>
      <field name="purchaseFromDate" type="date-time"></field>
      <field name="purchaseThruDate" type="date-time"></field>
      <field name="useCountLimit" type="numeric"></field>
      <field name="useTime" type="numeric"></field>
      <field name="useTimeUomId" type="id"></field>
      <field name="useRoleTypeId" type="id"></field>
      <field name="sequenceNum" type="numeric"></field>
      <prim-key field="productId"/>
      <prim-key field="contentId"/>
      <prim-key field="productContentTypeId"/>
      <prim-key field="fromDate"/>
      <relation type="one" fk-name="PROD_CNT_PROD" rel-entity-name="Product">
        <key-map field-name="productId"/>
      </relation>
      <relation type="one" fk-name="PROD_CNT_CNT" rel-entity-name="Content">
        <key-map field-name="contentId"/>
      </relation>
      <relation type="one" fk-name="PROD_CNT_TYPE" rel-entity-name="ProductContentType">
        <key-map field-name="productContentTypeId"/>
      </relation>
      <relation type="one" fk-name="PROD_CNT_URT" title="Use" rel-entity-name="RoleType">
        <key-map field-name="useRoleTypeId" rel-field-name="roleTypeId"/>
      </relation>
      <relation type="one" fk-name="PROD_CNT_UTU" title="UseTime" rel-entity-name="Uom">
        <key-map field-name="useTimeUomId" rel-field-name="uomId"/>
      </relation>
    </entity>
    <view-entity entity-name="ProductContentAndInfo"
            package-name="org.ofbiz.product.product"
            title="ProductContent, Content and DataResource View">
      <member-entity entity-alias="PC" entity-name="ProductContent"/>
      <member-entity entity-alias="CO" entity-name="Content"/>
      <member-entity entity-alias="DR" entity-name="DataResource"/>
      <alias-all entity-alias="PC"/>
      <alias-all entity-alias="CO"/>
      <alias-all entity-alias="DR" prefix="dr"/>
      <view-link entity-alias="PC" rel-entity-alias="CO">
        <key-map field-name="contentId"/>
      </view-link>
      <view-link entity-alias="CO" rel-entity-alias="DR">
        <key-map field-name="dataResourceId"/>
      </view-link>
      <relation type="one-nofk" rel-entity-name="ElectronicText">
        <key-map field-name="dataResourceId"/>
      </relation>
      <relation type="one-nofk" rel-entity-name="ImageDataResource">
        <key-map field-name="dataResourceId"/>
      </relation>
      <relation type="one-nofk" rel-entity-name="OtherDataResource">
        <key-map field-name="dataResourceId"/>
      </relation>
      <relation type="many" rel-entity-name="ContentAssocDataResourceViewFrom">
        <key-map field-name="contentId" rel-field-name="contentIdStart"/>
      </relation>
      <relation type="many" rel-entity-name="ContentAssocDataResourceViewTo">
        <key-map field-name="contentId" rel-field-name="contentIdStart"/>
      </relation>
    </view-entity>
    <!-- SCIPIO: new entity that covers 2 entities -->
    <view-entity entity-name="ProductContentAndContent"
                package-name="org.ofbiz.product.product"
                title="ProductContent And Content Required View">
      <member-entity entity-alias="PC" entity-name="ProductContent"/>
      <member-entity entity-alias="CO" entity-name="Content"/>
      <alias-all entity-alias="PC"/>
      <alias-all entity-alias="CO"/>
      <view-link entity-alias="PC" rel-entity-alias="CO">
        <key-map field-name="contentId"/>
      </view-link>
    </view-entity>
    <!-- SCIPIO: new entity that covers 3 entities, most useful for simple text content values e.g. ALTERNATE_TEXT -->
    <view-entity entity-name="ProductContentAndDataResource"
                package-name="org.ofbiz.product.product"
                title="ProductContent And DataResource Required View">
      <member-entity entity-alias="PC" entity-name="ProductContent"/>
      <member-entity entity-alias="CO" entity-name="Content"/>
      <member-entity entity-alias="DR" entity-name="DataResource"/>
      <alias-all entity-alias="PC"/>
      <alias-all entity-alias="CO"/>
      <alias-all entity-alias="DR" prefix="dr"/>
      <view-link entity-alias="PC" rel-entity-alias="CO">
        <key-map field-name="contentId"/>
      </view-link>
      <view-link entity-alias="CO" rel-entity-alias="DR" rel-optional="false">
        <key-map field-name="dataResourceId"/>
      </view-link>
    </view-entity>
    <!-- SCIPIO: 2017-10-27: new entity that covers 4 entities, most useful for simple text content values e.g. ALTERNATE_TEXT -->
    <view-entity entity-name="ProductContentAndElectronicText"
                package-name="org.ofbiz.product.product"
                title="ProductContent And ElectronicText Required View">
      <member-entity entity-alias="PC" entity-name="ProductContent"/>
      <member-entity entity-alias="CO" entity-name="Content"/>
      <member-entity entity-alias="DR" entity-name="DataResource"/>
      <member-entity entity-alias="EL" entity-name="ElectronicText"/>
      <alias-all entity-alias="PC"/>
      <alias-all entity-alias="CO"/>
      <alias-all entity-alias="DR" prefix="dr"/>
      <alias-all entity-alias="EL"/>
      <view-link entity-alias="PC" rel-entity-alias="CO">
        <key-map field-name="contentId"/>
      </view-link>
      <view-link entity-alias="CO" rel-entity-alias="DR" rel-optional="false">
        <key-map field-name="dataResourceId"/>
      </view-link>
      <view-link entity-alias="CO" rel-entity-alias="EL" rel-optional="false">
        <key-map field-name="dataResourceId"/>
      </view-link>
    </view-entity>
    <!-- 2017-11-08: same as ProductContentAndElectronicText but skips some entities where possible -->
    <view-entity entity-name="ProductContentAndElecTextShort"
                package-name="org.ofbiz.product.product"
                title="ProductContent And ElectronicText Required Short View">
      <member-entity entity-alias="PC" entity-name="ProductContent"/>
      <member-entity entity-alias="CO" entity-name="Content"/>
      <member-entity entity-alias="EL" entity-name="ElectronicText"/>
      <alias-all entity-alias="PC"/>
      <alias-all entity-alias="CO"/>
      <alias-all entity-alias="EL"/>
      <view-link entity-alias="PC" rel-entity-alias="CO">
        <key-map field-name="contentId"/>
      </view-link>
      <view-link entity-alias="CO" rel-entity-alias="EL" rel-optional="false">
        <key-map field-name="dataResourceId"/>
      </view-link>
    </view-entity>
    <!-- SCIPIO: 2017-11-08: new partially optimized entity that goes from ProductContent to ContentAssoc to ElectronicText, skipping some intermediates -->
    <view-entity entity-name="ProductContentAssocAndElecTextShort"
                package-name="org.ofbiz.product.product"
                title="ProductContent And ContentAssoc And ElectronicText Required Short View">
      <member-entity entity-alias="PC" entity-name="ProductContent"/>
      <member-entity entity-alias="CA" entity-name="ContentAssoc"/>
      <member-entity entity-alias="TOCO" entity-name="Content"/>
      <member-entity entity-alias="EL" entity-name="ElectronicText"/>
        <member-entity entity-alias="PC" entity-name="ProductContent"/>
        <member-entity entity-alias="CA" entity-name="ContentAssoc"/>
        <member-entity entity-alias="TOCO" entity-name="Content"/>
        <member-entity entity-alias="EL" entity-name="ElectronicText"/>
        <alias entity-alias="PC" name="productId" />
        <alias entity-alias="PC" name="contentId" />
        <alias entity-alias="PC" name="productContentTypeId" />
        <alias entity-alias="PC" name="fromDate" />
        <alias entity-alias="PC" name="thruDate" />
        <alias entity-alias="CA" name="contentAssocTypeId" />
        <alias entity-alias="CA" name="contentIdTo" />
        <alias entity-alias="CA" name="caFromDate" field="fromDate" />
        <alias entity-alias="CA" name="caThruDate" field="thruDate" />
        <alias entity-alias="TOCO" name="localeString" />
        <alias entity-alias="TOCO" name="dataResourceId" />
        <alias entity-alias="EL" name="textData" />
        <alias entity-alias="CA" name="contentIdStart" field="contentId"/>
        <view-link entity-alias="PC" rel-entity-alias="CA">
            <key-map field-name="contentId"/>
        </view-link>
        <view-link entity-alias="CA" rel-entity-alias="TOCO">
            <key-map field-name="contentIdTo" rel-field-name="contentId"/>
        </view-link>
        <view-link entity-alias="TOCO" rel-entity-alias="EL" rel-optional="false">
            <key-map field-name="dataResourceId"/>
        </view-link>
    </view-entity>
    <entity entity-name="ProductContentType"
            package-name="org.ofbiz.product.product"
            default-resource-name="ProductEntityLabels"
            title="Product Content Type">
      <field name="productContentTypeId" type="id-ne"></field>
      <field name="parentTypeId" type="id"></field>
      <field name="hasTable" type="indicator"></field>
      <field name="description" type="description"></field>
      <field name="viewType" type="name"><description>For images: main, additional or a custom type (SCIPIO)</description></field>
      <field name="viewNumber" type="value"><description>For images: 0 for main, 1-4 or greater for additional images (SCIPIO)</description></field>
      <field name="viewSize" type="name"><description>For images: original, detail, large, 320x240, etc., also known as sizeType (SCIPIO)</description></field>
      <field name="viewVariantId" type="name"><description>For images: flexible expression pattern for generating variant productContentTypeId of an original image URL (SCIPIO)</description></field>
      <field name="viewVariantDesc" type="name"><description>For images: flexible expression pattern for generating variant description of an original image URL (SCIPIO)</description></field>
      <prim-key field="productContentTypeId"/>
      <relation type="one" fk-name="PRDCT_TYP_PARENT" title="Parent" rel-entity-name="ProductContentType">
        <key-map field-name="parentTypeId" rel-field-name="productContentTypeId"/>
      </relation>
    </entity>
    <entity entity-name="ProductGeo"
            package-name="org.ofbiz.product.product"
            default-resource-name="ProductEntityLabels"
            title="Product Geo">
      <field name="productId" type="id-ne"></field>
      <field name="geoId" type="id"></field>
      <field name="productGeoEnumId" type="id"></field>
      <field name="description" type="description"></field>
      <prim-key field="productId"/>
      <prim-key field="geoId"/>
      <relation type="one" fk-name="PRDGEO_PRODUCT" rel-entity-name="Product">
        <key-map field-name="productId"/>
      </relation>
      <relation type="one" fk-name="PRDGEO_GEO" rel-entity-name="Geo">
        <key-map field-name="geoId"/>
      </relation>
      <relation type="one" fk-name="PRDGEO_ENUM" rel-entity-name="Enumeration">
        <key-map field-name="productGeoEnumId" rel-field-name="enumId"/>
      </relation>
    </entity>
    <entity entity-name="ProductGlAccount"
            package-name="org.ofbiz.product.product"
            title="Product GlAccount">
      <field name="productId" type="id-ne"></field>
      <field name="organizationPartyId" type="id-ne"></field>
      <field name="glAccountTypeId" type="id-ne"></field>
      <field name="glAccountId" type="id-ne"></field>
      <prim-key field="productId"/>
      <prim-key field="organizationPartyId"/>
      <prim-key field="glAccountTypeId"/>
      <relation type="one" fk-name="PROD_GLACT_PROD" rel-entity-name="Product">
        <key-map field-name="productId"/>
      </relation>
      <relation type="one" fk-name="PROD_GLACT_PARTY" rel-entity-name="Party">
        <key-map field-name="organizationPartyId" rel-field-name="partyId"/>
      </relation>
      <relation type="one" fk-name="PROD_GLACT_TYPE" rel-entity-name="GlAccountType">
        <key-map field-name="glAccountTypeId"/>
      </relation>
      <relation type="one" fk-name="PROD_GLACT_GLACT" rel-entity-name="GlAccount">
        <key-map field-name="glAccountId"/>
      </relation>
    </entity>
    <view-entity entity-name="ProductInventoryItem"
        package-name="org.ofbiz.product.product"
        title="View entity joining Product and InventoryItem to allow queries for InventoryItem based on product attributes">
        <member-entity entity-alias="PR" entity-name="Product"/>
        <member-entity entity-alias="II" entity-name="InventoryItem"/>
        <alias-all entity-alias="PR">
            <exclude field="facilityId"/>
            <exclude field="inventoryItemTypeId"/>
        </alias-all>
        <alias-all entity-alias="II">
            <exclude field="comments"/>
        </alias-all>
        <alias entity-alias="PR" name="productFacilityId" field="facilityId"/>
        <alias entity-alias="II" name="inventoryComments" field="comments"/>
        <view-link entity-alias="PR" rel-entity-alias="II">
            <key-map field-name="productId"/>
        </view-link>
    </view-entity>
    <entity entity-name="ProductKeyword" table-name="PRODUCT_KEYWORD_NEW"
            package-name="org.ofbiz.product.product" title="Product Keyword" never-cache="true">
      <field name="productId" type="id-ne"></field>
      <field name="keyword" type="short-varchar"></field>
      <field name="keywordTypeId" type="id-ne"></field>
      <field name="relevancyWeight" type="numeric"></field>
      <field name="statusId" type="id-ne"></field>
      <prim-key field="productId"/>
      <prim-key field="keyword"/>
      <prim-key field="keywordTypeId"/>
      <relation type="one" fk-name="PROD_KWD_PROD_NEW" rel-entity-name="Product">
        <key-map field-name="productId"/>
      </relation>
      <relation type="one" fk-name="PROD_KWD_TYPE" rel-entity-name="Enumeration">
        <key-map field-name="keywordTypeId" rel-field-name="enumId"/>
      </relation>
      <relation type="one" fk-name="PROD_KWD_STTS" rel-entity-name="StatusItem">
        <key-map field-name="statusId"/>
      </relation>
      <index name="PROD_KWD_KWD_NEW">
        <index-field name="keyword"/>
      </index>
    </entity>
    <entity entity-name="ProductMeter" package-name="org.ofbiz.product.product" title="Product Meter">
        <field name="productId" type="id-ne"></field>
        <field name="productMeterTypeId" type="id-ne"><description>Part of the primary key as different meters on a machine should have distinct types</description></field>
        <field name="meterUomId" type="id"><description>Is on this entity instead of the ProductMeterType entity for more flexibility; for example being able to find all speedometers regardless of their primary unit</description></field>
        <field name="meterName" type="name"></field>
        <prim-key field="productId"/>
        <prim-key field="productMeterTypeId"/>
        <relation type="one" fk-name="PRODMTR_PROD" rel-entity-name="Product">
            <key-map field-name="productId"/>
        </relation>
        <relation type="one" fk-name="PRODMTR_MTRTYP" rel-entity-name="ProductMeterType">
            <key-map field-name="productMeterTypeId"/>
        </relation>
        <relation type="one" fk-name="PRODMTR_MTRUOM" title="Meter" rel-entity-name="Uom">
            <key-map field-name="meterUomId" rel-field-name="uomId"/>
        </relation>
    </entity>
    <entity entity-name="ProductMeterType"
            package-name="org.ofbiz.product.product"
            default-resource-name="ProductEntityLabels"
            title="Product Meter Type">
        <field name="productMeterTypeId" type="id-ne"></field>
        <field name="description" type="description"></field>
        <field name="defaultUomId" type="id"><description>This is optional and if applicable can describe the meter better</description></field>
        <prim-key field="productMeterTypeId"/>
        <relation type="one" fk-name="PRODMTRTP_DUOM" title="Default" rel-entity-name="Uom">
            <key-map field-name="defaultUomId" rel-field-name="uomId"/>
        </relation>
    </entity>
    <entity entity-name="ProductMaint" package-name="org.ofbiz.product.product" title="Product Maintenance">
        <description>This is used to specify the details for scheduled maintenance.</description>
        <field name="productId" type="id-ne"></field>
        <field name="productMaintSeqId" type="id-ne"></field>
        <field name="productMaintTypeId" type="id"></field>
        <field name="maintName" type="name"></field>
        <field name="maintTemplateWorkEffortId" type="id"><description>Template of Maintenance Plan. WorkEffort may have WorkEffortAssocs for tasks/breakdown detailes</description></field>
        <field name="intervalQuantity" type="fixed-point"></field>
        <field name="intervalUomId" type="id"><description>UOM for intervalQuantity; if used intervalMeterTypeId is generally not used (ie one or the other)</description></field>
        <field name="intervalMeterTypeId" type="id"><description>Meter Type for intervalQuantity; if used intervalUomId is generally not used (ie one or the other)</description></field>
        <field name="repeatCount" type="numeric"><description>If 0 or null means no limit to repeat count; can be used with multiple ProductMaint records for a single ProductMaintType in cases where maintenance intervals are not evenly distributed, or only need to be done once like a break-in period</description></field>
        <prim-key field="productId"/>
        <prim-key field="productMaintSeqId"/>
        <relation type="one" fk-name="PRODMNT_PROD" rel-entity-name="Product">
            <key-map field-name="productId"/>
        </relation>
        <relation type="one" fk-name="PRODMNT_MNTTYP" rel-entity-name="ProductMaintType">
            <key-map field-name="productMaintTypeId"/>
        </relation>
        <relation type="one" fk-name="PRODMNT_TPLHWE" title="MaintTemplate" rel-entity-name="WorkEffort">
            <key-map field-name="maintTemplateWorkEffortId" rel-field-name="workEffortId"/>
        </relation>
        <relation type="one" fk-name="PRODMNT_INTUOM" title="Interval" rel-entity-name="Uom">
            <key-map field-name="intervalUomId" rel-field-name="uomId"/>
        </relation>
        <relation type="one" fk-name="PRODMNT_PDMTTYP" title="Interval" rel-entity-name="ProductMeterType">
            <key-map field-name="intervalMeterTypeId" rel-field-name="productMeterTypeId"/>
        </relation>
        <relation type="one-nofk" title="Interval" rel-entity-name="ProductMeter">
            <description>This can't have a foreign key because the intervalMeterTypeId field is optional, but the productId field is not</description>
            <key-map field-name="productId"/>
            <key-map field-name="intervalMeterTypeId" rel-field-name="productMeterTypeId"/>
        </relation>
    </entity>
    <entity entity-name="ProductMaintType"
            package-name="org.ofbiz.product.product"
            default-resource-name="ProductEntityLabels"
            title="Product Maintenance Type">
        <description>This is for both scheduled and unscheduled maintenance; use ProductMaint to track details for scheduled maintenance</description>
        <field name="productMaintTypeId" type="id-ne"></field>
        <field name="description" type="description"></field>
        <field name="parentTypeId" type="id"></field>
        <prim-key field="productMaintTypeId"/>
        <relation type="one" fk-name="PRODMNT_TYPE_PAR" title="Parent" rel-entity-name="ProductMaintType">
            <key-map field-name="parentTypeId" rel-field-name="productMaintTypeId"/>
        </relation>
    </entity>
    <entity entity-name="ProductReview"
            package-name="org.ofbiz.product.product"
            title="Product Review">
        <field name="productReviewId" type="id-ne"></field>
        <field name="productStoreId" type="id-ne"></field>
        <field name="productId" type="id-ne"></field>
        <field name="userLoginId" type="id-vlong-ne"></field>
        <field name="statusId" type="id"></field>
        <field name="postedAnonymous" type="indicator"></field>
        <field name="postedDateTime" type="date-time"></field>
        <field name="productRating" type="fixed-point"></field>
        <field name="productReview" type="very-long"></field>
        <prim-key field="productReviewId"/>
        <relation type="one" fk-name="PROD_REVIEW_PRDSTR" rel-entity-name="ProductStore">
          <key-map field-name="productStoreId"/>
        </relation>
        <relation type="one" fk-name="PROD_REVIEW_PROD" rel-entity-name="Product">
          <key-map field-name="productId"/>
        </relation>
        <relation type="one" fk-name="PROD_REVIEW_ULH" rel-entity-name="UserLogin">
          <key-map field-name="userLoginId" rel-field-name="userLoginId"/>
        </relation>
        <relation type="one" fk-name="PROD_REVIEW_STTS" rel-entity-name="StatusItem">
          <key-map field-name="statusId"/>
        </relation>
    </entity>
    <entity entity-name="ProductSearchConstraint" package-name="org.ofbiz.product.product" never-cache="true" title="Product Search Result Constraint">
      <field name="productSearchResultId" type="id-ne"></field>
      <field name="constraintSeqId" type="id-ne"></field>
      <field name="constraintName" type="long-varchar"></field>
      <field name="infoString" type="long-varchar"></field>
      <field name="includeSubCategories" type="indicator"></field>
      <field name="isAnd" type="indicator"></field>
      <field name="anyPrefix" type="indicator"></field>
      <field name="anySuffix" type="indicator"></field>
      <field name="removeStems" type="indicator"></field>
      <field name="lowValue" type="short-varchar"></field>
      <field name="highValue" type="short-varchar"></field>
      <prim-key field="productSearchResultId"/>
      <prim-key field="constraintSeqId"/>
      <relation type="one" fk-name="PROD_SCHRSI_RES" rel-entity-name="ProductSearchResult">
        <key-map field-name="productSearchResultId"/>
      </relation>
    </entity>
    <entity entity-name="ProductSearchResult"
            package-name="org.ofbiz.product.product"
            never-cache="true"
            title="Product Search Result">
      <field name="productSearchResultId" type="id-ne"></field>
      <field name="visitId" type="id"></field>
      <field name="orderByName" type="long-varchar"></field>
      <field name="isAscending" type="indicator"></field>
      <field name="numResults" type="numeric"></field>
      <field name="secondsTotal" type="floating-point"></field>
      <field name="searchDate" type="date-time"></field>
      <prim-key field="productSearchResultId"/>
    </entity>
    <entity entity-name="ProductType"
            package-name="org.ofbiz.product.product"
            default-resource-name="ProductEntityLabels"
            title="Product Type">
      <field name="productTypeId" type="id-ne"></field>
      <field name="parentTypeId" type="id"></field>
      <field name="isPhysical" type="indicator"></field>
      <field name="isDigital" type="indicator"></field>
      <field name="hasTable" type="indicator"></field>
      <field name="description" type="description"></field>
      <prim-key field="productTypeId"/>
      <relation type="one" fk-name="PROD_TYPE_PARENT" title="Parent" rel-entity-name="ProductType">
        <key-map field-name="parentTypeId" rel-field-name="productTypeId"/>
      </relation>
    </entity>
    <entity entity-name="ProductTypeAttr"
            package-name="org.ofbiz.product.product"
            title="Product Type Attribute">
      <field name="productTypeId" type="id-ne"></field>
      <field name="attrName" type="id-long-ne"></field>
      <field name="description" type="description"></field>
      <prim-key field="productTypeId"/>
      <prim-key field="attrName"/>
      <relation type="one" fk-name="PROD_TYPE_ATTR" rel-entity-name="ProductType">
        <key-map field-name="productTypeId"/>
      </relation>
      <relation type="many" rel-entity-name="ProductAttribute">
        <key-map field-name="attrName"/>
      </relation>
      <relation type="many" rel-entity-name="Product">
        <key-map field-name="productTypeId"/>
      </relation>
    </entity>
    <view-entity entity-name="ProductVirtualAndAssocPrices"
            package-name="org.ofbiz.product.product"
            title="Virtual and Associated Product Prices View">
      <description>When using this to get an associated product price summary the only columns you should request are: productId, productName, assocProductCount, assocMinPrice, assocMaxPrice. The rest of the field aliases should only be used for specifying constraints since they will break the grouping.</description>
      <member-entity entity-alias="PVIRT" entity-name="Product"/>
      <member-entity entity-alias="PA" entity-name="ProductAssoc"/>
      <member-entity entity-alias="PASC" entity-name="Product"/>
      <member-entity entity-alias="PASCPRC" entity-name="ProductPrice"/>
      <alias entity-alias="PVIRT" name="productId"/>
      <alias entity-alias="PVIRT" name="internalName"/>
      <alias entity-alias="PVIRT" name="productName"/>
      <alias entity-alias="PA" name="productAssocTypeId"/>
      <alias entity-alias="PA" name="fromDate"/>
      <alias entity-alias="PA" name="thruDate"/>
      <alias entity-alias="PASC" name="assocProductId" field="productId"/>
      <alias entity-alias="PASC" name="assocProductCount" field="productId" function="count-distinct"/>
      <alias entity-alias="PASCPRC" name="assocPriceTypeId" field="productPriceTypeId"/>
      <alias entity-alias="PASCPRC" name="assocCurrencyUomId" field="currencyUomId"/>
      <alias entity-alias="PASCPRC" name="assocProductStoreGroupId" field="productStoreGroupId"/>
      <alias entity-alias="PASCPRC" name="assocPriceFromDate" field="fromDate"/>
      <alias entity-alias="PASCPRC" name="assocPriceThruDate" field="thruDate"/>
      <alias entity-alias="PASCPRC" name="assocMinPrice" field="price" function="min"/>
      <alias entity-alias="PASCPRC" name="assocMaxPrice" field="price" function="max"/>
      <view-link entity-alias="PVIRT" rel-entity-alias="PA">
        <key-map field-name="productId"/>
      </view-link>
      <view-link entity-alias="PA" rel-entity-alias="PASC">
        <key-map field-name="productIdTo" rel-field-name="productId"/>
      </view-link>
      <view-link entity-alias="PASC" rel-entity-alias="PASCPRC">
        <key-map field-name="productId"/>
      </view-link>
    </view-entity>
    <view-entity entity-name="ProductVirtualAndVariantInfo"
            package-name="org.ofbiz.product.product"
            title="Virtual and Variant Product View">
      <member-entity entity-alias="PVIRT" entity-name="Product"/>
      <member-entity entity-alias="PVA" entity-name="ProductAssoc"/>
      <member-entity entity-alias="PVAR" entity-name="Product"/>
      <member-entity entity-alias="PVARFA" entity-name="ProductFeatureAppl"/>
      <member-entity entity-alias="PVARF" entity-name="ProductFeature"/>
      <member-entity entity-alias="PVARPRC" entity-name="ProductPrice"/>
      <alias entity-alias="PVIRT" name="productId"/>
      <alias entity-alias="PVIRT" name="productName"/>
      <alias entity-alias="PVIRT" name="internalName"/>
      <alias entity-alias="PVA" name="productAssocTypeId"/>
      <alias entity-alias="PVA" name="fromDate"/>
      <alias entity-alias="PVA" name="thruDate"/>
      <alias entity-alias="PVAR" name="variantProductId" field="productId"/>
      <alias entity-alias="PVARFA" name="productFeatureApplTypeId"/>
      <alias entity-alias="PVARFA" name="variantFeatureApplFromDate" field="fromDate"/>
      <alias entity-alias="PVARFA" name="variantFeatureApplThruDate" field="thruDate"/>
      <alias entity-alias="PVARF" name="productFeatureId"/>
      <alias entity-alias="PVARF" name="productFeatureTypeId"/>
      <alias entity-alias="PVARF" name="productFeatureCategoryId"/>
      <alias entity-alias="PVARF" name="description"/>
      <alias entity-alias="PVARPRC" name="variantPriceTypeId" field="productPriceTypeId"/>
      <alias entity-alias="PVARPRC" name="variantCurrencyUomId" field="currencyUomId"/>
      <alias entity-alias="PVARPRC" name="variantProductStoreGroupId" field="productStoreGroupId"/>
      <alias entity-alias="PVARPRC" name="variantPriceFromDate" field="fromDate"/>
      <alias entity-alias="PVARPRC" name="variantPriceThruDate" field="thruDate"/>
      <alias entity-alias="PVARPRC" name="variantPrice" field="price"/>
      <view-link entity-alias="PVIRT" rel-entity-alias="PVA">
        <key-map field-name="productId"/>
      </view-link>
      <view-link entity-alias="PVA" rel-entity-alias="PVAR">
        <key-map field-name="productIdTo" rel-field-name="productId"/>
      </view-link>
      <view-link entity-alias="PVAR" rel-entity-alias="PVARFA" rel-optional="true">
        <key-map field-name="productId"/>
      </view-link>
      <view-link entity-alias="PVARFA" rel-entity-alias="PVARF">
        <key-map field-name="productFeatureId"/>
      </view-link>
      <view-link entity-alias="PVAR" rel-entity-alias="PVARPRC">
        <key-map field-name="productId"/>
      </view-link>
    </view-entity>
    <view-entity entity-name="ProductAndPriceView"
            package-name="org.ofbiz.product.product"
            title="Product And Price View">
      <member-entity entity-alias="PR" entity-name="Product"/>
      <member-entity entity-alias="PP" entity-name="ProductPrice"/>
      <alias entity-alias="PR" name="productId"/>
      <alias entity-alias="PR" name="productTypeId"/>
      <alias entity-alias="PR" name="productName"/>
      <alias entity-alias="PR" name="internalName"/>
      <alias entity-alias="PR" name="description"/>
      <alias entity-alias="PR" name="primaryProductCategoryId"/>
      <alias entity-alias="PR" name="isVirtual"/>
      <alias entity-alias="PP" name="productPriceTypeId"/>
      <alias entity-alias="PP" name="productPricePurposeId"/>
      <alias entity-alias="PP" name="currencyUomId"/>
      <alias entity-alias="PP" name="fromDate"/>
      <alias entity-alias="PP" name="thruDate"/>
      <alias entity-alias="PP" name="price"/>
      <view-link entity-alias="PR" rel-entity-alias="PP">
        <key-map field-name="productId"/>
      </view-link>
    </view-entity>
    <entity entity-name="VendorProduct" package-name="org.ofbiz.product.product">
        <description>For information related to a specific vendor and product, especially for multi-vendor stores. The ProductStoreGroup is to be used much like in ProductPrice.</description>
        <field name="productId" type="id-ne"></field>
        <field name="vendorPartyId" type="id-ne"></field>
        <field name="productStoreGroupId" type="id-ne"></field>
        <prim-key field="productId"/>
        <prim-key field="vendorPartyId"/>
        <prim-key field="productStoreGroupId"/>
        <relation type="one" fk-name="VENDPROD_PROD" rel-entity-name="Product">
            <key-map field-name="productId"/>
        </relation>
        <relation type="one" fk-name="VENDPROD_VPTY" title="Vendor" rel-entity-name="Party">
            <key-map field-name="vendorPartyId" rel-field-name="partyId"/>
        </relation>
        <relation type="one" fk-name="VENDPROD_PSGRP" rel-entity-name="ProductStoreGroup">
            <key-map field-name="productStoreGroupId"/>
        </relation>
    </entity>

  <!-- ========================================================= -->
  <!-- org.ofbiz.product.promo -->
  <!-- ========================================================= -->

    <entity entity-name="ProductPromo"
            package-name="org.ofbiz.product.promo"
            title="Product Promotion">
      <field name="productPromoId" type="id-ne"></field>
      <field name="promoName" type="name"></field>
      <field name="promoText" type="description"></field>
      <field name="userEntered" type="indicator"></field>
      <field name="showToCustomer" type="indicator"></field>
      <field name="requireCode" type="indicator"></field>
      <field name="useLimitPerOrder" type="numeric"></field>
      <field name="useLimitPerCustomer" type="numeric"></field>
      <field name="useLimitPerPromotion" type="numeric"></field>
      <field name="billbackFactor" type="fixed-point"></field>
      <field name="overrideOrgPartyId" type="id"></field>
      <field name="createdDate" type="date-time"></field>
      <field name="createdByUserLogin" type="id-vlong"></field>
      <field name="lastModifiedDate" type="date-time"></field>
      <field name="lastModifiedByUserLogin" type="id-vlong"></field>
      <prim-key field="productPromoId"/>
      <relation type="one" fk-name="PROD_PRMO_OPA" rel-entity-name="Party">
        <key-map field-name="overrideOrgPartyId" rel-field-name="partyId"/>
      </relation>
      <relation type="one" fk-name="PROD_PRMO_CUL" title="CreatedBy" rel-entity-name="UserLogin">
        <key-map field-name="createdByUserLogin" rel-field-name="userLoginId"/>
      </relation>
      <relation type="one" fk-name="PROD_PRMO_LMCUL" title="LastModifiedBy" rel-entity-name="UserLogin">
        <key-map field-name="lastModifiedByUserLogin" rel-field-name="userLoginId"/>
      </relation>
    </entity>
    <!-- SCIPIO: 2.0.0: distributeAmount field added which forces discounted amounts to be distributed across items; only available for productPromoActionEnumId: PROMO_ORDER_PERCENT and PROMO_ORDER_AMOUNT -->
    <entity entity-name="ProductPromoAction"
            package-name="org.ofbiz.product.promo"
            title="Product Promotion Action">
      <field name="productPromoId" type="id-ne"></field>
      <field name="productPromoRuleId" type="id-ne"></field>
      <field name="productPromoActionSeqId" type="id-ne"></field>
      <field name="productPromoActionEnumId" type="id-ne"></field>
      <field name="orderAdjustmentTypeId" type="id"></field>
      <field name="serviceName" type="long-varchar"></field>
      <field name="quantity" type="fixed-point"></field>
      <field name="amount" type="fixed-point"></field>
      <field name="productId" type="id"></field>
      <field name="partyId" type="id"></field>
      <field name="useCartQuantity" type="indicator"></field>
      <field name="distributeAmount" type="indicator"></field>
      <prim-key field="productPromoId"/>
      <prim-key field="productPromoRuleId"/>
      <prim-key field="productPromoActionSeqId"/>
      <relation type="one" fk-name="PROD_PRACT_ENUM" title="Action" rel-entity-name="Enumeration">
        <key-map field-name="productPromoActionEnumId" rel-field-name="enumId"/>
      </relation>
      <relation type="one" fk-name="PROD_PRACT_PR" rel-entity-name="ProductPromo">
        <key-map field-name="productPromoId"/>
      </relation>
      <relation type="one" fk-name="PROD_PRACT_RL" rel-entity-name="ProductPromoRule">
        <key-map field-name="productPromoId"/>
        <key-map field-name="productPromoRuleId"/>
      </relation>
      <relation type="one" fk-name="PROD_PRACT_OATYPE" rel-entity-name="OrderAdjustmentType">
        <key-map field-name="orderAdjustmentTypeId"/>
      </relation>
      <relation type="many" rel-entity-name="ProductPromoCategory">
        <key-map field-name="productPromoId"/>
        <key-map field-name="productPromoRuleId"/>
        <key-map field-name="productPromoActionSeqId"/>
      </relation>
      <relation type="many" rel-entity-name="ProductPromoProduct">
        <key-map field-name="productPromoId"/>
        <key-map field-name="productPromoRuleId"/>
        <key-map field-name="productPromoActionSeqId"/>
      </relation>
    </entity>
    <entity entity-name="ProductPromoCategory"
            package-name="org.ofbiz.product.promo"
            title="Product Promotion Category">
      <field name="productPromoId" type="id-ne"></field>
      <field name="productPromoRuleId" type="id-ne"></field>
      <field name="productPromoActionSeqId" type="id-ne"></field>
      <field name="productPromoCondSeqId" type="id-ne"></field>
      <field name="productCategoryId" type="id-ne"></field>
      <field name="andGroupId" type="id"></field>
      <field name="productPromoApplEnumId" type="id-ne"></field>
      <field name="includeSubCategories" type="indicator"></field>
      <prim-key field="productPromoId"/>
      <prim-key field="productPromoRuleId"/>
      <prim-key field="productPromoActionSeqId"/>
      <prim-key field="productPromoCondSeqId"/>
      <prim-key field="productCategoryId"/>
      <prim-key field="andGroupId"/>
      <relation type="one" fk-name="PROD_PRCAT_PROMO" rel-entity-name="ProductPromo">
        <key-map field-name="productPromoId"/>
      </relation>
      <relation type="one" fk-name="PROD_PRCAT_PRCAT" rel-entity-name="ProductCategory">
        <key-map field-name="productCategoryId"/>
      </relation>
      <relation type="one" fk-name="PROD_PRCAT_ENUM" title="Appl" rel-entity-name="Enumeration">
        <key-map field-name="productPromoApplEnumId" rel-field-name="enumId"/>
      </relation>
    </entity>
    <entity entity-name="ProductPromoCode"
            package-name="org.ofbiz.product.promo"
            title="Product Promotion">
      <field name="productPromoCodeId" type="id-ne"></field>
      <field name="productPromoId" type="id-ne"></field>
      <field name="userEntered" type="indicator"></field>
      <field name="requireEmailOrParty" type="indicator"></field>
      <field name="useLimitPerCode" type="numeric"></field>
      <field name="useLimitPerCustomer" type="numeric"></field>
      <field name="fromDate" type="date-time"></field>
      <field name="thruDate" type="date-time"></field>
      <field name="createdDate" type="date-time"></field>
      <field name="createdByUserLogin" type="id-vlong"></field>
      <field name="lastModifiedDate" type="date-time"></field>
      <field name="lastModifiedByUserLogin" type="id-vlong"></field>
      <prim-key field="productPromoCodeId"/>
      <relation type="one" fk-name="PROD_PRCOD_PROMO" rel-entity-name="ProductPromo">
        <key-map field-name="productPromoId"/>
      </relation>
      <relation type="one" fk-name="PROD_PRCOD_CUL" title="CreatedBy" rel-entity-name="UserLogin">
        <key-map field-name="createdByUserLogin" rel-field-name="userLoginId"/>
      </relation>
      <relation type="one" fk-name="PROD_PRCOD_LMCUL" title="LastModifiedBy" rel-entity-name="UserLogin">
        <key-map field-name="lastModifiedByUserLogin" rel-field-name="userLoginId"/>
      </relation>
    </entity>
    <entity entity-name="ProductPromoCodeEmail"
            package-name="org.ofbiz.product.promo"
            title="Product Promotion Email">
      <field name="productPromoCodeId" type="id-ne"></field>
      <field name="emailAddress" type="email"></field>
      <prim-key field="productPromoCodeId"/>
      <prim-key field="emailAddress"/>
      <relation type="one" fk-name="PROD_PRCDE_PCD" rel-entity-name="ProductPromoCode">
        <key-map field-name="productPromoCodeId"/>
      </relation>
    </entity>
    <view-entity entity-name="ProductPromoCodeEmailParty"
            package-name="org.ofbiz.product.promo"
            title="Product Promotion Email and Party View">
      <member-entity entity-alias="PPCE" entity-name="ProductPromoCodeEmail"/>
      <member-entity entity-alias="CM" entity-name="ContactMech"/>
      <member-entity entity-alias="PCM" entity-name="PartyContactMech"/>
      <alias entity-alias="PPCE" name="productPromoCodeId"/>
      <alias entity-alias="CM" name="infoString"/>
      <alias entity-alias="PCM" name="partyId"/>
      <alias entity-alias="PCM" name="fromDate"/>
      <alias entity-alias="PCM" name="thruDate"/>
      <view-link entity-alias="PPCE" rel-entity-alias="CM">
          <key-map field-name="emailAddress" rel-field-name="infoString"/>
      </view-link>
      <view-link entity-alias="CM" rel-entity-alias="PCM">
          <key-map field-name="contactMechId"/>
      </view-link>
    </view-entity>
    <entity entity-name="ProductPromoCodeParty"
            package-name="org.ofbiz.product.promo"
            title="Product Promotion Party">
      <field name="productPromoCodeId" type="id-ne"></field>
      <field name="partyId" type="id-ne"></field>
      <prim-key field="productPromoCodeId"/>
      <prim-key field="partyId"/>
      <relation type="one" fk-name="PROD_PRCDP_PCD" rel-entity-name="ProductPromoCode">
        <key-map field-name="productPromoCodeId"/>
      </relation>
      <relation type="one" fk-name="PROD_PRCDP_PRTY" rel-entity-name="Party">
        <key-map field-name="partyId"/>
      </relation>
    </entity>
    <entity entity-name="ProductPromoCond"
            package-name="org.ofbiz.product.promo"
            title="Product Promotion Condition">
      <field name="productPromoId" type="id-ne"></field>
      <field name="productPromoRuleId" type="id-ne"></field>
      <field name="productPromoCondSeqId" type="id-ne"></field>
      <field name="inputParamEnumId" type="id"></field>
      <field name="operatorEnumId" type="id"></field>
      <field name="condValue" type="long-varchar"></field>
      <field name="otherValue" type="long-varchar"></field>
      <prim-key field="productPromoId"/>
      <prim-key field="productPromoRuleId"/>
      <prim-key field="productPromoCondSeqId"/>
      <relation type="one" fk-name="PROD_PRCOND_PROMO" rel-entity-name="ProductPromo">
        <key-map field-name="productPromoId"/>
      </relation>
      <relation type="one" fk-name="PROD_PRCOND_RULE" rel-entity-name="ProductPromoRule">
        <key-map field-name="productPromoId"/>
        <key-map field-name="productPromoRuleId"/>
      </relation>
      <relation type="one" fk-name="PROD_PRCOND_INENUM" title="InputParam" rel-entity-name="Enumeration">
        <key-map field-name="inputParamEnumId" rel-field-name="enumId"/>
      </relation>
      <relation type="one" fk-name="PROD_PRCOND_OPENUM" title="Operator" rel-entity-name="Enumeration">
        <key-map field-name="operatorEnumId" rel-field-name="enumId"/>
      </relation>
      <relation type="many" rel-entity-name="ProductPromoCategory">
        <key-map field-name="productPromoId"/>
        <key-map field-name="productPromoRuleId"/>
        <key-map field-name="productPromoCondSeqId"/>
      </relation>
      <relation type="many" rel-entity-name="ProductPromoProduct">
        <key-map field-name="productPromoId"/>
        <key-map field-name="productPromoRuleId"/>
        <key-map field-name="productPromoCondSeqId"/>
      </relation>
    </entity>
    <entity entity-name="ProductPromoProduct"
            package-name="org.ofbiz.product.promo"
            title="Product Promotion Category">
      <field name="productPromoId" type="id-ne"></field>
      <field name="productPromoRuleId" type="id-ne"></field>
      <field name="productPromoActionSeqId" type="id-ne"></field>
      <field name="productPromoCondSeqId" type="id-ne"></field>
      <field name="productId" type="id-ne"></field>
      <field name="productPromoApplEnumId" type="id-ne"></field>
      <prim-key field="productPromoId"/>
      <prim-key field="productPromoRuleId"/>
      <prim-key field="productPromoActionSeqId"/>
      <prim-key field="productPromoCondSeqId"/>
      <prim-key field="productId"/>
      <relation type="one" fk-name="PROD_PRPRD_PROMO" rel-entity-name="ProductPromo">
        <key-map field-name="productPromoId"/>
      </relation>
      <relation type="one" fk-name="PROD_PRPRD_PROD" rel-entity-name="Product">
        <key-map field-name="productId"/>
      </relation>
      <relation type="one" fk-name="PROD_PRPRD_ENUM" title="Appl" rel-entity-name="Enumeration">
        <key-map field-name="productPromoApplEnumId" rel-field-name="enumId"/>
      </relation>
    </entity>
    <entity entity-name="ProductPromoRule"
            package-name="org.ofbiz.product.promo"
            title="Product Promotion Rule">
      <field name="productPromoId" type="id-ne"></field>
      <field name="productPromoRuleId" type="id-ne"></field>
      <field name="ruleName" type="name"></field>
      <prim-key field="productPromoId"/>
      <prim-key field="productPromoRuleId"/>
      <relation type="one" fk-name="PROD_PRRLE_PROMO" rel-entity-name="ProductPromo">
        <key-map field-name="productPromoId"/>
      </relation>
    </entity>
    <entity entity-name="ProductPromoUse"
            package-name="org.ofbiz.product.promo"
            title="Product Promotion Use">
      <field name="orderId" type="id-ne"></field>
      <field name="promoSequenceId" type="id-ne"></field>
      <field name="productPromoId" type="id-ne"></field>
      <field name="productPromoCodeId" type="id-ne"></field>
      <field name="partyId" type="id-ne"></field>
      <field name="totalDiscountAmount" type="currency-amount"></field>
      <field name="quantityLeftInActions" type="fixed-point"></field>
      <prim-key field="orderId"/>
      <prim-key field="promoSequenceId"/>
      <relation type="one" fk-name="PROD_PRUSE_PROMO" rel-entity-name="ProductPromo">
        <key-map field-name="productPromoId"/>
      </relation>
      <relation type="one" fk-name="PROD_PRUSE_CODE" rel-entity-name="ProductPromoCode">
        <key-map field-name="productPromoCodeId"/>
      </relation>
      <relation type="one" fk-name="PROD_PRUSE_ORDR" rel-entity-name="OrderHeader">
        <key-map field-name="orderId"/>
      </relation>
      <relation type="one" fk-name="PROD_PRUSE_PTY" rel-entity-name="Party">
        <key-map field-name="partyId"/>
      </relation>
      <index name="PRODPRUSE_PRMPTY" unique="false">
          <index-field name="productPromoId"/>
          <index-field name="partyId"/>
      </index>
      <index name="PRODPRUSE_PCDPTY" unique="false">
          <index-field name="productPromoCodeId"/>
          <index-field name="partyId"/>
      </index>
    </entity>
    <view-entity entity-name="ProductPromoUseCheck"
            package-name="org.ofbiz.product.promo"
            title="Product Promotion Use Check View">
      <member-entity entity-alias="PPU" entity-name="ProductPromoUse"/>
      <member-entity entity-alias="OH" entity-name="OrderHeader"/>
      <alias-all entity-alias="PPU"/>
      <alias entity-alias="OH" name="statusId"/>
      <view-link entity-alias="PPU" rel-entity-alias="OH">
          <key-map field-name="orderId"/>
      </view-link>
    </view-entity>

  <!-- ========================================================= -->
  <!-- org.ofbiz.product.store -->
  <!-- ========================================================= -->

    <entity entity-name="ProductStore"
            package-name="org.ofbiz.product.store"
            title="Product Store"
            default-resource-name="ProductEntityLabels">
      <field name="productStoreId" type="id-ne"></field>
      <field name="primaryStoreGroupId" type="id"></field>
      <field name="storeName" type="name"></field>
      <field name="companyName" type="name"></field>
      <field name="title" type="name"></field>
      <field name="subtitle" type="description"></field>
      <field name="payToPartyId" type="id">
          <description>Note that this corresponds with the organizationPartyId that GL transactions will be posted to.</description>
      </field>
      <field name="daysToCancelNonPay" type="numeric"></field>
      <field name="manualAuthIsCapture" type="indicator"></field>
      <field name="prorateShipping" type="indicator"></field>
      <field name="prorateTaxes" type="indicator"></field>
      <field name="viewCartOnAdd" type="indicator"></field>
      <field name="autoSaveCart" type="indicator"></field>
      <field name="autoApproveReviews" type="indicator"></field>
      <field name="isDemoStore" type="indicator"></field>
      <field name="isImmediatelyFulfilled" type="indicator">
          <description>If immediately fulfilled (for physical stores, etc): don't send email notices, don't reserve inventory, and IFF inventory info isn't found on the server then don't issue inventory right away</description>
      </field>
      <field name="inventoryFacilityId" type="id"></field>
      <field name="oneInventoryFacility" type="indicator"></field>
      <field name="checkInventory" type="indicator"></field>
      <field name="reserveInventory" type="indicator"></field>
      <field name="reserveOrderEnumId" type="id"></field>
      <field name="requireInventory" type="indicator"></field>
      <field name="balanceResOnOrderCreation" type="indicator">
          <description>If set to Y, when a new sales order is created with backordered items, then reservations on the facility/product are reassigned according to the priority given by the shipBeforeDate field.</description>
      </field>
      <field name="requirementMethodEnumId" type="id"></field>
      <field name="orderNumberPrefix" type="id-long"></field>
      <field name="defaultLocaleString" type="very-short"></field>
      <field name="localeStrings" type="very-long"><description>JSON list of locales supported by this store, used to filter input and UserLogin.lastLocale (SCIPIO)</description></field>
      <field name="defaultCurrencyUomId" type="id"></field>
      <field name="currencyUomIds" type="very-long"><description>JSON list of currency UOMs supported by this store, used to filter input and UserLogin.lastCurrencyUom (SCIPIO)</description></field>
      <field name="defaultTimeZoneString" type="id-long"></field>
      <field name="defaultSalesChannelEnumId" type="id"></field>
      <field name="allowPassword" type="indicator"></field>
      <field name="defaultPassword" type="long-varchar"></field>
      <field name="explodeOrderItems" type="indicator"></field>
      <field name="checkGcBalance" type="indicator"></field>
      <field name="retryFailedAuths" type="indicator"></field>
      <field name="headerApprovedStatus" type="id"></field>
      <field name="itemApprovedStatus" type="id"></field>
      <field name="digitalItemApprovedStatus" type="id"></field>
      <field name="headerDeclinedStatus" type="id"></field>
      <field name="itemDeclinedStatus" type="id"></field>
      <field name="headerCancelStatus" type="id"></field>
      <field name="itemCancelStatus" type="id"></field>
      <field name="authDeclinedMessage" type="long-varchar"></field>
      <field name="authFraudMessage" type="long-varchar"></field>
      <field name="authErrorMessage" type="long-varchar"></field>
      <field name="visualThemeId" type="id"></field>
      <field name="storeCreditAccountEnumId" type="id">
          <description>Specify the type (Billing Account or Financial Account) of Store Credit Account used for refund return. Default to Financial Account. 
              This field is override by ReturnHeader.billingAccountId or ReturnHeader.finAccountId, whichever is specified but if only finAccountId is specified explicitly then system will first
              try to locate any billing account with -ve amount. If found, then amount is credit to this billing account else the amount will be credit to the financial account of the user.
          </description>
      </field>

      <field name="usePrimaryEmailUsername" type="indicator"></field>
      <field name="requireCustomerRole" type="indicator"></field>
      <field name="autoInvoiceDigitalItems" type="indicator"><description>Default Y. Invoice digital items when order is placed rather than waiting for completing order items (though shipment/fulfillment).</description></field>
      <field name="reqShipAddrForDigItems" type="indicator"><description>Default Y. Require Shipping Address for Digital Items? Note this only has an effect if there are ONLY digital goods in the cart.</description></field>
      <field name="showCheckoutGiftOptions" type="indicator"></field>
      <field name="selectPaymentTypePerItem" type="indicator"></field>
      <field name="showPricesWithVatTax" type="indicator"></field>
      <field name="showTaxIsExempt" type="indicator"><description>default Y; if set to N do not show isExempt checkbox for PartyTaxAuthInfo, always force to N</description></field>
      <field name="vatTaxAuthGeoId" type="id"></field>
      <field name="vatTaxAuthPartyId" type="id"></field>
      <field name="enableAutoSuggestionList" type="indicator"><description>The auto-suggestion list is a special ShoppingList that the addSuggestionsToShoppingList service will maintain for cross-sells of ordered items.</description></field>
      <field name="enableDigProdUpload" type="indicator"></field>
      <field name="prodSearchExcludeVariants" type="indicator"><description>default Y; if set to Y an additional constraint will of isVariant!=Y will be added to all product searches for the store</description></field>
      <field name="digProdUploadCategoryId" type="id"></field>
      <field name="autoOrderCcTryExp" type="indicator"><description>For auto-orders try other Credit Card expiration dates (if date is wrong or general failure where type not known)?</description></field>
      <field name="autoOrderCcTryOtherCards" type="indicator"><description>For auto-orders try other Credit Cards for the customer?</description></field>
      <field name="autoOrderCcTryLaterNsf" type="indicator"><description>For auto-orders if Credit Cards fails for NSF (Not Sufficient Funds) try again later?</description></field>
      <field name="autoOrderCcTryLaterMax" type="numeric"><description>For auto-orders if Credit Cards fails for NSF try again how many times?</description></field>
      <field name="storeCreditValidDays" type="numeric"><description>How many days that store credit is valid for. Null value implies no expiration.</description></field>
      <field name="autoApproveInvoice" type="indicator"><description>If Y or empty, sales invoices created from orders will be marked ready.</description></field>
      <field name="autoApproveOrder" type="indicator"><description>If N, orders will not be automatically approved when payment is authorized.</description></field>
      <field name="shipIfCaptureFails" type="indicator"><description>If N, the captureOrderPayments will cause a service error if credit card capture fails.</description></field>
      <field name="setOwnerUponIssuance" type="indicator"><description>If Y or empty, set the inventory item owner upon issuance.</description></field>
      <field name="reqReturnInventoryReceive" type="indicator"><description>Default N. This is the default value for the ReturnHeader.needsInventoryReceive field. If set to Y return will automatically go to the Received status when Accepted instead of waiting for actual receipt of the return.</description></field>
      <field name="addToCartRemoveIncompat" type="indicator"><description>Default N. If Y then on add to cart remove all products in cart with a ProductAssoc record related to or from the product and with the PRODUCT_INCOMPATABLE type.</description></field>
      <field name="addToCartReplaceUpsell" type="indicator"><description>Default N. If Y then on add to cart remove all products in cart with a ProductAssoc record related from the product and with the PRODUCT_UPGRADE type.</description></field>
      <field name="splitPayPrefPerShpGrp" type="indicator"><description>Default N. If Y then before the order is stored the OrderPaymentPreference record will be split, one for each OrderItemShipGroup.</description></field>
      <field name="managedByLot" type="indicator"><description>If Y, the preparator can choose the InventoryItem by this lotId when he makes the picklist.</description></field>
      <field name="showOutOfStockProducts" type="indicator"><description>Default Y. If N then out of stock products will not be displayed on site</description></field>
      <field name="orderDecimalQuantity" type="indicator"><description>use to indicate if decimal quantity can be ordered for this productStore. Default value is Y</description></field>
        
        <!-- old fields, deprecated -->
        <field name="oldStyleSheet" col-name="STYLE_SHEET" type="url"></field>
        <field name="oldHeaderLogo" col-name="HEADER_LOGO" type="url"></field>
        <field name="oldHeaderMiddleBackground" col-name="HEADER_MIDDLE_BACKGROUND" type="url"></field>
        <field name="oldHeaderRightBackground" col-name="HEADER_RIGHT_BACKGROUND" type="url"></field>
        
      <prim-key field="productStoreId"/>
      <relation type="one" fk-name="PROD_STR_PRSTRGP" title="Primary" rel-entity-name="ProductStoreGroup">
        <key-map field-name="primaryStoreGroupId" rel-field-name="productStoreGroupId"/>
      </relation>
      <relation type="one" fk-name="PROD_STR_FACILITY" rel-entity-name="Facility">
        <key-map field-name="inventoryFacilityId" rel-field-name="facilityId"/>
      </relation>
      <relation type="one" fk-name="PROD_STR_RORDENUM" title="ReserveOrder" rel-entity-name="Enumeration">
        <key-map field-name="reserveOrderEnumId" rel-field-name="enumId"/>
      </relation>
      <relation type="one" fk-name="PROD_STR_RQMTENUM" title="RequirementMethod" rel-entity-name="Enumeration">
        <key-map field-name="requirementMethodEnumId" rel-field-name="enumId"/>
      </relation>
      <relation type="one" fk-name="PROD_STR_PAYTOPTY" rel-entity-name="Party">
        <key-map field-name="payToPartyId" rel-field-name="partyId"/>
      </relation>
      <relation type="one" fk-name="PROD_STR_CURUOM" rel-entity-name="Uom">
        <key-map field-name="defaultCurrencyUomId" rel-field-name="uomId"/>
      </relation>
      <relation type="one" fk-name="PROD_STR_SALECHN" title="DefaultSalesChannel" rel-entity-name="Enumeration">
        <key-map field-name="defaultSalesChannelEnumId" rel-field-name="enumId"/>
      </relation>
      <relation type="one" fk-name="PROD_STR_HAPSTS" title="HeaderApproved" rel-entity-name="StatusItem">
        <key-map field-name="headerApprovedStatus" rel-field-name="statusId"/>
      </relation>
      <relation type="one" fk-name="PROD_STR_IAPSTS" title="ItemApproved" rel-entity-name="StatusItem">
        <key-map field-name="itemApprovedStatus" rel-field-name="statusId"/>
      </relation>
      <relation type="one" fk-name="PROD_STR_DIAPSTS" title="DigitalItemApproved" rel-entity-name="StatusItem">
        <key-map field-name="digitalItemApprovedStatus" rel-field-name="statusId"/>
      </relation>
      <relation type="one" fk-name="PROD_STR_HDCSTS" title="HeaderDeclined" rel-entity-name="StatusItem">
        <key-map field-name="headerDeclinedStatus" rel-field-name="statusId"/>
      </relation>
      <relation type="one" fk-name="PROD_STR_IDCSTS" title="ItemDeclined" rel-entity-name="StatusItem">
        <key-map field-name="itemDeclinedStatus" rel-field-name="statusId"/>
      </relation>
      <relation type="one" fk-name="PROD_STR_HCNSTS" title="HeaderCancel" rel-entity-name="StatusItem">
        <key-map field-name="headerCancelStatus" rel-field-name="statusId"/>
      </relation>
      <relation type="one" fk-name="PROD_STR_ICNSTS" title="ItemCancel" rel-entity-name="StatusItem">
        <key-map field-name="itemCancelStatus" rel-field-name="statusId"/>
      </relation>
      <relation type="one" fk-name="PROD_STR_VATTXA" title="Vat" rel-entity-name="TaxAuthority">
        <key-map field-name="vatTaxAuthGeoId" rel-field-name="taxAuthGeoId"/>
        <key-map field-name="vatTaxAuthPartyId" rel-field-name="taxAuthPartyId"/>
      </relation>
      <relation type="one" fk-name="PROD_STR_STRCRDACT" title="StoreCreditAccount" rel-entity-name="Enumeration">
        <key-map field-name="storeCreditAccountEnumId" rel-field-name="enumId"/>
      </relation>
    </entity>
    <!-- SCIPIO: New fields for ProductStore -->
    <extend-entity entity-name="ProductStore">
        <field name="reqPayMethForFreeOrders" type="indicator"><description>SCIPIO: Default Y. If set to N, orders with total zero may go through without payment method selected.</description></field>
        <field name="isContentReference" type="indicator"><description>SCIPIO: Default N. If set to Y, this store's defaultLocaleString
            (and potentially other settings) is considered the default for its member content records (product/category content, etc.).
            This is used in multi-store setting by Solr to determine which defaultLocaleString should be used for fields and content that have no localeString and associated to multiple stores.
            NOTE: 2020-02-03: If multiple stores being considered for a product lookup have isContentReference, they are prioritized by lowest defaultPriority value;
            if none of the stores looked up have this flag set to Y, the one with lowest defaultPriority value is used as the content reference store.</description></field>
        <field name="showDiscontinuedProducts" type="indicator"><description>SCIPIO: Default Y. If N, products that have reached their salesDiscontinuationDate will not be shown.</description></field>
        <field name="useVariantStockCalc" type="indicator"><description>SCIPIO: Default N. If Y, the calculation for showOutOfStockProducts in store for virtual products will include their variants.</description></field>
        <field name="useAnonShoppingList" type="indicator"><description>SCIPIO: Default N. If Y, the store will support anonymous ShoppingList persisted on device; this is distinct from the auto-save ShoppingList (autoSaveCart) sometimes referred to as the "guest" list.</description></field>
        <field name="defaultPriority" type="numeric"><description>SCIPIO: Default store lookup priority when looking up a store for a product; lower value means higher priority. Used in conjunction with isContentReference and elsewhere.</description></field>
        <field name="reviewsPurchased" type="indicator"><description>SCIPIO: Default N. If Y, the store will support product reviews for purchased products.</description></field>
        <field name="multipleReviews" type="indicator"><description>SCIPIO: Default N. If Y, the store will support multiple product reviews for unregistered per user.</description></field>
        
        <!-- SCIPIO: added 2.1.0: New indicator field that enables abandoned cart storing + abandoned cart email reminders config -->
        <field name="saveAbandonedCart" type="indicator"><description>SCIPIO: Default Y. If Y, ShoppingCart will be save as an abandoned cart when session expires.</description></field>
        <field name="sendAbandonedCartReminder" type="indicator"><description>SCIPIO: Default N. If Y, abandoned ShoppingCart reminder email will be sent to customers.</description></field>
        <field name="maxAbandonedCartReminderRetry" type="numeric"><description>SCIPIO: Default 1. Number of retry times email reminder will be sent</description></field>
        <field name="abandonedCartReminderDayOffset" type="numeric"><description>SCIPIO: Default 1. Number of days after abandoned cart is created email reminder will start</description></field>
        <!-- SCIPIO: added 2.1.0: New indicator field that controls whether an email must be sent when a shipment status changes to SHIPMENT_DELIVERED
            Falls back to shipment.email.notification.delivered in shipment.properties if null
        -->
        <field name="notificationEmailShipmentDelivered" type="indicator"><description>SCIPIO: Default N. If Y, an email will be sent when a shipment status changes to SHIPMENT_DELIVERED.</description></field>
    </extend-entity>

    <!-- SCIPIO: 2.1.0: Added new ProductStoreAttribute entity in order to hold non-standard store fields -->
    <entity entity-name="ProductStoreAttribute"
            package-name="org.ofbiz.product.store"
            title="Product Store Attribute"
            default-resource-name="ProductEntityLabels">
        <field name="productStoreId" type="id-ne"></field>
        <field name="attrName" type="id-long-ne"></field>
        <field name="attrValue" type="value"></field>
        <field name="attrType" type="id-long-ne"></field>
        <field name="attrDescription" type="description"></field>
        <prim-key field="productStoreId"/>
        <prim-key field="attrName"/>
        <prim-key field="attrType"/>
        <relation type="one" fk-name="PROD_STR_ATTR" rel-entity-name="ProductStore">
            <key-map field-name="productStoreId"/>
        </relation>
        <relation type="many" rel-entity-name="ProductStoreTypeAttr">
            <key-map field-name="attrType"/>
        </relation>
    </entity>
    <entity entity-name="ProductStoreTypeAttr"
            package-name="org.ofbiz.product.store"
            title="Product Store Type Attribute">
        <field name="productStoreId" type="id-ne"></field>
        <field name="attrType" type="id-long-ne"></field>
        <field name="description" type="description"></field>
        <prim-key field="productStoreId"/>
        <prim-key field="attrType"/>
        <relation type="many" rel-entity-name="ProductStoreAttribute">
            <key-map field-name="attrType"/>
        </relation>
        <relation type="many" rel-entity-name="ProductStore">
            <key-map field-name="productStoreId"/>
        </relation>
    </entity>

    <entity entity-name="ProductStoreCatalog"
            package-name="org.ofbiz.product.store"
            title="Product Store Catalog Association">
      <field name="productStoreId" type="id-ne"></field>
      <field name="prodCatalogId" type="id-ne"></field>
      <field name="fromDate" type="date-time"></field>
      <field name="thruDate" type="date-time"></field>
      <field name="sequenceNum" type="numeric"></field>
      <prim-key field="productStoreId"/>
      <prim-key field="prodCatalogId"/>
      <prim-key field="fromDate"/>
      <relation type="one" fk-name="PS_CAT_PRDSTR" rel-entity-name="ProductStore">
        <key-map field-name="productStoreId"/>
      </relation>
      <relation type="one" fk-name="PS_CAT_CATALOG" rel-entity-name="ProdCatalog">
        <key-map field-name="prodCatalogId"/>
      </relation>
    </entity>
    <entity entity-name="ProductStoreEmailSetting"
            package-name="org.ofbiz.product.store"
            title="Product Store Email Settings">
      <field name="productStoreId" type="id-ne"></field>
      <field name="emailType" type="id-ne"></field>
      <field name="bodyScreenLocation" type="long-varchar"><description>if empty defaults to a screen based on the emailType</description></field>
      <field name="xslfoAttachScreenLocation" type="long-varchar"><description>if specified is used to generate XSL:FO that is transformed to a PDF via Apache FOP and attached to the email</description></field>
      <field name="fromAddress" type="email"></field>
      <!-- SCIPIO: 11-19-2020: Added "send as" which serves as an alias for "From" field-->
      <field name="sendAs" type="short-varchar"></field>
      <field name="ccAddress" type="email"></field>
      <field name="bccAddress" type="email"></field>
      <field name="subject" type="comment"></field>
      <field name="contentType" type="long-varchar"></field>
      <prim-key field="productStoreId"/>
      <prim-key field="emailType"/>
      <relation type="one" fk-name="PRDSTREM_PRDS" rel-entity-name="ProductStore">
        <key-map field-name="productStoreId"/>
      </relation>
      <relation type="one" fk-name="PRDSTREM_ENUM" rel-entity-name="Enumeration">
        <key-map field-name="emailType" rel-field-name="enumId"/>
      </relation>
    </entity>
    <entity entity-name="ProductStoreFinActSetting"
                package-name="org.ofbiz.product.store"
                title="Allows financial account, such as gift certificate or calling cards, to be configured at store level">
      <field name="productStoreId" type="id-ne"/>
      <field name="finAccountTypeId" type="id-ne"/>
      <field name="requirePinCode" type="indicator"/>
      <field name="validateGCFinAcct" type="indicator">
          <description>determines whether the store should validate gift card numbers against the gift certificate codes stored in FinAccount.
              Set to N if using external gift card provider.</description>
      </field>
      <field name="accountCodeLength" type="numeric">
        <description>length of auto-generated account code</description>
      </field>
      <field name="pinCodeLength" type="numeric">
        <description>length of auto-generated pin code, if it is required</description>
      </field>
      <field name="accountValidDays" type="numeric">
        <description>number of days an account of this type would be valid for</description>
      </field>
      <field name="authValidDays" type="numeric">
        <description>number of days an authorization of this type would be valid for</description>
      </field>
      <field name="purchaseSurveyId" type="id">
        <description>This survey is typically used to collect information such as name of buyer, recipient, email, message, etc. and is quite flexible</description>
      </field>
      <field name="purchSurveySendTo" type="id">
        <description>Field name on the purchase survey with the send to email address</description>
      </field>
      <field name="purchSurveyCopyMe" type="id">
        <description>Whether the BCC on ProductStoreEmailSetting should be copied for email notifications</description>
      </field>
      <field name="allowAuthToNegative" type="indicator"></field>
      <field name="minBalance" type="currency-amount"></field>
      <field name="replenishThreshold" type="currency-amount"></field>
      <field name="replenishMethodEnumId" type="id">
        <description>Replenish Method for Replenish Account. Can be FARP_TOP_OFF or FARP_REPLENISH_LEVEL. Default FARP_TOP_OFF.</description>
      </field>
      <prim-key field="productStoreId"/>
      <prim-key field="finAccountTypeId"/>
      <relation rel-entity-name="ProductStore" type="one" fk-name="PRSTFNAC_PRDS">
        <key-map field-name="productStoreId"/>
      </relation>
      <relation rel-entity-name="FinAccountType" type="one" fk-name="PRSTFNAC_FNACTP">
        <key-map field-name="finAccountTypeId"/>
      </relation>
      <relation rel-entity-name="Survey" type="one" fk-name="PRSTFNAC_SRVY">
        <key-map field-name="purchaseSurveyId" rel-field-name="surveyId"/>
      </relation>
      <relation type="one" fk-name="PRSTFNAC_FARPMTD" title="ReplenishMethod" rel-entity-name="Enumeration">
        <key-map field-name="replenishMethodEnumId" rel-field-name="enumId"/>
      </relation>
    </entity>
    <entity entity-name="ProductStoreFacility"
            package-name="org.ofbiz.product.store"
            title="Product Store Inventory Facility Applicability">
      <field name="productStoreId" type="id-ne"></field>
      <field name="facilityId" type="id-ne"></field>
      <field name="fromDate" type="date-time"></field>
      <field name="thruDate" type="date-time"></field>
      <field name="sequenceNum" type="numeric"></field>
      <prim-key field="productStoreId"/>
      <prim-key field="facilityId"/>
      <prim-key field="fromDate"/>
      <relation type="one" fk-name="PRDSTRFAC_PRDS" rel-entity-name="ProductStore">
        <key-map field-name="productStoreId"/>
      </relation>
      <relation type="one" fk-name="PRDSTRFAC_FAC" rel-entity-name="Facility">
        <key-map field-name="facilityId"/>
      </relation>
    </entity>
    <view-entity entity-name="ProductStoreFacilityByOrder"
            package-name="org.ofbiz.product.store"
            title="Product Store Facility By Order">
        <member-entity entity-alias="ORH" entity-name="OrderHeader"/>
        <member-entity entity-alias="PSF" entity-name="ProductStoreFacility"/>
        <member-entity entity-alias="PDS" entity-name="ProductStore"/>
        <member-entity entity-alias="FAC" entity-name="Facility"/>
        <alias entity-alias="ORH" name="orderId"/>
        <alias entity-alias="PSF" name="productStoreId"/>
        <alias entity-alias="PSF" name="facilityId"/>
        <alias entity-alias="PSF" name="fromDate"/>
        <alias entity-alias="PSF" name="thruDate"/>
        <alias entity-alias="PSF" name="sequenceNum"/>
        <alias entity-alias="PDS" name="storeName"/>
        <alias entity-alias="FAC" name="facilityName"/>
        <alias entity-alias="FAC" name="facilityTypeId"/>
        <view-link entity-alias="ORH" rel-entity-alias="PSF">
            <key-map field-name="productStoreId"/>
        </view-link>
        <view-link entity-alias="PSF" rel-entity-alias="PDS">
            <key-map field-name="productStoreId"/>
        </view-link>
        <view-link entity-alias="PSF" rel-entity-alias="FAC">
            <key-map field-name="facilityId"/>
        </view-link>
    </view-entity>
    <entity entity-name="ProductStoreGroup"
            package-name="org.ofbiz.product.store"
            default-resource-name="ProductEntityLabels"
            title="ProductStore Group">
      <field name="productStoreGroupId" type="id-ne"></field>
      <field name="productStoreGroupTypeId" type="id"></field>
      <field name="primaryParentGroupId" type="id"></field>
      <field name="productStoreGroupName" type="name"></field>
      <field name="description" type="description"></field>
      <prim-key field="productStoreGroupId"/>
      <relation type="one" fk-name="PRDSTR_GP_TYPE" rel-entity-name="ProductStoreGroupType">
        <key-map field-name="productStoreGroupTypeId"/>
      </relation>
      <relation type="one" fk-name="PRDSTR_GP_PGRP" title="PrimaryParent" rel-entity-name="ProductStoreGroup">
        <key-map field-name="primaryParentGroupId" rel-field-name="productStoreGroupId"/>
      </relation>
    </entity>
    <entity entity-name="ProductStoreGroupMember"
            package-name="org.ofbiz.product.store"
            title="ProductStore Group Member">
      <field name="productStoreId" type="id-ne"></field>
      <field name="productStoreGroupId" type="id-ne"></field>
      <field name="fromDate" type="date-time"></field>
      <field name="thruDate" type="date-time"></field>
      <field name="sequenceNum" type="numeric"></field>
      <prim-key field="productStoreId"/>
      <prim-key field="productStoreGroupId"/>
      <prim-key field="fromDate"/>
      <relation type="one" fk-name="PRDSTR_MEM_PRDSTR" rel-entity-name="ProductStore">
        <key-map field-name="productStoreId"/>
      </relation>
      <relation type="one" fk-name="PRDSTR_MEM_PSGRP" rel-entity-name="ProductStoreGroup">
        <key-map field-name="productStoreGroupId"/>
      </relation>
    </entity>
    <entity entity-name="ProductStoreGroupRole"
            package-name="org.ofbiz.product.store"
            title="ProductStore Group Role">
      <field name="productStoreGroupId" type="id-ne"></field>
      <field name="partyId" type="id"></field>
      <field name="roleTypeId" type="id"></field>
      <prim-key field="productStoreGroupId"/>
      <prim-key field="partyId"/>
      <prim-key field="roleTypeId"/>
      <relation type="one" fk-name="PSGRP_RLE_PSGP" rel-entity-name="ProductStoreGroup">
        <key-map field-name="productStoreGroupId"/>
      </relation>
      <relation type="one" fk-name="PSGRP_RLE_PTRLE" rel-entity-name="PartyRole">
        <key-map field-name="partyId"/>
        <key-map field-name="roleTypeId"/>
      </relation>
      <relation type="one-nofk" rel-entity-name="Party">
        <key-map field-name="partyId"/>
      </relation>
      <relation type="one-nofk" rel-entity-name="RoleType">
        <key-map field-name="roleTypeId"/>
      </relation>
    </entity>
    <entity entity-name="ProductStoreGroupRollup"
            package-name="org.ofbiz.product.store"
            title="ProductStore Group Rollup">
      <field name="productStoreGroupId" type="id-ne"></field>
      <field name="parentGroupId" type="id-ne"></field>
      <field name="fromDate" type="date-time"></field>
      <field name="thruDate" type="date-time"></field>
      <field name="sequenceNum" type="numeric"></field>
      <prim-key field="productStoreGroupId"/>
      <prim-key field="parentGroupId"/>
      <prim-key field="fromDate"/>
      <relation type="one" fk-name="PSGRP_RLP_CURRENT" title="Current" rel-entity-name="ProductStoreGroup">
        <key-map field-name="productStoreGroupId"/>
      </relation>
      <relation type="one" fk-name="PSGRP_RLP_PARENT" title="Parent" rel-entity-name="ProductStoreGroup">
        <key-map field-name="parentGroupId" rel-field-name="productStoreGroupId"/>
      </relation>
      <relation type="many" title="Child" rel-entity-name="ProductStoreGroupRollup">
        <key-map field-name="productStoreGroupId" rel-field-name="parentGroupId"/>
      </relation>
      <relation type="many" title="Parent" rel-entity-name="ProductStoreGroupRollup">
        <key-map field-name="parentGroupId" rel-field-name="productStoreGroupId"/>
      </relation>
      <relation type="many" title="Sibling" rel-entity-name="ProductStoreGroupRollup">
        <key-map field-name="parentGroupId"/>
      </relation>
    </entity>
    <entity entity-name="ProductStoreGroupType"
            package-name="org.ofbiz.product.store"
            title="ProductStore Group Type">
      <field name="productStoreGroupTypeId" type="id-ne"></field>
      <field name="description" type="description"></field>
      <prim-key field="productStoreGroupTypeId"/>
    </entity>
    <entity entity-name="ProductStoreKeywordOvrd"
            package-name="org.ofbiz.product.store"
            title="Product Store Inventory Facility Applicability">
      <field name="productStoreId" type="id-ne"></field>
      <field name="keyword" type="short-varchar"></field>
      <field name="fromDate" type="date-time"></field>
      <field name="thruDate" type="date-time"></field>
      <field name="target" type="long-varchar"></field>
      <field name="targetTypeEnumId" type="id"></field>
      <prim-key field="productStoreId"/>
      <prim-key field="keyword"/>
      <prim-key field="fromDate"/>
      <relation type="one" fk-name="PRDSTRKWO_PRDS" rel-entity-name="ProductStore">
        <key-map field-name="productStoreId"/>
      </relation>
      <relation type="one" fk-name="PRDSTRKWO_ENM" rel-entity-name="Enumeration">
        <key-map field-name="targetTypeEnumId" rel-field-name="enumId"/>
      </relation>
    </entity>
    <entity entity-name="ProductStorePaymentSetting"
            package-name="org.ofbiz.product.store"
            title="Product Store Payment Settings">
      <field name="productStoreId" type="id-ne"></field>
      <field name="paymentMethodTypeId" type="id-ne"></field>
      <field name="paymentServiceTypeEnumId" type="id-ne"></field>
      <field name="paymentService" type="value"></field>
      <field name="paymentCustomMethodId" type="id"></field>
      <field name="paymentGatewayConfigId" type="id"></field>
      <field name="paymentPropertiesPath" type="value"></field>
      <field name="applyToAllProducts" type="indicator"></field>
      <prim-key field="productStoreId"/>
      <prim-key field="paymentMethodTypeId"/>
      <prim-key field="paymentServiceTypeEnumId"/>
      <relation type="one" fk-name="PRDS_PS_PRDS" rel-entity-name="ProductStore">
        <key-map field-name="productStoreId"/>
      </relation>
      <relation type="one" fk-name="PRDS_PS_PMNTTP" rel-entity-name="PaymentMethodType">
        <key-map field-name="paymentMethodTypeId"/>
      </relation>
      <relation type="one" fk-name="PRDS_PS_ENUM" rel-entity-name="Enumeration">
        <key-map field-name="paymentServiceTypeEnumId" rel-field-name="enumId"/>
      </relation>
      <relation type="one" fk-name="PRDS_PS_PGC" rel-entity-name="PaymentGatewayConfig">
        <key-map field-name="paymentGatewayConfigId"/>
      </relation>
      <relation type="one" fk-name="PRDS_PS_CUS_MET" rel-entity-name="CustomMethod">
        <key-map field-name="paymentCustomMethodId" rel-field-name="customMethodId"/>
      </relation>
    </entity>
    <view-entity entity-name="ProductStorePromoAndAppl"
            package-name="org.ofbiz.product.store"
            title="Product Store Promotion and Applicability View">
      <member-entity entity-alias="PSPA" entity-name="ProductStorePromoAppl"/>
      <member-entity entity-alias="PP" entity-name="ProductPromo"/>
      <alias-all entity-alias="PSPA"/>
      <alias entity-alias="PP" name="promoName"/>
      <alias entity-alias="PP" name="userEntered"/>
      <view-link entity-alias="PSPA" rel-entity-alias="PP">
          <key-map field-name="productPromoId"/>
      </view-link>
    </view-entity>
    <entity entity-name="ProductStorePromoAppl"
            package-name="org.ofbiz.product.store"
            title="Product Store Promotion Applicability">
      <field name="productStoreId" type="id-ne"></field>
      <field name="productPromoId" type="id-ne"></field>
      <field name="fromDate" type="date-time"></field>
      <field name="thruDate" type="date-time"></field>
      <field name="sequenceNum" type="numeric"></field>
      <field name="manualOnly" type="indicator">
          <description>
              If set to Y then the promotion is not automatically evaluated, but only if it
              is manually added to the cart.
          </description>
      </field>
      <prim-key field="productStoreId"/>
      <prim-key field="productPromoId"/>
      <prim-key field="fromDate"/>
      <relation type="one" fk-name="PRDSTRPRMO_PRDS" rel-entity-name="ProductStore">
        <key-map field-name="productStoreId"/>
      </relation>
      <relation type="one" fk-name="PRDSTRPRMO_PRMO" rel-entity-name="ProductPromo">
        <key-map field-name="productPromoId"/>
      </relation>
    </entity>
    <entity entity-name="ProductStoreRole"
            package-name="org.ofbiz.product.store"
            title="Product Store Role Association">
      <field name="partyId" type="id-ne"></field>
      <field name="roleTypeId" type="id-ne"></field>
      <field name="productStoreId" type="id-ne"></field>
      <field name="fromDate" type="date-time"></field>
      <field name="thruDate" type="date-time"></field>
      <field name="sequenceNum" type="numeric"></field>
      <prim-key field="partyId"/>
      <prim-key field="roleTypeId"/>
      <prim-key field="productStoreId"/>
      <prim-key field="fromDate"/>
      <relation type="one-nofk" rel-entity-name="Party">
        <key-map field-name="partyId"/>
      </relation>
      <relation type="one-nofk" rel-entity-name="RoleType">
        <key-map field-name="roleTypeId"/>
      </relation>
      <relation type="one-nofk" rel-entity-name="Person">
        <key-map field-name="partyId"/>
      </relation>
      <relation type="one-nofk" rel-entity-name="PartyGroup">
        <key-map field-name="partyId"/>
      </relation>
      <relation type="one" fk-name="PRDSTRRLE_PRLE" rel-entity-name="PartyRole">
        <key-map field-name="partyId"/>
        <key-map field-name="roleTypeId"/>
      </relation>
      <relation type="one" fk-name="PRDSTRRLE_PRDS" rel-entity-name="ProductStore">
        <key-map field-name="productStoreId"/>
      </relation>
    </entity>
    <entity entity-name="ProductStoreShipmentMeth"
            package-name="org.ofbiz.product.store"
            title="Product Store Carrier Shipment Method">
      <field name="productStoreShipMethId" type="id-ne"></field>
      <field name="productStoreId" type="id-ne"></field>
      <field name="shipmentMethodTypeId" type="id-ne"></field>
      <field name="partyId" type="id-ne"></field>
      <field name="roleTypeId" type="id-ne"></field>
      <field name="companyPartyId" type="id"></field>
      <field name="minWeight" type="fixed-point"></field>
      <field name="maxWeight" type="fixed-point"></field>
      <field name="minSize" type="fixed-point"></field>
      <field name="maxSize" type="fixed-point"></field>
      <field name="minTotal" type="currency-amount"></field>
      <field name="maxTotal" type="currency-amount"></field>
      <field name="allowUspsAddr" type="indicator"></field>
      <field name="requireUspsAddr" type="indicator"></field>
      <field name="allowCompanyAddr" type="indicator"></field>
      <field name="requireCompanyAddr" type="indicator"></field>
      <field name="includeNoChargeItems" type="indicator"></field>
      <field name="includeFeatureGroup" type="id"></field>
      <field name="excludeFeatureGroup" type="id"></field>
      <field name="includeGeoId" type="id"></field>
      <field name="excludeGeoId" type="id"></field>
      <field name="serviceName" type="long-varchar"></field>
      <field name="configProps" type="long-varchar"></field>
      <field name="shipmentCustomMethodId" type="id"></field>
      <field name="shipmentGatewayConfigId" type="id"></field>
      <field name="sequenceNumber" type="numeric"></field>
      <prim-key field="productStoreShipMethId"/>
      <relation type="one-nofk" rel-entity-name="Party">
        <key-map field-name="companyPartyId" rel-field-name="partyId"/>
      </relation>
      <relation type="one" rel-entity-name="ShipmentMethodType">
        <key-map field-name="shipmentMethodTypeId"/>
      </relation>
      <relation type="one-nofk" title="Include"  rel-entity-name="Geo">
        <key-map field-name="includeGeoId" rel-field-name="geoId"/>
      </relation>
      <relation type="one-nofk" title="Exclude" rel-entity-name="Geo">
        <key-map field-name="excludeGeoId" rel-field-name="geoId"/>
      </relation>
      <relation type="one" fk-name="PRDS_SM_SGC" rel-entity-name="ShipmentGatewayConfig">
        <key-map field-name="shipmentGatewayConfigId"/>
      </relation>
      <relation type="one" fk-name="PRDS_SM_CUS_MET" rel-entity-name="CustomMethod">
        <key-map field-name="shipmentCustomMethodId" rel-field-name="customMethodId"/>
      </relation>
    </entity>
    <view-entity entity-name="ProductStoreShipmentMethView"
            package-name="org.ofbiz.product.store"
            title="Product Store Carrier And Shipment Method Type View">
      <member-entity entity-alias="PSSM" entity-name="ProductStoreShipmentMeth"/>
      <member-entity entity-alias="SM" entity-name="ShipmentMethodType"/>
      <alias entity-alias="PSSM" name="productStoreShipMethId"/>
      <alias entity-alias="PSSM" name="productStoreId"/>
      <alias entity-alias="PSSM" name="shipmentMethodTypeId"/>
      <alias entity-alias="PSSM" name="partyId"/>
      <alias entity-alias="PSSM" name="roleTypeId"/>
      <alias entity-alias="PSSM" name="companyPartyId"/>
      <alias entity-alias="PSSM" name="minSize"/>
      <alias entity-alias="PSSM" name="maxSize"/>
      <alias entity-alias="PSSM" name="minTotal"/>
      <alias entity-alias="PSSM" name="maxTotal"/>
      <alias entity-alias="PSSM" name="minWeight"/>
      <alias entity-alias="PSSM" name="maxWeight"/>
      <alias entity-alias="PSSM" name="allowUspsAddr"/>
      <alias entity-alias="PSSM" name="requireUspsAddr"/>
      <alias entity-alias="PSSM" name="allowCompanyAddr"/>
      <alias entity-alias="PSSM" name="requireCompanyAddr"/>
      <alias entity-alias="PSSM" name="includeNoChargeItems"/>
      <alias entity-alias="PSSM" name="includeGeoId"/>
      <alias entity-alias="PSSM" name="excludeGeoId"/>
      <alias entity-alias="PSSM" name="includeFeatureGroup"/>
      <alias entity-alias="PSSM" name="excludeFeatureGroup"/>
      <alias entity-alias="PSSM" name="serviceName"/>
      <alias entity-alias="PSSM" name="configProps"/>
      <alias entity-alias="PSSM" name="shipmentCustomMethodId"/>
      <alias entity-alias="PSSM" name="shipmentGatewayConfigId"/>
      <alias entity-alias="PSSM" name="sequenceNumber"/>
      <alias entity-alias="SM" name="description"/>
      <view-link entity-alias="PSSM" rel-entity-alias="SM">
        <key-map field-name="shipmentMethodTypeId"/>
      </view-link>
      <relation type="one-nofk" rel-entity-name="Party">
        <key-map field-name="companyPartyId" rel-field-name="partyId"/>
      </relation>
      <relation type="one-nofk" title="Include"  rel-entity-name="Geo">
        <key-map field-name="includeGeoId" rel-field-name="geoId"/>
      </relation>
      <relation type="one-nofk" title="Exclude" rel-entity-name="Geo">
        <key-map field-name="excludeGeoId" rel-field-name="geoId"/>
      </relation>
      <relation type="one-nofk" rel-entity-name="PartyGroup">
        <key-map field-name="partyId"/>
      </relation>
      <relation type="one-nofk" rel-entity-name="ShipmentMethodType">
        <key-map field-name="shipmentMethodTypeId"/>
      </relation>
    </view-entity>
    <entity entity-name="ProductStoreSurveyAppl"
            package-name="org.ofbiz.product.store"
            title="Product Store Survey Application">
      <field name="productStoreSurveyId" type="id-ne"></field>
      <field name="productStoreId" type="id-ne"></field>
      <field name="surveyApplTypeId" type="id-ne"></field>
      <field name="groupName" type="name"></field>
      <field name="surveyId" type="id-ne"></field>
      <field name="productId" type="id"></field>
      <field name="productCategoryId" type="id"></field>
      <field name="fromDate" type="date-time"></field>
      <field name="thruDate" type="date-time"></field>
      <field name="surveyTemplate" type="long-varchar"></field>
      <field name="resultTemplate" type="long-varchar"></field>
      <field name="sequenceNum" type="numeric"></field>
      <prim-key field="productStoreSurveyId"/>
      <relation type="one" fk-name="PRDSTRSVY_PRDS" rel-entity-name="ProductStore">
        <key-map field-name="productStoreId"/>
      </relation>
      <relation type="one" fk-name="PRDSTRSVY_SRVY" rel-entity-name="Survey">
        <key-map field-name="surveyId"/>
      </relation>
      <relation type="one" fk-name="PRDSTRSVY_SATP" rel-entity-name="SurveyApplType">
        <key-map field-name="surveyApplTypeId"/>
      </relation>
      <relation type="one-nofk" rel-entity-name="Product">
        <key-map field-name="productId"/>
      </relation>
      <relation type="one-nofk" rel-entity-name="ProductCategory">
        <key-map field-name="productCategoryId"/>
      </relation>
    </entity>
    <entity entity-name="ProductStoreVendorPayment" package-name="org.ofbiz.product.store" title="Product Store Vendor Payment">
        <description>Used to define payments that a vendor related to the store will accept (for multi-vendor stores)</description>
        <field name="productStoreId" type="id-ne"/>
        <field name="vendorPartyId" type="id-ne"/>
        <field name="paymentMethodTypeId" type="id-ne"/>
        <field name="creditCardEnumId" type="id-ne"><description>If not applicable for the paymentMethodTypeId, use "_NA_"</description></field>
        <prim-key field="productStoreId"/>
        <prim-key field="vendorPartyId"/>
        <prim-key field="paymentMethodTypeId"/>
        <prim-key field="creditCardEnumId"/>
        <relation type="one" fk-name="PRDSTRVPM_PRDS" rel-entity-name="ProductStore">
            <key-map field-name="productStoreId"/>
        </relation>
        <relation type="one" fk-name="PRDSTRVPM_VPTY" title="Vendor" rel-entity-name="Party">
            <key-map field-name="vendorPartyId" rel-field-name="partyId"/>
        </relation>
        <relation type="one" fk-name="PRDSTRVPM_PMMT" rel-entity-name="PaymentMethodType">
            <key-map field-name="paymentMethodTypeId"/>
        </relation>
        <relation type="one" fk-name="PRDSTRVPM_CCEN" title="CreditCard" rel-entity-name="Enumeration">
            <key-map field-name="creditCardEnumId" rel-field-name="enumId"/>
        </relation>
    </entity>
    <entity entity-name="ProductStoreVendorShipment" package-name="org.ofbiz.product.store" title="Product Store Vendor Shipment">
        <description>Used to define Carrier-ShipmentMethod combinations that a vendor related to the store will accept (for multi-vendor stores)</description>
        <field name="productStoreId" type="id-ne"/>
        <field name="vendorPartyId" type="id-ne"/>
        <field name="shipmentMethodTypeId" type="id-ne"/>
        <field name="carrierPartyId" type="id-ne"/>
        <prim-key field="productStoreId"/>
        <prim-key field="vendorPartyId"/>
        <prim-key field="shipmentMethodTypeId"/>
        <prim-key field="carrierPartyId"/>
        <relation type="one" fk-name="PRDSTRVSH_PRDS" rel-entity-name="ProductStore">
            <key-map field-name="productStoreId"/>
        </relation>
        <relation type="one" fk-name="PRDSTRVSH_VPTY" title="Vendor" rel-entity-name="Party">
            <key-map field-name="vendorPartyId" rel-field-name="partyId"/>
        </relation>
        <relation type="one" fk-name="PRDSTRVSH_SHMT" rel-entity-name="ShipmentMethodType">
            <key-map field-name="shipmentMethodTypeId"/>
        </relation>
        <relation type="one" fk-name="PRDSTRVSH_CPTY" title="Carrier" rel-entity-name="Party">
            <key-map field-name="carrierPartyId" rel-field-name="partyId"/>
        </relation>
    </entity>
    <extend-entity entity-name="WebSite">
        <field name="productStoreId" type="id"></field>
        <field name="allowProductStoreChange" type="indicator"><description>Allow change of ProductStore for this WebSite (webapp). Defaults to N (no).</description></field>
        <field name="isDefault" type="indicator"><description>If Y then it is default WebSite</description></field>
        <field name="isStoreDefault" type="indicator"><description>SCIPIO: If Y then it is default WebSite for its ProductStore (added 2018-09-26)</description></field>
        <relation type="one" fk-name="WEB_SITE_PRDS" rel-entity-name="ProductStore">
            <key-map field-name="productStoreId"/>
        </relation>
    </extend-entity>
    <!-- SCIPIO -->
    <entity entity-name="ProductStoreMarketplace"
            package-name="org.ofbiz.product.store"
            title="Product Store Marketplace">
        <description>Defines (external) marketplace linked to a ProductStore</description>
        <field name="marketplaceId" type="id-ne"></field>
        <field name="productStoreId" type="id-ne"></field>
        <field name="orderFulfillmentChannelEnumId" type="id-ne">
            <description>Represents in which way logistics are taken care of (marketplace or store)</description>
        </field>
        <field name="fromDate" type="date-time"></field>
        <field name="thruDate" type="date-time"></field>
        <prim-key field="marketplaceId"/>
        <prim-key field="productStoreId"/>
        <prim-key field="orderFulfillmentChannelEnumId"/>
        <prim-key field="fromDate"/>
        <relation type="one" fk-name="PRDSTRMKTPLC_PRDS" rel-entity-name="ProductStore">
            <key-map field-name="productStoreId"/>
        </relation>
        <relation type="one" fk-name="PRDSTRMKTPLC_OFC_ENUM" title="OrderFulfillmentChannel" rel-entity-name="Enumeration">
            <key-map field-name="orderFulfillmentChannelEnumId" rel-field-name="enumId"/>
        </relation>
    </entity>

    <!-- ========================================================= -->
    <!-- org.ofbiz.product.subscription -->
    <!-- ========================================================= -->

    <entity entity-name="ProductSubscriptionResource"
            package-name="org.ofbiz.product.subscription"
            title="Product Subscription Resource">
        <field name="productId" type="id-ne"></field>
        <field name="subscriptionResourceId" type="id-ne"></field>
        <field name="fromDate" type="date-time"></field>
        <field name="thruDate" type="date-time"></field>
        <field name="purchaseFromDate" type="date-time"></field>
        <field name="purchaseThruDate" type="date-time"></field>
        <field name="maxLifeTime" type="numeric"><description>The length in time of the subscription</description></field>
        <field name="maxLifeTimeUomId" type="id"></field>
        <field name="availableTime" type="numeric"></field>
        <field name="availableTimeUomId" type="id"></field>
        <field name="useCountLimit" type="numeric"></field>
        <field name="useTime" type="numeric"><description>The length of time this subscription can be used</description></field>
        <field name="useTimeUomId" type="id"></field>
        <field name="useRoleTypeId" type="id"></field>
        <field name="automaticExtend" type="indicator"><description>If this subscription is automatically extended with the same period as the initial period.</description></field>
        <field name="canclAutmExtTime" type="numeric"><description>The time period (before the end of the thruDate) after which the automatic extension of the subscription will be executed.</description></field>
        <field name="canclAutmExtTimeUomId" type="id"><description>Unit Of Measure used for the automatic extension of the subscription.</description></field>
        <field name="gracePeriodOnExpiry" type="numeric"><description>The time period (after the end of the thruDate) after which the subscription will be expired.</description></field>
        <field name="gracePeriodOnExpiryUomId" type="id"><description>Unit Of Measure used for the grace period of the subscription.</description></field>
        <prim-key field="productId"/>
        <prim-key field="subscriptionResourceId"/>
        <prim-key field="fromDate"/>
        <relation type="one" fk-name="PROD_SBRS_PROD" rel-entity-name="Product">
            <key-map field-name="productId"/>
        </relation>
        <relation type="one" fk-name="PROD_SBRS_SBRS" rel-entity-name="SubscriptionResource">
            <key-map field-name="subscriptionResourceId"/>
        </relation>
        <relation type="one" fk-name="PROD_SBRS_URT" title="Use" rel-entity-name="RoleType">
            <key-map field-name="useRoleTypeId" rel-field-name="roleTypeId"/>
        </relation>
        <relation type="one" fk-name="PROD_SBRS_UTU" title="UseTime" rel-entity-name="Uom">
            <key-map field-name="useTimeUomId" rel-field-name="uomId"/>
        </relation>
        <relation type="one" fk-name="PROD_SBRS_CTU" title="CancelTime" rel-entity-name="Uom">
            <key-map field-name="canclAutmExtTimeUomId" rel-field-name="uomId"/>
        </relation>
        <relation type="one" fk-name="PROD_SBRS_ATU" title="AvailableTime" rel-entity-name="Uom">
            <key-map field-name="availableTimeUomId" rel-field-name="uomId"/>
        </relation>
        <relation type="one" fk-name="PROD_SBRS_MTU" title="MaxLifeTime" rel-entity-name="Uom">
            <key-map field-name="maxLifeTimeUomId" rel-field-name="uomId"/>
        </relation>
        <relation type="one" fk-name="PROD_SBRS_GTU" title="GracePeriod" rel-entity-name="Uom">
            <key-map field-name="gracePeriodOnExpiryUomId" rel-field-name="uomId"/>
        </relation>
    </entity>
    <entity entity-name="Subscription"
            package-name="org.ofbiz.product.subscription"
            title="Subscription">
        <field name="subscriptionId" type="id-ne"></field>
        <field name="description" type="description"></field>
        <field name="subscriptionResourceId" type="id"></field>
        <field name="communicationEventId" type="id"><description>now replaced by entity: SubscriptionCommEvent</description></field>
        <field name="contactMechId" type="id"></field>
        <field name="originatedFromPartyId" type="id"></field>
        <field name="originatedFromRoleTypeId" type="id"></field>
        <field name="partyId" type="id"></field>
        <field name="roleTypeId" type="id"></field>
        <field name="partyNeedId" type="id"></field>
        <field name="needTypeId" type="id"></field>
        <field name="orderId" type="id"></field>
        <field name="orderItemSeqId" type="id"></field>
        <field name="productId" type="id"></field>
        <field name="productCategoryId" type="id"></field>
        <field name="inventoryItemId" type="id"></field>
        <field name="subscriptionTypeId" type="id"></field>
        <field name="externalSubscriptionId" type="id"></field>
        <field name="fromDate" type="date-time"></field>
        <field name="thruDate" type="date-time"></field>
        <!-- this subscription instance resource values -->
        <field name="purchaseFromDate" type="date-time"></field>
        <field name="purchaseThruDate" type="date-time"></field>
        <field name="maxLifeTime" type="numeric"><description>The length in time of the (extended) subscription</description></field>
        <field name="maxLifeTimeUomId" type="id"></field>
        <field name="availableTime" type="numeric"></field>
        <field name="availableTimeUomId" type="id"></field>
        <field name="useCountLimit" type="numeric"></field>
        <field name="useTime" type="numeric"></field>
        <field name="useTimeUomId" type="id"></field>
        <field name="automaticExtend" type="indicator"><description>If this subscription is automatically extended with the same period as the initial period.</description></field>
        <field name="canclAutmExtTime" type="numeric"><description>The time period (before the end of the thruDate) after which the automatic extension of the subscription will be executed.</description></field>
        <field name="canclAutmExtTimeUomId" type="id"><description>Unit Of Measure used for the automatic extension of the subscription.</description></field>
        <field name="gracePeriodOnExpiry" type="numeric"><description>The time period (before the end of the thruDate) after which the automatic extension of the subscription will be executed.</description></field>
        <field name="gracePeriodOnExpiryUomId" type="id"><description>Unit Of Measure used for the automatic extension of the subscription.</description></field>
        <field name="expirationCompletedDate" type="date-time"><description>The date when expiration completed.</description></field>
        <prim-key field="subscriptionId"/>
        <relation type="one" fk-name="SUBSC_SRESRC" rel-entity-name="SubscriptionResource">
            <key-map field-name="subscriptionResourceId"/>
        </relation>
        <relation type="one" fk-name="SUBSC_CONT_MECH" rel-entity-name="ContactMech">
            <key-map field-name="contactMechId"/>
        </relation>
        <relation type="one" fk-name="SUBSC_PARTY" rel-entity-name="Party">
            <key-map field-name="partyId"/>
        </relation>
        <relation type="one" fk-name="SUBSC_UTU" title="UseTime" rel-entity-name="Uom">
            <key-map field-name="useTimeUomId" rel-field-name="uomId"/>
        </relation>
        <relation type="one" fk-name="SUBSC_CTU" title="CancelTime" rel-entity-name="Uom">
            <key-map field-name="canclAutmExtTimeUomId" rel-field-name="uomId"/>
        </relation>
        <relation type="one" fk-name="SUBSC_ATU" title="AvailableTime" rel-entity-name="Uom">
            <key-map field-name="availableTimeUomId" rel-field-name="uomId"/>
        </relation>
        <relation type="one" fk-name="SUBSC_MTU" title="MaxLifeTime" rel-entity-name="Uom">
            <key-map field-name="maxLifeTimeUomId" rel-field-name="uomId"/>
        </relation>
        <relation type="one" fk-name="SUBSC_ROLE_TYPE" rel-entity-name="RoleType">
            <key-map field-name="roleTypeId"/>
        </relation>
        <relation type="one-nofk" rel-entity-name="PartyRole">
            <key-map field-name="partyId"/>
            <key-map field-name="roleTypeId"/>
        </relation>
        <relation type="one" fk-name="SUBSC_OPARTY" title="OriginatedFrom" rel-entity-name="Party">
            <key-map field-name="originatedFromPartyId" rel-field-name="partyId"/>
        </relation>
        <relation type="one" fk-name="SUBSC_OROLE_TYPE" title="OriginatedFrom" rel-entity-name="RoleType">
            <key-map field-name="originatedFromRoleTypeId" rel-field-name="roleTypeId"/>
        </relation>
        <relation type="one-nofk" title="OriginatedFrom" rel-entity-name="PartyRole">
            <key-map field-name="originatedFromPartyId" rel-field-name="partyId"/>
            <key-map field-name="originatedFromRoleTypeId" rel-field-name="roleTypeId"/>
        </relation>
        <relation type="one-nofk" rel-entity-name="PartyNeed">
            <description>No foreign key because we want to optionally be able to have a partyId without the other fields.</description>
            <key-map field-name="partyNeedId"/>
            <key-map field-name="partyId"/>
            <key-map field-name="roleTypeId"/>
        </relation>
        <relation type="one" fk-name="SUBSC_NEED_TYPE" rel-entity-name="NeedType">
            <key-map field-name="needTypeId"/>
        </relation>
        <relation type="one-nofk" rel-entity-name="OrderHeader">
            <description>Note that foreign key not needed because there is an fk for OrderItem.</description>
            <key-map field-name="orderId"/>
        </relation>
        <relation type="one" fk-name="SUBSC_ORDERITM" rel-entity-name="OrderItem">
            <key-map field-name="orderId"/>
            <key-map field-name="orderItemSeqId"/>
        </relation>
        <relation type="one" fk-name="SUBSC_PRODUCT" rel-entity-name="Product">
            <key-map field-name="productId"/>
        </relation>
        <relation type="one" fk-name="SUBSC_PROD_CAT" rel-entity-name="ProductCategory">
            <key-map field-name="productCategoryId"/>
        </relation>
        <relation type="one" fk-name="SUBSC_INV_ITM" rel-entity-name="InventoryItem">
            <key-map field-name="inventoryItemId"/>
        </relation>
        <relation type="one" fk-name="SUBSC_TO_TYPE" rel-entity-name="SubscriptionType">
            <key-map field-name="subscriptionTypeId"/>
        </relation>
        <relation type="many" rel-entity-name="SubscriptionTypeAttr">
            <key-map field-name="subscriptionTypeId"/>
        </relation>
        <relation type="one" fk-name="SUBSC_GTU" title="GracePeriod" rel-entity-name="Uom">
            <key-map field-name="gracePeriodOnExpiryUomId" rel-field-name="uomId"/>
        </relation>
    </entity>
    <entity entity-name="SubscriptionActivity" package-name="org.ofbiz.product.subscription" title="Subscription Activity">
        <field name="subscriptionActivityId" type="id-ne"></field>
        <field name="comments" type="comment"></field>
        <field name="dateSent" type="date-time"></field>
        <prim-key field="subscriptionActivityId"/>
    </entity>
    <entity entity-name="SubscriptionAttribute" package-name="org.ofbiz.product.subscription" title="Subscription Attribute">
        <field name="subscriptionId" type="id-ne"></field>
        <field name="attrName" type="id-long-ne"></field>
        <field name="attrValue" type="value"></field>
      <field name="attrDescription" type="description"></field>
        <prim-key field="subscriptionId"/>
        <prim-key field="attrName"/>
        <relation type="one" fk-name="SUBSC_ATTR" rel-entity-name="Subscription">
            <key-map field-name="subscriptionId"/>
        </relation>
        <relation type="many" rel-entity-name="SubscriptionTypeAttr">
            <key-map field-name="attrName"/>
        </relation>
    </entity>
    <entity entity-name="SubscriptionFulfillmentPiece"
            package-name="org.ofbiz.product.subscription"
            title="Subscription Fulfillment Piece">
        <field name="subscriptionActivityId" type="id-ne"></field>
        <field name="subscriptionId" type="id-ne"></field>
        <prim-key field="subscriptionActivityId"/>
        <prim-key field="subscriptionId"/>
        <relation type="one" fk-name="SUBSC_FP" rel-entity-name="Subscription">
            <key-map field-name="subscriptionId"/>
        </relation>
        <relation type="one" fk-name="SUBSC_FP_ACT" rel-entity-name="SubscriptionActivity">
            <key-map field-name="subscriptionActivityId"/>
        </relation>
    </entity>
    <entity entity-name="SubscriptionResource"
            package-name="org.ofbiz.product.subscription"
            title="Subscription Resource">
        <field name="subscriptionResourceId" type="id-ne"></field>
        <field name="parentResourceId" type="id"></field>
        <field name="description" type="description"></field>
        <field name="contentId" type="id"><description>Optional (use if applicable) ID of a Content record that this would represent a subscription to.</description></field>
        <field name="webSiteId" type="id"><description>Optional (use if applicable) ID of a WebSite record that this would represent a subscription to.</description></field>
        <field name="serviceNameOnExpiry" type="long-varchar"><description>Name of service which will run on subscription expiration.</description></field>
        <prim-key field="subscriptionResourceId"/>
        <relation type="one" fk-name="SUBSC_RES_PARENT" title="Parent" rel-entity-name="SubscriptionResource">
            <key-map field-name="parentResourceId" rel-field-name="subscriptionResourceId"/>
        </relation>
        <relation type="one" fk-name="SUBSC_RES_CNTNT" rel-entity-name="Content">
            <key-map field-name="contentId"/>
        </relation>
        <relation type="one" fk-name="SUBSC_RES_WBSITE" rel-entity-name="WebSite">
            <key-map field-name="webSiteId"/>
        </relation>
    </entity>
    <entity entity-name="SubscriptionType"
            package-name="org.ofbiz.product.subscription"
            default-resource-name="ProductEntityLabels"
            title="Subscription Type">
        <field name="subscriptionTypeId" type="id-ne"></field>
        <field name="parentTypeId" type="id"></field>
        <field name="hasTable" type="indicator"></field>
        <field name="description" type="description"></field>
        <prim-key field="subscriptionTypeId"/>
        <relation type="one" fk-name="SUBSC_TYPE_PARENT" title="Parent" rel-entity-name="SubscriptionType">
            <key-map field-name="parentTypeId" rel-field-name="subscriptionTypeId"/>
        </relation>
    </entity>
    <entity entity-name="SubscriptionTypeAttr"
            package-name="org.ofbiz.product.subscription"
            title="Subscription Type Attribute">
        <field name="subscriptionTypeId" type="id-ne"></field>
        <field name="attrName" type="id-long-ne"></field>
        <field name="description" type="description"></field>
        <prim-key field="subscriptionTypeId"/>
        <prim-key field="attrName"/>
        <relation type="one" fk-name="SUBSC_TYPE_ATTR" rel-entity-name="SubscriptionType">
            <key-map field-name="subscriptionTypeId"/>
        </relation>
        <relation type="many" rel-entity-name="SubscriptionAttribute">
            <key-map field-name="attrName"/>
        </relation>
        <relation type="many" rel-entity-name="Subscription">
            <key-map field-name="subscriptionTypeId"/>
        </relation>
    </entity>

    <entity entity-name="SubscriptionCommEvent"
            package-name="org.ofbiz.product.subscription"
            title="Subscription Communication Event ">
      <field name="subscriptionId" type="id-ne"></field>
      <field name="communicationEventId" type="id-ne"></field>
      <prim-key field="subscriptionId"/>
      <prim-key field="communicationEventId"/>
      <relation type="one" fk-name="SUBSC_COM_EVENT" rel-entity-name="CommunicationEvent">
            <key-map field-name="communicationEventId"/>
      </relation>
      <relation type="one" fk-name="SUBSC_SUBSC" rel-entity-name="Subscription">
        <key-map field-name="subscriptionId"/>
      </relation>
    </entity>
    <view-entity entity-name="SubscriptionAndCommEvent"
                 package-name="org.ofbiz.product.subscription"
                 title="Subscription And Communication Event View">
      <member-entity entity-alias="SC" entity-name="SubscriptionCommEvent"/>
      <member-entity entity-alias="CE" entity-name="CommunicationEvent"/>
      <alias-all entity-alias="SC"/>
      <alias-all entity-alias="CE"/>
      <view-link entity-alias="SC" rel-entity-alias="CE">
        <key-map field-name="communicationEventId"/>
      </view-link>
    </view-entity>

    <!-- ========================================================= -->
    <!-- org.ofbiz.product.supplier -->
    <!-- ========================================================= -->

    <entity entity-name="MarketInterest"
            package-name="org.ofbiz.product.supplier"
            title="Market Interest">
      <field name="productCategoryId" type="id-ne"></field>
      <field name="partyClassificationGroupId" type="id-ne"></field>
      <field name="fromDate" type="date-time"></field>
      <field name="thruDate" type="date-time"></field>
      <prim-key field="productCategoryId"/>
      <prim-key field="partyClassificationGroupId"/>
      <prim-key field="fromDate"/>
      <relation type="one" fk-name="MARKET_INT_PCAT" rel-entity-name="ProductCategory">
        <key-map field-name="productCategoryId"/>
      </relation>
      <relation type="one" fk-name="MARKET_INT_PCGRP" rel-entity-name="PartyClassificationGroup">
        <key-map field-name="partyClassificationGroupId"/>
      </relation>
    </entity>
    <entity entity-name="ReorderGuideline"
            package-name="org.ofbiz.product.supplier"
            title="Reorder Guideline">
      <field name="reorderGuidelineId" type="id-ne"></field>
      <field name="productId" type="id-ne"></field>
      <field name="partyId" type="id"></field>
      <field name="roleTypeId" type="id"></field>
      <field name="facilityId" type="id"></field>
      <field name="geoId" type="id"></field>
      <field name="fromDate" type="date-time"></field>
      <field name="thruDate" type="date-time"></field>
      <field name="reorderQuantity" type="fixed-point"></field>
      <field name="reorderLevel" type="fixed-point"></field>
      <prim-key field="reorderGuidelineId"/>
      <relation type="one" fk-name="REORDER_GD_PROD" rel-entity-name="Product">
        <key-map field-name="productId"/>
      </relation>
      <relation type="one" fk-name="REORDER_GD_PARTY" rel-entity-name="Party">
        <key-map field-name="partyId"/>
      </relation>
      <relation type="one" fk-name="REORDER_GD_FAC" rel-entity-name="Facility">
        <key-map field-name="facilityId"/>
      </relation>
      <relation type="one" fk-name="REORDER_GD_GEO" rel-entity-name="Geo">
        <key-map field-name="geoId"/>
      </relation>
    </entity>
    <entity entity-name="SupplierPrefOrder"
            package-name="org.ofbiz.product.supplier"
            title="Preference Type">
      <field name="supplierPrefOrderId" type="id-ne"></field>
      <field name="description" type="description"></field>
      <prim-key field="supplierPrefOrderId"/>
    </entity>
    <entity entity-name="SupplierProduct"
            package-name="org.ofbiz.product.supplier"
            title="Supplier Product">
      <field name="productId" type="id-ne"></field>
      <field name="partyId" type="id-ne"></field>
      <field name="availableFromDate" type="date-time"></field>
      <field name="availableThruDate" type="date-time"></field>
      <field name="supplierPrefOrderId" type="id"></field>
      <field name="supplierRatingTypeId" type="id"></field>
      <field name="standardLeadTimeDays" type="fixed-point"></field>
      <field name="minimumOrderQuantity" type="fixed-point"></field>
      <field name="orderQtyIncrements" type="fixed-point"></field>
      <field name="unitsIncluded" type="fixed-point"></field>
      <field name="quantityUomId" type="id"></field>
      <field name="agreementId" type="id"></field>
      <field name="agreementItemSeqId" type="id"></field>
      <field name="lastPrice" type="currency-precise"></field>
      <field name="shippingPrice" type="currency-precise"></field>
      <field name="currencyUomId" type="id"></field>
      <field name="supplierProductName" type="name"></field>
      <field name="supplierProductId" type="id"></field>
      <field name="canDropShip" type="indicator"></field>
      <!-- field name="supplierCommissionPerc" type="fixed-point"><description>Unused field, better use commission run using agreements in accounting</description></field-->
      <field name="comments" type="comment"></field>
      <prim-key field="productId"/>
      <prim-key field="partyId"/>
      <prim-key field="currencyUomId"/>
      <prim-key field="minimumOrderQuantity"/>
      <prim-key field="availableFromDate"/>
      <relation type="one" fk-name="SUPPL_PROD_PROD" rel-entity-name="Product">
        <key-map field-name="productId"/>
      </relation>
      <relation type="one" fk-name="SUPPL_PROD_PARTY" rel-entity-name="Party">
        <key-map field-name="partyId"/>
      </relation>
      <relation type="one" fk-name="SUPPL_PROD_SPORD" rel-entity-name="SupplierPrefOrder">
        <key-map field-name="supplierPrefOrderId"/>
      </relation>
      <relation type="one" fk-name="SUPPL_PROD_SRTPE" rel-entity-name="SupplierRatingType">
        <key-map field-name="supplierRatingTypeId"/>
      </relation>
      <relation type="one" fk-name="SUPPL_PROD_CUOM" title="Currency" rel-entity-name="Uom">
        <key-map field-name="currencyUomId" rel-field-name="uomId"/>
      </relation>
      <relation type="one" fk-name="SUPPL_PROD_QUOM" title="Quantity" rel-entity-name="Uom">
        <key-map field-name="quantityUomId" rel-field-name="uomId"/>
      </relation>
      <relation type="one" fk-name="SUPPL_PROD_AGRIT" rel-entity-name="AgreementItem">
        <key-map field-name="agreementId"/>
        <key-map field-name="agreementItemSeqId"/>
      </relation>
    </entity>
    <view-entity entity-name="SupplierProductAndProduct"
      package-name="org.ofbiz.product.supplier"
      title="Supplier-product and product antityview for purchase order entry">
      <member-entity entity-alias="SP" entity-name="SupplierProduct"/>
      <member-entity entity-alias="PR" entity-name="Product"/>
      <alias-all entity-alias="SP"/>
      <alias-all entity-alias="PR">
        <exclude field="productId"/>
        <exclude field="comments"/>
        <exclude field="quantityUomId"/>
      </alias-all>
      <view-link entity-alias="SP" rel-entity-alias="PR">
        <key-map field-name="productId"/>
      </view-link>
    </view-entity>
    <entity entity-name="SupplierProductFeature"
            package-name="org.ofbiz.product.supplier"
            title="Supplier-specific product feature information">
      <field name="partyId" type="id-ne"/>
      <field name="productFeatureId" type="id-ne"/>
      <field name="description" type="name"/>
      <field name="uomId" type="id"/>
      <field name="idCode" type="id"/>
      <prim-key field="partyId"/>
      <prim-key field="productFeatureId"/>
      <relation rel-entity-name="Party" type="one" fk-name="SUPPL_FEAT_PARTY">
         <key-map field-name="partyId"/>
      </relation>
      <relation rel-entity-name="ProductFeature" type="one" fk-name="SUPPL_FEAT_FEAT">
         <key-map field-name="productFeatureId"/>
      </relation>
      <relation rel-entity-name="Uom" type="one" fk-name="SUPPL_FEAT_UOM">
         <key-map field-name="uomId"/>
      </relation>
    </entity>
    <entity entity-name="SupplierRatingType"
            package-name="org.ofbiz.product.supplier"
            title="Supplier Rating Type">
      <field name="supplierRatingTypeId" type="id-ne"></field>
      <field name="description" type="description"></field>
      <prim-key field="supplierRatingTypeId"/>
    </entity>
    
    <entity entity-name="ProductPromoContent"
            package-name="org.ofbiz.product.promo"
            title="Product Promo Content">
      <field name="productPromoId" type="id-ne"/>
      <field name="contentId" type="id-ne"/>
      <field name="productPromoContentTypeId" type="id-ne"/>
      <field name="fromDate" type="date-time"/>
      <field name="thruDate" type="date-time"/>
      <prim-key field="productPromoId"/>
      <prim-key field="contentId"/>
      <prim-key field="productPromoContentTypeId"/>
      <prim-key field="fromDate"/>
      <relation type="one" fk-name="PRODPR_CNT_PROD_PR" rel-entity-name="ProductPromo">
        <key-map field-name="productPromoId"/>
      </relation>
      <relation type="one" fk-name="PRODPR_CNT_CNT" rel-entity-name="Content">
        <key-map field-name="contentId"/>
      </relation>
      <relation type="one" fk-name="PRODPR_CNT_TYPE" rel-entity-name="ProductContentType">
        <key-map field-name="productPromoContentTypeId" rel-field-name="productContentTypeId"/>
      </relation>
    </entity>

    <entity entity-name="ProductGroupOrder"
            package-name="org.ofbiz.product.product"
            title="Product Group Order">
      <field name="groupOrderId" type="id-ne"></field>
      <field name="productId" type="id-ne"></field>
      <field name="fromDate" type="date-time"></field>
      <field name="thruDate" type="date-time"></field>
      <field name="statusId" type="id-ne"></field>
      <field name="reqOrderQty" type="fixed-point"></field>
      <field name="soldOrderQty" type="fixed-point"></field>
      <field name="jobId" type="id-ne"></field>
      <prim-key field="groupOrderId"/>
      <relation type="one" fk-name="PROD_GROUP_ORDER" rel-entity-name="Product">
        <key-map field-name="productId"/>
      </relation>
      <relation type="one" fk-name="GROUP_ORDER_STATUS" rel-entity-name="StatusItem">
        <key-map field-name="statusId"/>
      </relation>
      <relation type="one" fk-name="GROUP_ORDER_JOB" rel-entity-name="JobSandbox">
        <key-map field-name="jobId"/>
      </relation>
    </entity>
</entitymodel>