<?xml version="1.0" encoding="UTF-8"?>
<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements.  See the NOTICE file
distributed with this work for additional information
regarding copyright ownership.  The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License.  You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied.  See the License for the
specific language governing permissions and limitations
under the License.
-->

<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>

  <!-- ========================================================= -->
  <!-- ======================== Data Model ===================== -->
  <!-- The modules in this file are as follows:                  -->
  <!--  - org.apache.ofbiz.party.agreement -->
  <!--  - org.apache.ofbiz.party.communication -->
  <!--  - org.apache.ofbiz.party.contact -->
  <!--  - org.apache.ofbiz.party.need -->
  <!--  - org.apache.ofbiz.party.party -->
  <!-- ========================================================= -->


  <!-- ========================================================= -->
  <!-- org.apache.ofbiz.party.agreement -->
  <!-- ========================================================= -->

    <entity entity-name="Addendum"
            package-name="org.apache.ofbiz.party.agreement"
            title="Addendum">
      <field name="addendumId" type="id"></field>
      <field name="agreementId" type="id"></field>
      <field name="agreementItemSeqId" type="id"></field>
      <field name="addendumCreationDate" type="date-time"></field>
      <field name="addendumEffectiveDate" type="date-time"></field>
      <field name="addendumText" type="long-varchar"></field>
      <prim-key field="addendumId"/>
      <relation type="one" fk-name="ADDNDM_AGRMNT" rel-entity-name="Agreement">
        <key-map field-name="agreementId"/>
      </relation>
      <relation type="one" fk-name="ADDNDM_AGRMNT_ITM" rel-entity-name="AgreementItem">
        <key-map field-name="agreementId"/>
        <key-map field-name="agreementItemSeqId"/>
      </relation>
    </entity>
    <entity entity-name="Agreement"
            package-name="org.apache.ofbiz.party.agreement"
            title="Agreement">
      <field name="agreementId" type="id"></field>
      <field name="productId" type="id"></field>
      <field name="partyIdFrom" type="id"></field>
      <field name="partyIdTo" type="id"></field>
      <field name="roleTypeIdFrom" type="id"></field>
      <field name="roleTypeIdTo" type="id"></field>
      <field name="agreementTypeId" type="id"></field>
      <field name="agreementDate" type="date-time"></field>
      <field name="fromDate" type="date-time"></field>
      <field name="thruDate" type="date-time"></field>
      <field name="description" type="description"></field>
      <field name="textData" type="very-long"></field>
      <prim-key field="agreementId"/>
      <relation type="one" fk-name="AGRMNT_PRODUCT" rel-entity-name="Product">
        <key-map field-name="productId"/>
      </relation>
      <relation type="one-nofk" title="From" rel-entity-name="Party">
        <key-map field-name="partyIdFrom" rel-field-name="partyId"/>
      </relation>
      <relation type="one-nofk" title="From" rel-entity-name="RoleType">
        <key-map field-name="roleTypeIdFrom" rel-field-name="roleTypeId"/>
      </relation>
      <relation type="one" fk-name="AGRMNT_FPRTYRLE" title="From" rel-entity-name="PartyRole">
        <key-map field-name="partyIdFrom" rel-field-name="partyId"/>
        <key-map field-name="roleTypeIdFrom" rel-field-name="roleTypeId"/>
      </relation>
      <relation type="one-nofk" title="To" rel-entity-name="Party">
        <key-map field-name="partyIdTo" rel-field-name="partyId"/>
      </relation>
      <relation type="one-nofk" title="To" rel-entity-name="RoleType">
        <key-map field-name="roleTypeIdTo" rel-field-name="roleTypeId"/>
      </relation>
      <relation type="one" fk-name="AGRMNT_TPRTYRLE" title="To" rel-entity-name="PartyRole">
        <key-map field-name="partyIdTo" rel-field-name="partyId"/>
        <key-map field-name="roleTypeIdTo" rel-field-name="roleTypeId"/>
      </relation>
      <relation type="many" rel-entity-name="PartyRelationship">
        <key-map field-name="roleTypeIdFrom"/>
        <key-map field-name="roleTypeIdTo"/>
        <key-map field-name="partyIdFrom"/>
        <key-map field-name="partyIdTo"/>
      </relation>
      <relation type="one" fk-name="AGRMNT_TYPE" rel-entity-name="AgreementType">
        <key-map field-name="agreementTypeId"/>
      </relation>
      <relation type="many" rel-entity-name="AgreementTypeAttr">
        <key-map field-name="agreementTypeId"/>
      </relation>
    </entity>
    <entity entity-name="AgreementAttribute"
            package-name="org.apache.ofbiz.party.agreement"
            title="Agreement Attribute">
      <field name="agreementId" type="id"></field>
      <field name="attrName" type="id-long"></field>
      <field name="attrValue" type="value"></field>
      <field name="attrDescription" type="description"></field>
      <prim-key field="agreementId"/>
      <prim-key field="attrName"/>
      <relation type="one" fk-name="AGRMNT_ATTR" rel-entity-name="Agreement">
        <key-map field-name="agreementId"/>
      </relation>
      <relation type="many" rel-entity-name="AgreementTypeAttr">
        <key-map field-name="attrName"/>
      </relation>
    </entity>
    <entity entity-name="AgreementGeographicalApplic"
            package-name="org.apache.ofbiz.party.agreement"
            title="Agreement Geographical Applicability">
      <field name="agreementId" type="id"></field>
      <field name="agreementItemSeqId" type="id"></field>
      <field name="geoId" type="id"></field>
      <prim-key field="agreementId"/>
      <prim-key field="agreementItemSeqId"/>
      <prim-key field="geoId"/>
      <relation type="one" fk-name="AGRMNT_GEOAP_AGR" rel-entity-name="Agreement">
        <key-map field-name="agreementId"/>
      </relation>
      <relation type="one" fk-name="AGRMNT_GEOAP_AGRI" rel-entity-name="AgreementItem">
        <key-map field-name="agreementId"/>
        <key-map field-name="agreementItemSeqId"/>
      </relation>
      <relation type="one" fk-name="AGRMNT_GEOAP_GEO" rel-entity-name="Geo">
        <key-map field-name="geoId"/>
      </relation>
    </entity>
    <entity entity-name="AgreementItem"
            package-name="org.apache.ofbiz.party.agreement"
            title="Agreement Item">
      <field name="agreementId" type="id"></field>
      <field name="agreementItemSeqId" type="id"></field>
      <field name="agreementItemTypeId" type="id"></field>
      <field name="currencyUomId" type="id"></field>
      <field name="agreementText" type="very-long"></field>
      <field name="agreementImage" type="object"></field>
      <prim-key field="agreementId"/>
      <prim-key field="agreementItemSeqId"/>
      <relation type="one" fk-name="AGRMNT_ITEM_AGR" rel-entity-name="Agreement">
        <key-map field-name="agreementId"/>
      </relation>
      <relation type="one" fk-name="AGRMNT_ITEM_TYPE" rel-entity-name="AgreementItemType">
        <key-map field-name="agreementItemTypeId"/>
      </relation>
      <relation type="many" rel-entity-name="AgreementItemTypeAttr">
        <key-map field-name="agreementItemTypeId"/>
      </relation>
    </entity>
    <entity entity-name="AgreementItemAttribute"
            package-name="org.apache.ofbiz.party.agreement"
            title="Agreement Item Attribute">
      <field name="agreementId" type="id"></field>
      <field name="agreementItemSeqId" type="id"></field>
      <field name="attrName" type="id-long"></field>
      <field name="attrValue" type="value"></field>
      <field name="attrDescription" type="description"></field>
      <prim-key field="agreementId"/>
      <prim-key field="agreementItemSeqId"/>
      <prim-key field="attrName"/>
      <relation type="one" fk-name="AGRMNT_ITEM_ATTR" rel-entity-name="AgreementItem">
        <key-map field-name="agreementId"/>
        <key-map field-name="agreementItemSeqId"/>
      </relation>
      <relation type="many" rel-entity-name="AgreementItemTypeAttr">
        <key-map field-name="attrName"/>
      </relation>
    </entity>
    <entity entity-name="AgreementItemType"
            package-name="org.apache.ofbiz.party.agreement"
            default-resource-name="PartyEntityLabels"
            title="Agreement Item Type">
      <field name="agreementItemTypeId" type="id"></field>
      <field name="parentTypeId" type="id"></field>
      <field name="hasTable" type="indicator"></field>
      <field name="description" type="description"></field>
      <prim-key field="agreementItemTypeId"/>
      <relation type="one" fk-name="AGRMNT_TYPEPAR" title="Parent" rel-entity-name="AgreementItemType">
        <key-map field-name="parentTypeId" rel-field-name="agreementItemTypeId"/>
      </relation>
    </entity>
    <entity entity-name="AgreementItemTypeAttr"
            package-name="org.apache.ofbiz.party.agreement"
            title="Agreement Item Type Attribute">
      <field name="agreementItemTypeId" type="id"></field>
      <field name="attrName" type="id-long"></field>
      <field name="description" type="description"></field>
      <prim-key field="agreementItemTypeId"/>
      <prim-key field="attrName"/>
      <relation type="one" fk-name="AGRMNT_ITEM_TYPATR" rel-entity-name="AgreementItemType">
        <key-map field-name="agreementItemTypeId"/>
      </relation>
      <relation type="many" rel-entity-name="AgreementItemAttribute">
        <key-map field-name="attrName"/>
      </relation>
      <relation type="many" rel-entity-name="AgreementItem">
        <key-map field-name="agreementItemTypeId"/>
      </relation>
    </entity>
    <entity entity-name="AgreementContent" 
            package-name="org.apache.ofbiz.party.agreement" 
            title="Agreement Content">
        <field name="agreementId" type="id"></field>
        <field name="agreementItemSeqId" type="id"></field>
        <field name="agreementContentTypeId" type="id"></field>
        <field name="contentId" type="id"></field>
        <field name="fromDate" type="date-time"></field>
        <field name="thruDate" type="date-time"></field>
        <prim-key field="contentId"/>
        <prim-key field="agreementId"/>
        <prim-key field="agreementItemSeqId"/>
        <prim-key field="agreementContentTypeId"/>
        <prim-key field="fromDate"/>
        <relation type="one" fk-name="AG_CNT_PROD" rel-entity-name="Agreement">
            <key-map field-name="agreementId"/>
        </relation>
        <relation type="one" fk-name="AG_CNT_CNT" rel-entity-name="Content">
            <key-map field-name="contentId"/>
        </relation>
        <relation type="one" fk-name="AG_CNT_TYPE" rel-entity-name="AgreementContentType">
            <key-map field-name="agreementContentTypeId"/>
        </relation>
    </entity>
    <entity entity-name="AgreementContentType" 
            package-name="org.apache.ofbiz.party.agreement"
            title="Agreement Content Type">
        <field name="agreementContentTypeId" type="id"></field>
        <field name="parentTypeId" type="id"></field>
        <field name="hasTable" type="indicator"></field>
        <field name="description" type="description"></field>
        <prim-key field="agreementContentTypeId"/>
        <relation type="one" fk-name="AGCT_TYP_PARENT" title="Parent" rel-entity-name="AgreementContentType">
            <key-map field-name="parentTypeId" rel-field-name="agreementContentTypeId"/>
        </relation>
    </entity>
    <entity entity-name="AgreementPartyApplic"
            package-name="org.apache.ofbiz.party.agreement"
            title="Agreement Party Application">
      <field name="agreementId" type="id"></field>
      <field name="agreementItemSeqId" type="id"></field>
      <field name="partyId" type="id"></field>
      <prim-key field="agreementId"/>
      <prim-key field="agreementItemSeqId"/>
      <prim-key field="partyId"/>
      <relation type="one" fk-name="AGRMNT_PTYA_AGR" rel-entity-name="Agreement">
        <key-map field-name="agreementId"/>
      </relation>
      <relation type="one-nofk" rel-entity-name="AgreementItem">
        <key-map field-name="agreementId"/>
        <key-map field-name="agreementItemSeqId"/>
      </relation>
      <relation type="one" fk-name="AGRMNT_PTYA_PTY" rel-entity-name="Party">
        <key-map field-name="partyId"/>
      </relation>
    </entity>
    <entity entity-name="AgreementProductAppl"
            package-name="org.apache.ofbiz.party.agreement"
            title="Agreement Product Application">
      <field name="agreementId" type="id"></field>
      <field name="agreementItemSeqId" type="id"></field>
      <field name="productId" type="id"></field>
      <field name="price" type="currency-precise"></field>
      <prim-key field="agreementId"/>
      <prim-key field="agreementItemSeqId"/>
      <prim-key field="productId"/>
      <relation type="one-nofk" rel-entity-name="Agreement">
        <key-map field-name="agreementId"/>
      </relation>
      <relation type="one" fk-name="AGRMNT_PRDA_AITM" rel-entity-name="AgreementItem">
        <key-map field-name="agreementId"/>
        <key-map field-name="agreementItemSeqId"/>
      </relation>
      <relation type="one" fk-name="AGRMNT_PRDA_PRD" rel-entity-name="Product">
        <key-map field-name="productId"/>
      </relation>
    </entity>
    <entity entity-name="AgreementPromoAppl"
            package-name="org.apache.ofbiz.party.agreement"
            title="Agreement Promo Applicability">
      <field name="agreementId" type="id"></field>
      <field name="agreementItemSeqId" type="id"></field>
      <field name="productPromoId" 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="agreementId"/>
      <prim-key field="agreementItemSeqId"/>
      <prim-key field="productPromoId"/>
      <prim-key field="fromDate"/>
      <relation type="one" fk-name="AGRMNT_PROM_PRO" rel-entity-name="ProductPromo">
        <key-map field-name="productPromoId"/>
      </relation>
      <relation type="one-nofk" rel-entity-name="Agreement">
        <key-map field-name="agreementId"/>
      </relation>
      <relation type="one" fk-name="AGRMNT_PROM_AITM" rel-entity-name="AgreementItem">
        <key-map field-name="agreementId"/>
        <key-map field-name="agreementItemSeqId"/>
      </relation>
    </entity>
    <entity entity-name="AgreementFacilityAppl"
            package-name="org.apache.ofbiz.party.agreement"
            title="Agreement Facility Application">
      <field name="agreementId" type="id"></field>
      <field name="agreementItemSeqId" type="id"></field>
      <field name="facilityId" type="id"></field>
      <prim-key field="agreementId"/>
      <prim-key field="agreementItemSeqId"/>
      <prim-key field="facilityId"/>
      <relation type="one-nofk" rel-entity-name="Agreement">
        <key-map field-name="agreementId"/>
      </relation>
      <relation type="one" fk-name="AGRMNT_FACLT_AITM" rel-entity-name="AgreementItem">
        <key-map field-name="agreementId"/>
        <key-map field-name="agreementItemSeqId"/>
      </relation>
      <relation type="one" fk-name="AGRMNT_FACLT_PRD" rel-entity-name="Facility">
        <key-map field-name="facilityId"/>
      </relation>
    </entity>
    <entity entity-name="AgreementRole"
            package-name="org.apache.ofbiz.party.agreement"
            title="Agreement Role">
      <field name="agreementId" type="id"></field>
      <field name="partyId" type="id"></field>
      <field name="roleTypeId" type="id"></field>
      <prim-key field="agreementId"/>
      <prim-key field="partyId"/>
      <prim-key field="roleTypeId"/>
      <relation type="one" fk-name="AGRMNT_ROLE_AGR" rel-entity-name="Agreement">
        <key-map field-name="agreementId"/>
      </relation>
      <relation type="one" fk-name="AGRMNT_ROLE_PTY" 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="AGRMNT_ROLE_PRLE" rel-entity-name="PartyRole">
        <key-map field-name="partyId"/>
        <key-map field-name="roleTypeId"/>
      </relation>
    </entity>
    <entity entity-name="AgreementTerm"
            package-name="org.apache.ofbiz.party.agreement"
            title="Agreement Term">
      <field name="agreementTermId" type="id"></field>
      <field name="termTypeId" type="id"></field>
      <field name="agreementId" type="id"></field>
      <field name="agreementItemSeqId" type="id"></field>
      <field name="invoiceItemTypeId" type="id"></field>
      <field name="fromDate" type="date-time"></field>
      <field name="thruDate" type="date-time"></field>
      <field name="termValue" type="currency-precise"></field>
      <field name="termDays" type="numeric"></field>
      <field name="textValue" type="description"></field>
      <field name="minQuantity" type="floating-point"></field>
      <field name="maxQuantity" type="floating-point"></field>
      <field name="description" type="description"></field>
      <prim-key field="agreementTermId"/>
      <relation type="one" fk-name="AGRMNT_TERM_TTYP" rel-entity-name="TermType">
        <key-map field-name="termTypeId"/>
      </relation>
      <relation type="one" fk-name="AGRMNT_TERM_AGR" rel-entity-name="Agreement">
        <key-map field-name="agreementId"/>
      </relation>
      <relation type="one" fk-name="AGRMNT_TERM_AITM" rel-entity-name="AgreementItem">
        <key-map field-name="agreementId"/>
        <key-map field-name="agreementItemSeqId"/>
      </relation>
      <relation type="one" fk-name="AGRMNT_TERM_IIT" rel-entity-name="InvoiceItemType">
        <key-map field-name="invoiceItemTypeId"/>
      </relation>
    </entity>
    <entity entity-name="AgreementTermAttribute"
            package-name="org.apache.ofbiz.party.agreement"
            title="Agreement Term Attribute">
      <field name="agreementTermId" type="id"></field>
      <field name="attrName" type="id-long"></field>
      <field name="attrValue" type="value"></field>
      <field name="attrDescription" type="description"></field>
      <prim-key field="agreementTermId"/>
      <prim-key field="attrName"/>
      <relation type="one" fk-name="AGRMNT_TERM_ATTR" rel-entity-name="AgreementTerm">
        <key-map field-name="agreementTermId"/>
      </relation>
    </entity>
    <entity entity-name="AgreementType"
            package-name="org.apache.ofbiz.party.agreement"
            default-resource-name="PartyEntityLabels"
            title="Agreement Type">
      <field name="agreementTypeId" type="id"></field>
      <field name="parentTypeId" type="id"></field>
      <field name="hasTable" type="indicator"></field>
      <field name="description" type="description"></field>
      <prim-key field="agreementTypeId"/>
      <relation type="one" fk-name="AGRMNT_TYPE_PAR" title="Parent" rel-entity-name="AgreementType">
        <key-map field-name="parentTypeId" rel-field-name="agreementTypeId"/>
      </relation>
    </entity>
    <entity entity-name="AgreementTypeAttr"
            package-name="org.apache.ofbiz.party.agreement"
            title="Agreement Type Attribute">
      <field name="agreementTypeId" type="id"></field>
      <field name="attrName" type="id-long"></field>
      <field name="description" type="description"></field>
      <prim-key field="agreementTypeId"/>
      <prim-key field="attrName"/>
      <relation type="one" fk-name="AGRMNT_TYPE_ATTR" rel-entity-name="AgreementType">
        <key-map field-name="agreementTypeId"/>
      </relation>
      <relation type="many" rel-entity-name="AgreementAttribute">
        <key-map field-name="attrName"/>
      </relation>
      <relation type="many" rel-entity-name="Agreement">
        <key-map field-name="agreementTypeId"/>
      </relation>
    </entity>
    <entity entity-name="AgreementWorkEffortApplic" 
            package-name="org.apache.ofbiz.party.agreement" 
            title="Agreement WorkEffort Application">
        <field name="agreementId" type="id"></field>
        <field name="agreementItemSeqId" type="id"></field>
        <field name="workEffortId" type="id"></field>
        <prim-key field="agreementId"/>
        <prim-key field="agreementItemSeqId"/>
        <prim-key field="workEffortId"/>
        <relation type="one" fk-name="AGRMNT_WEA_AGRMNT" rel-entity-name="Agreement">
            <key-map field-name="agreementId"/>
        </relation>
        <relation type="one-nofk" rel-entity-name="AgreementItem">
            <key-map field-name="agreementId"/>
            <key-map field-name="agreementItemSeqId"/>
        </relation>
        <relation type="one" fk-name="AGRMNT_WEA_WE" rel-entity-name="WorkEffort">
            <key-map field-name="workEffortId"/>
        </relation>
    </entity>
    <entity entity-name="TermType"
            package-name="org.apache.ofbiz.party.agreement"
            title="Term Type" default-resource-name="PartyEntityLabels">
      <field name="termTypeId" type="id"></field>
      <field name="parentTypeId" type="id"></field>
      <field name="hasTable" type="indicator"></field>
      <field name="description" type="description"></field>
      <prim-key field="termTypeId"/>
      <relation type="one" fk-name="TERM_TYPE_PAR" title="Parent" rel-entity-name="TermType">
        <key-map field-name="parentTypeId" rel-field-name="termTypeId"/>
      </relation>
    </entity>
    <entity entity-name="TermTypeAttr"
            package-name="org.apache.ofbiz.party.agreement"
            title="Term Type Attribute">
      <field name="termTypeId" type="id"></field>
      <field name="attrName" type="id-long"></field>
      <field name="description" type="description"></field>
      <prim-key field="termTypeId"/>
      <prim-key field="attrName"/>
      <relation type="one" fk-name="TERM_TYPATR_TTYP" rel-entity-name="TermType">
        <key-map field-name="termTypeId"/>
      </relation>
      <relation type="many" rel-entity-name="AgreementTermAttribute">
        <key-map field-name="attrName"/>
      </relation>
      <relation type="many" rel-entity-name="AgreementTerm">
        <key-map field-name="termTypeId"/>
      </relation>
      <relation type="many" rel-entity-name="OrderTermAttribute">
        <key-map field-name="attrName"/>
      </relation>
      <relation type="many" rel-entity-name="OrderTerm">
        <key-map field-name="termTypeId"/>
      </relation>
      <relation type="many" rel-entity-name="QuoteTermAttribute">
        <key-map field-name="attrName"/>
      </relation>
      <relation type="many" rel-entity-name="QuoteTerm">
        <key-map field-name="termTypeId"/>
      </relation>
      <relation type="many" rel-entity-name="InvoiceTermAttribute">
        <key-map field-name="attrName"/>
      </relation>
      <relation type="many" rel-entity-name="InvoiceTerm">
        <key-map field-name="termTypeId"/>
      </relation>
    </entity>
    <entity entity-name="AgreementEmploymentAppl"
            package-name="org.apache.ofbiz.party.agreement"
            title="Agreement Employment Application">
        <field name="agreementId" type="id"></field>
        <field name="agreementItemSeqId" type="id"></field>
        <field name="partyIdFrom" type="id"></field>
        <field name="partyIdTo" type="id"></field>
        <field name="roleTypeIdFrom" type="id"></field>
        <field name="roleTypeIdTo" type="id"></field>
        <field name="fromDate" type="date-time"></field>
        <field name="agreementDate" type="date-time"/>
        <field name="thruDate" type="date-time"/>
        <prim-key field="agreementId"/>
        <prim-key field="agreementItemSeqId"/>
        <prim-key field="partyIdTo"/>
        <prim-key field="partyIdFrom"/>
        <prim-key field="roleTypeIdTo"/>
        <prim-key field="roleTypeIdFrom"/>
        <prim-key field="fromDate"/>
        <relation type="one" fk-name="AGRMNT_EMPL_APPL" rel-entity-name="Employment">
            <key-map field-name="roleTypeIdFrom"/>
            <key-map field-name="roleTypeIdTo"/>
            <key-map field-name="partyIdFrom"/>
            <key-map field-name="partyIdTo"/>
            <key-map field-name="fromDate"/>
        </relation>
        <relation type="many" rel-entity-name="Agreement">
            <key-map field-name="agreementId" rel-field-name="partyIdFrom"/>
            <key-map field-name="agreementId" rel-field-name="partyIdTo"/>
        </relation>
        <relation type="one" fk-name="AGRMNT_EMPL_AITM" rel-entity-name="AgreementItem">
            <key-map field-name="agreementId"/>
            <key-map field-name="agreementItemSeqId"/>
        </relation>
    </entity>
    <view-entity entity-name="AgreementItemAndProductAppl"
        package-name="org.apache.ofbiz.party.agreement"
        title="Agreement Item and Agreement Product Applicability View">
        <member-entity entity-alias="AGI" entity-name="AgreementItem"/>
        <member-entity entity-alias="AGPA" entity-name="AgreementProductAppl"/>
        <member-entity entity-alias="AG" entity-name="Agreement"/>
        <alias-all entity-alias="AGI"/>
        <alias-all entity-alias="AGPA"/>
        <alias-all entity-alias="AG">
            <exclude field="productId"/>
        </alias-all>
        <view-link entity-alias="AGI" rel-entity-alias="AGPA">
            <key-map field-name="agreementId"/>
            <key-map field-name="agreementItemSeqId"/>
        </view-link>
        <view-link entity-alias="AGI" rel-entity-alias="AG">
            <key-map field-name="agreementId"/>
        </view-link>
        <relation type="one-nofk" rel-entity-name="Agreement">
            <key-map field-name="agreementId"/>
        </relation>
    </view-entity>
    <view-entity entity-name="AgreementItemAndFacilityAppl"
        package-name="org.apache.ofbiz.party.agreement"
        title="Agreement Item and Agreement Facility Applicability View">
        <member-entity entity-alias="AGI" entity-name="AgreementItem"/>
        <member-entity entity-alias="AGFA" entity-name="AgreementFacilityAppl"/>
        <member-entity entity-alias="AG" entity-name="Agreement"/>
        <alias-all entity-alias="AGI"/>
        <alias-all entity-alias="AGFA"/>
        <alias-all entity-alias="AG"/>
        <view-link entity-alias="AGI" rel-entity-alias="AGFA">
            <key-map field-name="agreementId"/>
            <key-map field-name="agreementItemSeqId"/>
        </view-link>
        <view-link entity-alias="AGI" rel-entity-alias="AG">
            <key-map field-name="agreementId"/>
        </view-link>
        <relation type="one-nofk" rel-entity-name="Agreement">
            <key-map field-name="agreementId"/>
        </relation>
    </view-entity>
    <view-entity entity-name="AgreementItemAndPartyAppl"
        package-name="org.apache.ofbiz.party.agreement"
        title="Agreement Item and Agreement Party Applicability View">
        <member-entity entity-alias="AGI" entity-name="AgreementItem"/>
        <member-entity entity-alias="AGPA" entity-name="AgreementPartyApplic"/>
        <member-entity entity-alias="AG" entity-name="Agreement"/>
        <alias-all entity-alias="AGI"/>
        <alias-all entity-alias="AGPA"/>
        <alias-all entity-alias="AG">
            <exclude field="productId"/>
        </alias-all>
        <view-link entity-alias="AGI" rel-entity-alias="AGPA">
            <key-map field-name="agreementId"/>
            <key-map field-name="agreementItemSeqId"/>
        </view-link>
        <view-link entity-alias="AGI" rel-entity-alias="AG">
            <key-map field-name="agreementId"/>
        </view-link>
    </view-entity>
    <view-entity entity-name="AgreementContentAndInfo"
            package-name="org.apache.ofbiz.accounting.invoice"
            title="AgreementContent Content and DataResource View">
        <member-entity entity-alias="AGC" entity-name="AgreementContent"/>
        <member-entity entity-alias="CO" entity-name="Content"/>
        <member-entity entity-alias="DR" entity-name="DataResource"/>
        <alias-all entity-alias="AGC"/>
        <alias-all entity-alias="CO"/>
        <alias-all entity-alias="DR" prefix="dr"/>
        <view-link entity-alias="AGC" 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>

  <!-- ========================================================= -->
  <!-- org.apache.ofbiz.party.communication -->
  <!-- ========================================================= -->

    <entity entity-name="CommContentAssocType" package-name="org.apache.ofbiz.party.communication" title="CommunicationEvent Content Association Type">
        <field name="commContentAssocTypeId" type="id"></field>
        <field name="description" type="description"></field>
        <prim-key field="commContentAssocTypeId"/>
    </entity>
    <entity entity-name="CommEventContentAssoc" package-name="org.apache.ofbiz.party.communication" title="CommunicationEvent Content Association">
        <field name="contentId" type="id"></field>
        <field name="communicationEventId" type="id"></field>
        <field name="commContentAssocTypeId" 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="contentId"/>
        <prim-key field="communicationEventId"/>
        <prim-key field="fromDate"/>
        <relation type="one" fk-name="COMMEV_CA_FROM" title="From" rel-entity-name="Content">
            <key-map field-name="contentId"/>
        </relation>
        <relation type="one" fk-name="COMMEV_CA_COMMEV"  rel-entity-name="CommunicationEvent">
            <key-map field-name="communicationEventId"/>
        </relation>
        <relation type="one" fk-name="COMMEV_CA_TYP" rel-entity-name="CommContentAssocType">
            <key-map field-name="commContentAssocTypeId"/>
        </relation>
    </entity>
    <view-entity entity-name="CommEventContentDataResource" package-name="org.apache.ofbiz.party.communication" title="CommEvent and Content and DataResource View">
        <member-entity entity-alias="CECA" entity-name="CommEventContentAssoc"/>
        <member-entity entity-alias="CO" entity-name="Content"/>
        <member-entity entity-alias="DR" entity-name="DataResource"/>
        <alias-all entity-alias="CECA"/>
        <alias-all entity-alias="CO"/>
        <alias-all entity-alias="DR" prefix="dr"/>
        <view-link entity-alias="CECA" rel-entity-alias="CO" rel-optional="false">
            <key-map field-name="contentId"/>
        </view-link>
        <view-link entity-alias="CO" rel-entity-alias="DR" rel-optional="true">
            <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="CommunicationEvent">
            <key-map field-name="communicationEventId"/>
        </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>
        <relation type="many" title="From" rel-entity-name="ContentAssoc">
            <key-map field-name="contentId"/>
        </relation>
        <relation type="many" title="To" rel-entity-name="ContentAssoc">
            <key-map field-name="contentId" rel-field-name="contentIdTo"/>
        </relation>
        <relation type="many" rel-entity-name="ContentPurpose">
            <key-map field-name="contentId"/>
        </relation>
        <relation type="many" rel-entity-name="ContentRole">
            <key-map field-name="contentId"/>
        </relation>
    </view-entity>
    <entity entity-name="CommunicationEvent" package-name="org.apache.ofbiz.party.communication" title="Communication Event">
        <field name="communicationEventId" type="id"></field>
        <field name="communicationEventTypeId" type="id"></field>
        <field name="origCommEventId" type="id"></field>
        <field name="parentCommEventId" type="id"></field>
        <field name="statusId" type="id"></field>
        <field name="contactMechTypeId" type="id"></field>
        <field name="contactMechIdFrom" type="id"/>
        <field name="contactMechIdTo" type="id"/>
        <field name="roleTypeIdFrom" type="id"></field>
        <field name="roleTypeIdTo" type="id"></field>
        <field name="partyIdFrom" type="id"></field>
        <field name="partyIdTo" type="id"></field>
        <field name="entryDate" type="date-time"></field>
        <field name="datetimeStarted" type="date-time"></field>
        <field name="datetimeEnded" type="date-time"></field>
        <field name="subject" type="long-varchar"></field>
        <field name="contentMimeTypeId" type="id-vlong"/>
        <field name="content" type="very-long"></field>
        <field name="note" type="comment"></field>
        <field name="reasonEnumId" type="id"></field>
        <field name="contactListId" type="id"></field>
        <field name="headerString" type="very-long"></field>
        <field name="fromString" type="very-long"></field>
        <field name="toString" type="very-long"></field>
        <field name="ccString" type="very-long"></field>
        <field name="bccString" type="very-long"></field>
        <field name="messageId" type="value"></field>
        <prim-key field="communicationEventId"/>
        <relation type="one" fk-name="COM_EVNT_TYPE" rel-entity-name="CommunicationEventType">
            <key-map field-name="communicationEventTypeId"/>
        </relation>
        <relation type="one" fk-name="COM_EVNT_TPTY" title="To" rel-entity-name="Party">
            <key-map field-name="partyIdTo" rel-field-name="partyId"/>
        </relation>
        <relation type="one" fk-name="COM_EVNT_TRTYP" title="To" rel-entity-name="RoleType">
            <key-map field-name="roleTypeIdTo" rel-field-name="roleTypeId"/>
        </relation>
        <relation type="one-nofk" title="To" rel-entity-name="PartyRole">
            <key-map field-name="partyIdTo" rel-field-name="partyId"/>
            <key-map field-name="roleTypeIdTo" rel-field-name="roleTypeId"/>
        </relation>
        <relation type="one" fk-name="COM_EVNT_FPTY" title="From" rel-entity-name="Party">
            <key-map field-name="partyIdFrom" rel-field-name="partyId"/>
        </relation>
        <relation type="one" fk-name="COM_EVNT_FRTYP" title="From" rel-entity-name="RoleType">
            <key-map field-name="roleTypeIdFrom" rel-field-name="roleTypeId"/>
        </relation>
        <relation type="one-nofk" title="From" rel-entity-name="PartyRole">
            <key-map field-name="partyIdFrom" rel-field-name="partyId"/>
            <key-map field-name="roleTypeIdFrom" rel-field-name="roleTypeId"/>
        </relation>
        <relation type="one" fk-name="COM_EVNT_STTS" rel-entity-name="StatusItem">
            <key-map field-name="statusId"/>
        </relation>
        <relation type="one" fk-name="COM_EVNT_CMTP" rel-entity-name="ContactMechType">
            <key-map field-name="contactMechTypeId"/>
        </relation>
        <relation type="one" fk-name="COM_EVNT_FCM" title="From" rel-entity-name="ContactMech">
            <key-map field-name="contactMechIdFrom" rel-field-name="contactMechId"/>
        </relation>
        <relation type="one" fk-name="COM_EVNT_TCM" title="To" rel-entity-name="ContactMech">
            <key-map field-name="contactMechIdTo" rel-field-name="contactMechId"/>
        </relation>
        <relation type="one" fk-name="COM_EVNT_CLST" rel-entity-name="ContactList">
            <key-map field-name="contactListId"/>
        </relation>
        <relation type="one" fk-name="COM_EVNT_MIMETYPE" rel-entity-name="MimeType">
            <key-map field-name="contentMimeTypeId" rel-field-name="mimeTypeId"/>
        </relation>
        <relation type="one" fk-name="COM_EVNT_RESENUM" rel-entity-name="Enumeration">
            <key-map field-name="reasonEnumId" rel-field-name="enumId"/>
        </relation>
        <index name="COMMEVT_MSG_ID" unique="true">
            <index-field name="messageId"/>
        </index>
    </entity>
    <view-entity entity-name="CommunicationEventAndSubscr" package-name="org.apache.ofbiz.party.communication" title="Communication Event And Role View">
        <member-entity entity-alias="SC" entity-name="SubscriptionCommEvent"/>
        <member-entity entity-alias="SU" entity-name="Subscription"/>
        <alias-all entity-alias="SC">
            <exclude field="communicationEventId"/>
        </alias-all>
        <alias-all entity-alias="SU"/>
        <view-link entity-alias="SC" rel-entity-alias="SU">
            <key-map field-name="subscriptionId"/>
        </view-link>
    </view-entity>
    <view-entity entity-name="CommunicationEventAndProduct" package-name="org.apache.ofbiz.party.communication" title="Communication Event And Product View">
        <member-entity entity-alias="CP" entity-name="CommunicationEventProduct"/>
        <member-entity entity-alias="CE" entity-name="CommunicationEvent"/>
        <alias-all entity-alias="CP"/>
        <alias-all entity-alias="CE"/>
        <view-link entity-alias="CP" rel-entity-alias="CE">
            <key-map field-name="communicationEventId"/>
        </view-link>
    </view-entity>
    <view-entity entity-name="CommunicationEventAndRole" package-name="org.apache.ofbiz.party.communication" title="Communication Event And Role View">
      <member-entity entity-alias="CE" entity-name="CommunicationEvent"/>
      <member-entity entity-alias="CR" entity-name="CommunicationEventRole"/>
      <alias-all entity-alias="CE"/>
      <alias entity-alias="CR" name="partyId"/>
      <alias entity-alias="CR" name="roleTypeId"/>
      <alias entity-alias="CR" name="roleStatusId" field="statusId"/>
      <alias entity-alias="CR" name="contactMechId"/>
      <view-link entity-alias="CE" rel-entity-alias="CR" rel-optional="true">
        <key-map field-name="communicationEventId"/>
      </view-link>
      <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="PartyRole">
        <key-map field-name="partyId"/>
        <key-map field-name="roleTypeId"/>
      </relation>
      <relation type="one-nofk" rel-entity-name="CommunicationEventType">
        <key-map field-name="communicationEventTypeId"/>
      </relation>
      <relation type="many" rel-entity-name="CommunicationEventPurpose">
        <key-map field-name="communicationEventId"/>
      </relation>
      <relation type="one-nofk" title="To" rel-entity-name="Party">
        <key-map field-name="partyIdTo" rel-field-name="partyId"/>
      </relation>
      <relation type="one-nofk" title="To" rel-entity-name="RoleType">
        <key-map field-name="roleTypeIdTo" rel-field-name="roleTypeId"/>
      </relation>
      <relation type="one-nofk" title="To" rel-entity-name="PartyRole">
        <key-map field-name="partyIdTo" rel-field-name="partyId"/>
        <key-map field-name="roleTypeIdTo" rel-field-name="roleTypeId"/>
      </relation>
      <relation type="one-nofk" title="From" rel-entity-name="Party">
        <key-map field-name="partyIdFrom" rel-field-name="partyId"/>
      </relation>
      <relation type="one-nofk" title="From" rel-entity-name="RoleType">
        <key-map field-name="roleTypeIdFrom" rel-field-name="roleTypeId"/>
      </relation>
      <relation type="one-nofk" title="From" rel-entity-name="PartyRole">
        <key-map field-name="partyIdFrom" rel-field-name="partyId"/>
        <key-map field-name="roleTypeIdFrom" rel-field-name="roleTypeId"/>
      </relation>
      <relation type="one-nofk" rel-entity-name="StatusItem">
        <key-map field-name="statusId"/>
      </relation>
      <relation type="one-nofk" rel-entity-name="ContactMechType">
        <key-map field-name="contactMechTypeId"/>
      </relation>
      <relation type="many" rel-entity-name="CommunicationEventRole">
        <key-map field-name="communicationEventId"/>
      </relation>
      <relation type="many" rel-entity-name="PartyNeed">
        <key-map field-name="communicationEventId"/>
      </relation>
      <relation type="many" rel-entity-name="CommunicationEventWorkEff">
        <key-map field-name="communicationEventId"/>
      </relation>
    </view-entity>
    <entity entity-name="CommunicationEventProduct" package-name="org.apache.ofbiz.party.communication" title="Communication Event Product">
        <field name="productId" type="id"></field>
        <field name="communicationEventId" type="id"></field>
        <prim-key field="productId"/>
        <prim-key field="communicationEventId"/>
        <relation type="one" fk-name="COMEV_PROD_PROD" rel-entity-name="Product">
            <key-map field-name="productId"/>
        </relation>
        <relation type="one" fk-name="COMEV_PROD_CMEV" rel-entity-name="CommunicationEvent">
            <key-map field-name="communicationEventId"/>
        </relation>
    </entity>
    <entity entity-name="CommunicationEventPrpTyp"
            package-name="org.apache.ofbiz.party.communication"
            default-resource-name="PartyEntityLabels"
            title="Communication Event Purpose Type">
      <field name="communicationEventPrpTypId" type="id"></field>
      <field name="parentTypeId" type="id"></field>
      <field name="hasTable" type="indicator"></field>
      <field name="description" type="description"></field>
      <prim-key field="communicationEventPrpTypId"/>
      <relation type="one" fk-name="COM_EVNT_PRP_TYP" title="Parent" rel-entity-name="CommunicationEventPrpTyp">
        <key-map field-name="parentTypeId" rel-field-name="communicationEventPrpTypId"/>
      </relation>
    </entity>
    <entity entity-name="CommunicationEventPurpose"
            package-name="org.apache.ofbiz.party.communication"
            title="Communication Event Purpose">
      <field name="communicationEventPrpTypId" type="id"></field>
      <field name="communicationEventId" type="id"></field>
      <field name="description" type="description"></field>
      <prim-key field="communicationEventPrpTypId"/>
      <prim-key field="communicationEventId"/>
      <relation type="one" fk-name="COM_EVNT_PRP_EVNT" rel-entity-name="CommunicationEvent">
        <key-map field-name="communicationEventId"/>
      </relation>
      <relation type="one" fk-name="COM_EVNT_PRP_TYPE" rel-entity-name="CommunicationEventPrpTyp">
        <key-map field-name="communicationEventPrpTypId"/>
      </relation>
    </entity>
    <entity entity-name="CommunicationEventRole"
            package-name="org.apache.ofbiz.party.communication"
            title="Communication Event Role Entity showing all participants of the communication event.">
      <field name="communicationEventId" type="id"></field>
        <field name="partyId" type="id"></field>
      <field name="roleTypeId" type="id"></field>
      <field name="contactMechId" type="id"><description>For communication event participants this represents the contactMechId of the ContactMech used.</description></field>
      <field name="statusId" type="id"></field>
      <prim-key field="communicationEventId"/>
      <prim-key field="partyId"/>
      <prim-key field="roleTypeId"/>
      <relation type="one" fk-name="COM_EVRL_CMEV" rel-entity-name="CommunicationEvent">
        <key-map field-name="communicationEventId"/>
      </relation>
      <relation type="one" fk-name="COM_EVRL_PTY" 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="COM_EVRL_PRLE" rel-entity-name="PartyRole">
        <key-map field-name="partyId"/>
        <key-map field-name="roleTypeId"/>
      </relation>
      <relation type="one" fk-name="COM_EVRL_CMCH" rel-entity-name="ContactMech">
        <key-map field-name="contactMechId"/>
      </relation>
      <relation type="one" fk-name="COM_EVRL_STTS" rel-entity-name="StatusItem">
        <key-map field-name="statusId"/>
      </relation>
    </entity>
    <entity entity-name="CommunicationEventType"
            package-name="org.apache.ofbiz.party.communication"
            title="Communication Event Type" default-resource-name="PartyEntityLabels">
      <field name="communicationEventTypeId" type="id"></field>
      <field name="parentTypeId" type="id"></field>
      <field name="hasTable" type="indicator"></field>
      <field name="description" type="description"></field>
      <field name="contactMechTypeId" type="id"></field>
      <prim-key field="communicationEventTypeId"/>
      <relation type="one" fk-name="COM_EVNT_TYPE_PAR" title="Parent" rel-entity-name="CommunicationEventType">
        <key-map field-name="parentTypeId" rel-field-name="communicationEventTypeId"/>
      </relation>
      <relation type="one" fk-name="COM_EVNT_TYPE_CMT" title="ContacMechType" rel-entity-name="ContactMechType">
        <key-map field-name="contactMechTypeId"/>
      </relation>
    </entity>
    <view-entity entity-name="CommunicationEventSum"
        package-name="org.apache.ofbiz.party.communication"
        title="Sum of communication events over status">
        <member-entity entity-alias="CE" entity-name="CommunicationEvent"/>
        <alias entity-alias="CE" name="communicationEventId" function="count"/>
        <alias entity-alias="CE" name="statusId" group-by="false"/>
        <alias entity-alias="CE" name="partyIdTo" group-by="true"/>
    </view-entity>

  <!-- ========================================================= -->
  <!-- org.apache.ofbiz.party.contact -->
  <!-- ========================================================= -->

    <entity entity-name="ContactMech"
            package-name="org.apache.ofbiz.party.contact"
            title="Contact Mechanism">
      <field name="contactMechId" type="id"></field>
      <field name="contactMechTypeId" type="id"></field>
      <field name="infoString" type="long-varchar"></field>
      <prim-key field="contactMechId"/>
      <relation type="one" fk-name="CONT_MECH_TYPE" rel-entity-name="ContactMechType">
        <key-map field-name="contactMechTypeId"/>
      </relation>
      <relation type="many" rel-entity-name="ContactMechTypeAttr">
        <key-map field-name="contactMechTypeId"/>
      </relation>
      <index name="INFO_STRING_IDX">
        <index-field name="infoString"/>
      </index>
    </entity>
    <entity entity-name="ContactMechAttribute"
            package-name="org.apache.ofbiz.party.contact"
            title="Contact Mechanism Attribute">
      <field name="contactMechId" type="id"></field>
      <field name="attrName" type="id-long"></field>
      <field name="attrValue" type="value"></field>
      <field name="attrDescription" type="description"></field>
      <prim-key field="contactMechId"/>
      <prim-key field="attrName"/>
      <relation type="one" fk-name="CONT_MECH_ATTR" rel-entity-name="ContactMech">
        <key-map field-name="contactMechId"/>
      </relation>
      <relation type="many" rel-entity-name="ContactMechTypeAttr">
        <key-map field-name="attrName"/>
      </relation>
    </entity>
    <entity entity-name="ContactMechLink"
            package-name="org.apache.ofbiz.party.contact"
            title="Contact Mechanism Link">
      <field name="contactMechIdFrom" type="id"></field>
      <field name="contactMechIdTo" type="id"></field>
      <prim-key field="contactMechIdFrom"/>
      <prim-key field="contactMechIdTo"/>
      <relation type="one" fk-name="CONT_MECH_FCMECH" title="From" rel-entity-name="ContactMech">
        <key-map field-name="contactMechIdFrom" rel-field-name="contactMechId"/>
      </relation>
      <relation type="one" fk-name="CONT_MECH_TCMECH" title="To" rel-entity-name="ContactMech">
        <key-map field-name="contactMechIdTo" rel-field-name="contactMechId"/>
      </relation>
    </entity>
    <entity entity-name="ContactMechPurposeType"
            package-name="org.apache.ofbiz.party.contact"
            default-resource-name="PartyEntityLabels"
            title="Contact Mechanism Purpose Type">
      <field name="contactMechPurposeTypeId" type="id"></field>
      <field name="description" type="description"></field>
      <prim-key field="contactMechPurposeTypeId"/>
    </entity>
    <entity entity-name="ContactMechType"
            package-name="org.apache.ofbiz.party.contact"
            title="Contact Mechanism Type" default-resource-name="PartyEntityLabels">
      <field name="contactMechTypeId" type="id"></field>
      <field name="parentTypeId" type="id"></field>
      <field name="hasTable" type="indicator"></field>
      <field name="description" type="description"></field>
      <prim-key field="contactMechTypeId"/>
      <relation type="one" fk-name="CONT_MECH_TYP_PAR" title="Parent" rel-entity-name="ContactMechType">
        <key-map field-name="parentTypeId" rel-field-name="contactMechTypeId"/>
      </relation>
    </entity>
    <entity entity-name="ContactMechTypeAttr"
            package-name="org.apache.ofbiz.party.contact"
            title="Contact Mechanism Type Attribute">
      <field name="contactMechTypeId" type="id"></field>
      <field name="attrName" type="id-long"></field>
      <field name="description" type="description"></field>
      <prim-key field="contactMechTypeId"/>
      <prim-key field="attrName"/>
      <relation type="one" fk-name="CONT_MECH_TYP_ATR" rel-entity-name="ContactMechType">
        <key-map field-name="contactMechTypeId"/>
      </relation>
      <relation type="many" rel-entity-name="ContactMechAttribute">
        <key-map field-name="attrName"/>
      </relation>
      <relation type="many" rel-entity-name="ContactMech">
        <key-map field-name="contactMechTypeId"/>
      </relation>
    </entity>
    <entity entity-name="ContactMechTypePurpose"
            package-name="org.apache.ofbiz.party.contact"
            title="Contact Mechanism Type Purpose">
      <description>Defines which ContactMechPurposeType entites apply to which ContactMechType</description>
      <field name="contactMechTypeId" type="id"></field>
      <field name="contactMechPurposeTypeId" type="id"></field>
      <prim-key field="contactMechTypeId"/>
      <prim-key field="contactMechPurposeTypeId"/>
      <relation type="one" fk-name="CONT_MECH_TP_TYPE" rel-entity-name="ContactMechType">
        <key-map field-name="contactMechTypeId"/>
      </relation>
      <relation type="one" fk-name="CONT_MECH_TP_PRPTP" rel-entity-name="ContactMechPurposeType">
        <key-map field-name="contactMechPurposeTypeId"/>
      </relation>
    </entity>
    <entity entity-name="EmailAddressVerification"
            package-name="org.apache.ofbiz.party.contact"
            title="Email Address Verification">
        <description>Holds hashes for email address verification</description>
        <field name="emailAddress" type="id-vlong"></field>
        <field name="verifyHash" type="value"></field>
        <field name="expireDate" type="date-time"></field>
        <prim-key field="emailAddress"/>
        <index name="EMAIL_VERIFY_HASH" unique="true">
            <index-field name="verifyHash"/>
        </index>
    </entity>
    <view-entity entity-name="PartyContactDetailByPurpose"
        package-name="org.apache.ofbiz.party.contact"
        title="Party Contact Purpose View">
        <member-entity entity-alias="PCM" entity-name="PartyContactMech"/>
        <member-entity entity-alias="PCMP" entity-name="PartyContactMechPurpose"/>
        <member-entity entity-alias="CM" entity-name="ContactMech"/>
        <member-entity entity-alias="PA" entity-name="PostalAddress"/>
        <member-entity entity-alias="TN" entity-name="TelecomNumber"/>
        <member-entity entity-alias="STTG" entity-name="Geo"/>
        <member-entity entity-alias="CTYG" entity-name="Geo"/>
        <member-entity entity-alias="CTRYG" entity-name="Geo"/>
        <alias-all entity-alias="PCM"/>
        <alias-all entity-alias="PA"/>
        <alias-all entity-alias="TN"/>
        <alias-all entity-alias="STTG" prefix="state"/>
        <alias-all entity-alias="CTYG" prefix="county"/>
        <alias-all entity-alias="CTRYG" prefix="country"/>
        <alias entity-alias="PCMP" name="contactMechPurposeTypeId"/>
        <alias entity-alias="PCMP" name="purposeFromDate" field="fromDate"/>
        <alias entity-alias="PCMP" name="purposeThruDate" field="thruDate"/>
        <alias entity-alias="CM" name="contactMechTypeId"/>
        <alias entity-alias="CM" name="infoString"/>
        <view-link entity-alias="PCM" rel-entity-alias="CM">
            <key-map field-name="contactMechId"/>
        </view-link>
        <view-link entity-alias="PCM" rel-entity-alias="PCMP">
            <key-map field-name="partyId"/>
            <key-map field-name="contactMechId"/>
        </view-link>
        <view-link entity-alias="CM" rel-entity-alias="PA" rel-optional="true">
            <key-map field-name="contactMechId"/>
        </view-link>
        <view-link entity-alias="CM" rel-entity-alias="TN" rel-optional="true">
            <key-map field-name="contactMechId"/>
        </view-link>
        <view-link entity-alias="PA" rel-entity-alias="STTG" rel-optional="true">
            <key-map field-name="stateProvinceGeoId" rel-field-name="geoId"/>
        </view-link>
        <view-link entity-alias="PA" rel-entity-alias="CTYG" rel-optional="true">
            <key-map field-name="countyGeoId" rel-field-name="geoId"/>
        </view-link>
        <view-link entity-alias="PA" rel-entity-alias="CTRYG" rel-optional="true">
            <key-map field-name="countryGeoId" rel-field-name="geoId"/>
        </view-link>
    </view-entity>
    <entity entity-name="PartyContactMech"
            package-name="org.apache.ofbiz.party.contact"
            title="Party Contact Mechanism">
      <field name="partyId" type="id"></field>
      <field name="contactMechId" type="id"></field>
      <field name="fromDate" type="date-time"></field>
      <field name="thruDate" type="date-time"></field>
      <field name="roleTypeId" type="id"></field>
      <field name="allowSolicitation" type="indicator"></field>
      <field name="extension" type="long-varchar"></field>
      <field name="verified" type="indicator"></field>
      <field name="comments" type="comment"></field>
      <field name="yearsWithContactMech" type="numeric"></field>
      <field name="monthsWithContactMech" type="numeric"></field>
      <prim-key field="partyId"/>
      <prim-key field="contactMechId"/>
      <prim-key field="fromDate"/>
      <relation type="one" fk-name="PARTY_CMECH_PARTY" 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>
      <relation type="one" fk-name="PARTY_CMECH_PROLE" rel-entity-name="PartyRole">
        <key-map field-name="partyId"/>
        <key-map field-name="roleTypeId"/>
      </relation>
      <relation type="one" fk-name="PARTY_CMECH_ROLE" rel-entity-name="RoleType">
        <key-map field-name="roleTypeId"/>
      </relation>
      <relation type="one" fk-name="PARTY_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="one-nofk" rel-entity-name="PostalAddress">
        <key-map field-name="contactMechId"/>
      </relation>
      <relation type="many" rel-entity-name="PartyContactMechPurpose">
        <key-map field-name="partyId"/>
        <key-map field-name="contactMechId"/>
      </relation>
    </entity>
    <entity entity-name="PartyContactMechPurpose"
            package-name="org.apache.ofbiz.party.contact"
            title="Party Contact Mechanism Purpose">
      <field name="partyId" type="id"></field>
      <field name="contactMechId" type="id"></field>
      <field name="contactMechPurposeTypeId" type="id"></field>
      <field name="fromDate" type="date-time"></field>
      <field name="thruDate" type="date-time"></field>
      <prim-key field="partyId"/>
      <prim-key field="contactMechId"/>
      <prim-key field="contactMechPurposeTypeId"/>
      <prim-key field="fromDate"/>
      <relation type="many" rel-entity-name="PartyContactMech">
        <key-map field-name="partyId"/>
        <key-map field-name="contactMechId"/>
      </relation>
      <relation type="one" fk-name="PARTY_CMPRP_TYPE" rel-entity-name="ContactMechPurposeType">
        <key-map field-name="contactMechPurposeTypeId"/>
      </relation>
      <relation type="one" fk-name="PARTY_CMPRP_PARTY" 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>
      <relation type="one" fk-name="PARTY_CMPRP_CMECH" rel-entity-name="ContactMech">
        <key-map field-name="contactMechId"/>
      </relation>
      <relation type="one-nofk" rel-entity-name="PostalAddress">
        <key-map field-name="contactMechId"/>
      </relation>
      <relation type="one-nofk" rel-entity-name="TelecomNumber">
        <key-map field-name="contactMechId"/>
      </relation>
    </entity>
    <entity entity-name="PostalAddress"
            package-name="org.apache.ofbiz.party.contact"
            title="Postal Address">
      <field name="contactMechId" type="id"></field>
      <field name="toName" type="name"></field>
      <field name="attnName" type="name"></field>
      <field name="address1" type="long-varchar"></field>
      <field name="address2" type="long-varchar"></field>
      <field name="houseNumber" type="numeric"></field>
      <field name="houseNumberExt" type="short-varchar"></field>
      <field name="directions" type="long-varchar"></field>
      <field name="city" type="name"></field>
      <field name="cityGeoId" type="id"></field>
      <field name="postalCode" type="short-varchar"></field>
      <field name="postalCodeExt" type="short-varchar"></field>
      <field name="countryGeoId" type="id"></field>
      <field name="stateProvinceGeoId" type="id"></field>
      <field name="countyGeoId" type="id"></field>
      <field name="municipalityGeoId" type="id"></field>
      <field name="postalCodeGeoId" type="id"></field>
      <field name="geoPointId" type="id"></field>
      <prim-key field="contactMechId"/>
      <relation type="one" fk-name="POST_ADDR_CMECH" rel-entity-name="ContactMech">
        <key-map field-name="contactMechId"/>
      </relation>
      <relation type="one" fk-name="POST_ADDR_CGEO" title="Country" rel-entity-name="Geo">
        <key-map field-name="countryGeoId" rel-field-name="geoId"/>
      </relation>
      <relation type="one" fk-name="POST_ADDR_SPGEO" title="StateProvince" rel-entity-name="Geo">
        <key-map field-name="stateProvinceGeoId" rel-field-name="geoId"/>
      </relation>
      <relation type="one" fk-name="POST_ADDR_CNTG" title="County" rel-entity-name="Geo">
        <key-map field-name="countyGeoId" rel-field-name="geoId"/>
      </relation>
      <relation type="one" fk-name="POST_ADDR_MNCP" title="Municipality" rel-entity-name="Geo">
        <key-map field-name="municipalityGeoId" rel-field-name="geoId"/>
      </relation>
      <relation type="one" fk-name="POST_ADDR_CITY" title="City" rel-entity-name="Geo">
        <key-map field-name="cityGeoId" rel-field-name="geoId"/>
      </relation>
      <relation type="one" fk-name="POST_ADDR_PCGEO" title="PostalCode" rel-entity-name="Geo">
        <key-map field-name="postalCodeGeoId" rel-field-name="geoId"/>
      </relation>
      <relation type="one" fk-name="POST_ADDR_GEOPT" rel-entity-name="GeoPoint">
        <key-map field-name="geoPointId"/>
      </relation>
      <index name="ADDRESS1_IDX">
        <index-field name="address1"/>
      </index>
      <index name="ADDRESS2_IDX">
        <index-field name="address2"/>
      </index>
      <index name="CITY_IDX">
        <index-field name="city"/>
      </index>
      <index name="POSTAL_CODE_IDX">
        <index-field name="postalCode"/>
      </index>
    </entity>
    <entity entity-name="PostalAddressBoundary"
            package-name="org.apache.ofbiz.party.contact"
            title="Postal Address Boundary">
      <field name="contactMechId" type="id"></field>
      <field name="geoId" type="id"></field>
      <prim-key field="contactMechId"/>
      <prim-key field="geoId"/>
      <relation type="one" fk-name="POST_ADDR_BNDRY" rel-entity-name="PostalAddress">
        <key-map field-name="contactMechId"/>
      </relation>
      <relation type="one" fk-name="POST_ADDR_BNDRYGEO" rel-entity-name="Geo">
        <key-map field-name="geoId"/>
      </relation>
    </entity>
    <entity entity-name="TelecomNumber"
            package-name="org.apache.ofbiz.party.contact"
            title="Telecommunications Number">
      <field name="contactMechId" type="id"></field>
      <field name="countryCode" type="very-short"></field>
      <field name="areaCode" type="very-short"></field>
      <field name="contactNumber" type="short-varchar"></field>
      <field name="askForName" type="name"></field>  <!-- person or department to ask for at this number -->
      <prim-key field="contactMechId"/>
      <relation type="one" fk-name="TEL_NUM_CMECH" rel-entity-name="ContactMech">
        <key-map field-name="contactMechId"/>
      </relation>
      <index name="COUNTRY_CODE_IDX">
        <index-field name="countryCode"/>
      </index>
      <index name="AREA_CODE_IDX">
        <index-field name="areaCode"/>
      </index>
      <index name="CONTACT_NUMBER_IDX">
        <index-field name="contactNumber"/>
      </index>
    </entity>
    <entity entity-name="FtpAddress"
            package-name="org.ofbiz.party.contact"
            title="Ftp server">
      <field name="contactMechId" type="id"/>
      <field name="hostname" type="long-varchar"/>
      <field name="port" type="numeric"/>
      <field name="username" type="long-varchar"/>
      <field name="ftpPassword" type="long-varchar" encrypt="true"/>
      <field name="binaryTransfer" type="indicator"/>
      <field name="filePath" type="long-varchar"/>
      <field name="zipFile" type="indicator"/>
      <field name="passiveMode" type="indicator"/>
      <field name="defaultTimeout" type="numeric"/>
      <prim-key field="contactMechId"/>
      <relation type="one" fk-name="FTP_SRV_CMECH" rel-entity-name="ContactMech">
        <key-map field-name="contactMechId"/>
      </relation>
    </entity>
    <entity entity-name="ValidContactMechRole"
            package-name="org.apache.ofbiz.party.contact"
            title="Valid Contact Mechanism Role">
      <field name="roleTypeId" type="id"></field>
      <field name="contactMechTypeId" type="id"></field>
      <prim-key field="roleTypeId"/>
      <prim-key field="contactMechTypeId"/>
      <relation type="one" fk-name="VAL_CMRLE_ROLE" rel-entity-name="RoleType">
        <key-map field-name="roleTypeId"/>
      </relation>
      <relation type="one" fk-name="VAL_CMRLE_CMTYPE" rel-entity-name="ContactMechType">
        <key-map field-name="contactMechTypeId"/>
      </relation>
    </entity>
    <view-entity entity-name="ContactMechDetail"
        package-name="org.apache.ofbiz.party.contact"
        title="Contact Mech Detail View">
        <member-entity entity-alias="CM" entity-name="ContactMech"/>
        <member-entity entity-alias="PA" entity-name="PostalAddress"/>
        <member-entity entity-alias="TN" entity-name="TelecomNumber"/>
        <alias-all entity-alias="CM"/>
        <alias-all entity-alias="PA" prefix="pa">
            <exclude field="contactMechId"/>
        </alias-all>
        <alias-all entity-alias="TN" prefix="tn">
            <exclude field="contactMechId"/>
        </alias-all>
        <view-link entity-alias="CM" rel-entity-alias="PA" rel-optional="true">
            <key-map field-name="contactMechId"/>
        </view-link>
        <view-link entity-alias="CM" rel-entity-alias="TN" rel-optional="true">
            <key-map field-name="contactMechId"/>
        </view-link>
    </view-entity>
    <view-entity entity-name="PartyAndContactMech"
        package-name="org.apache.ofbiz.party.contact"
        title="Party and Contact Mech View">
        <member-entity entity-alias="PTY" entity-name="Party"/>
        <member-entity entity-alias="PCM" entity-name="PartyContactMech"/>
        <member-entity entity-alias="CM" entity-name="ContactMech"/>
        <member-entity entity-alias="PA" entity-name="PostalAddress"/>
        <member-entity entity-alias="TN" entity-name="TelecomNumber"/>
        <alias-all entity-alias="PTY"/>
        <alias-all entity-alias="PCM"/>
        <alias-all entity-alias="CM"/>
        <alias-all entity-alias="PA" prefix="pa"/>
        <alias-all entity-alias="TN" prefix="tn"/>
        <view-link entity-alias="PTY" rel-entity-alias="PCM">
            <key-map field-name="partyId"/>
        </view-link>
        <view-link entity-alias="PCM" rel-entity-alias="CM">
            <key-map field-name="contactMechId"/>
        </view-link>
        <view-link entity-alias="PCM" rel-entity-alias="PA" rel-optional="true">
            <key-map field-name="contactMechId"/>
        </view-link>
        <view-link entity-alias="PCM" rel-entity-alias="TN" rel-optional="true">
            <key-map field-name="contactMechId"/>
        </view-link>
        <relation type="many" rel-entity-name="PartyContactMech">
            <key-map field-name="partyId"/>
            <key-map field-name="contactMechId"/>
        </relation>
        <relation type="one-nofk" rel-entity-name="Party">
            <key-map field-name="partyId"/>
        </relation>
        <relation type="one-nofk" rel-entity-name="ContactMech">
            <key-map field-name="contactMechId"/>
        </relation>
        <relation type="one-nofk" rel-entity-name="PostalAddress">
            <key-map field-name="contactMechId"/>
        </relation>
        <relation type="one-nofk" rel-entity-name="TelecomNumber">
            <key-map field-name="contactMechId"/>
        </relation>
    </view-entity>
    <view-entity entity-name="PartyAndPostalAddress"
        package-name="org.apache.ofbiz.party.contact"
        title="Party and Contact Mech/Postal Address View">
        <member-entity entity-alias="PTY" entity-name="Party"/>
        <member-entity entity-alias="PCM" entity-name="PartyContactMech"/>
        <member-entity entity-alias="CM" entity-name="ContactMech"/>
        <member-entity entity-alias="PA" entity-name="PostalAddress"/>
        <alias-all entity-alias="PA"/>
        <alias entity-alias="CM" name="contactMechId"/>
        <alias entity-alias="PTY" name="partyId"/>
        <alias entity-alias="PTY" name="statusId"/>
        <alias entity-alias="PCM" name="fromDate"/>
        <alias entity-alias="PCM" name="thruDate"/>
        <alias entity-alias="PTY" name="partyTypeId"/>
        <alias entity-alias="CM" name="contactMechTypeId"/>
        <alias entity-alias="CM" name="infoString"/>
        <alias entity-alias="PCM" name="comments"/>
        <alias entity-alias="PCM" name="extension"/>
        <alias entity-alias="PCM" name="allowSolicitation"/>
        <view-link entity-alias="PTY" rel-entity-alias="PCM">
            <key-map field-name="partyId"/>
        </view-link>
        <view-link entity-alias="PCM" rel-entity-alias="CM">
            <key-map field-name="contactMechId"/>
        </view-link>
        <view-link entity-alias="CM" rel-entity-alias="PA">
            <key-map field-name="contactMechId"/>
        </view-link>
        <relation type="many" rel-entity-name="PartyContactMech">
            <key-map field-name="partyId"/>
            <key-map field-name="contactMechId"/>
        </relation>
        <relation type="one-nofk" rel-entity-name="Party">
            <key-map field-name="partyId"/>
        </relation>
        <relation type="one-nofk" rel-entity-name="ContactMech">
            <key-map field-name="contactMechId"/>
        </relation>
        <relation type="one-nofk" rel-entity-name="PostalAddress">
            <key-map field-name="contactMechId"/>
        </relation>
    </view-entity>
    <view-entity entity-name="PartyAndTelecomNumber"
            package-name="org.apache.ofbiz.party.contact"
            title="Party and TelecomNumber View">
        <member-entity entity-alias="PTY" entity-name="Party" />
        <member-entity entity-alias="PCM" entity-name="PartyContactMech" />
        <member-entity entity-alias="TN" entity-name="TelecomNumber" />
        <alias-all entity-alias="PTY" />
        <alias-all entity-alias="PCM" />
        <alias-all entity-alias="TN" />
        <view-link entity-alias="PTY" rel-entity-alias="PCM">
            <key-map field-name="partyId" />
        </view-link>
        <view-link entity-alias="PCM" rel-entity-alias="TN">
            <key-map field-name="contactMechId" />
        </view-link>
    </view-entity>
    <view-entity entity-name="ContactListPartyAndContactMech"
        package-name="org.apache.ofbiz.party.contact">
        <member-entity entity-alias="CLP" entity-name="ContactListParty"/>
        <member-entity entity-alias="CM" entity-name="ContactMech"/>
        <member-entity entity-alias="PCM" entity-name="PartyContactMech"/>
        <alias-all entity-alias="CLP"/>
        <alias-all entity-alias="CM"/>
        <alias entity-alias="PCM" name="contactFromDate" field="fromDate"/>
        <alias entity-alias="PCM" name="contactThruDate" field="thruDate"/>
        <view-link entity-alias="CLP" rel-entity-alias="CM">
            <key-map field-name="preferredContactMechId" rel-field-name="contactMechId"/>
        </view-link>
        <view-link entity-alias="CLP" rel-entity-alias="PCM">
            <key-map field-name="preferredContactMechId" rel-field-name="contactMechId"/>
        </view-link>
        <relation type="one-nofk" rel-entity-name="ContactListParty">
            <key-map field-name="contactListId"/>
            <key-map field-name="partyId"/>
            <key-map field-name="fromDate"/>
        </relation>
    </view-entity>

  <!-- ========================================================= -->
  <!-- org.apache.ofbiz.party.need -->
  <!-- ========================================================= -->

    <entity entity-name="NeedType"
            package-name="org.apache.ofbiz.party.need"
            title="Need Type">
      <field name="needTypeId" type="id"></field>
      <field name="description" type="description"></field>
      <prim-key field="needTypeId"/>
    </entity>
    <entity entity-name="PartyNeed"
            package-name="org.apache.ofbiz.party.need"
            title="Party Need">
      <field name="partyNeedId" type="id"></field>
      <field name="partyId" type="id"></field>
      <field name="roleTypeId" type="id"></field>
      <field name="partyTypeId" type="id"></field>
      <field name="needTypeId" type="id"></field>
      <field name="communicationEventId" type="id"></field>
      <field name="productId" type="id"></field>
      <field name="productCategoryId" type="id"></field>
      <field name="visitId" type="id"></field>
      <field name="datetimeRecorded" type="date-time"></field>
      <field name="description" type="description"></field>
      <prim-key field="partyNeedId"/>
      <prim-key field="partyId"/>
      <prim-key field="roleTypeId"/>
      <relation type="one" fk-name="PARTY_NEED_NDTP" rel-entity-name="NeedType">
        <key-map field-name="needTypeId"/>
      </relation>
      <relation type="one" fk-name="PARTY_NEED_PTY" rel-entity-name="Party">
        <key-map field-name="partyId"/>
      </relation>
      <relation type="one" fk-name="PARTY_NEED_RTYP" 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="PARTY_NEED_PTTP" rel-entity-name="PartyType">
        <key-map field-name="partyTypeId"/>
      </relation>
      <relation type="one" fk-name="PARTY_NEED_CMEV" rel-entity-name="CommunicationEvent">
        <key-map field-name="communicationEventId"/>
      </relation>
      <relation type="one" fk-name="PARTY_NEED_PROD" rel-entity-name="Product">
        <key-map field-name="productId"/>
      </relation>
      <relation type="one" fk-name="PARTY_NEED_PCAT" rel-entity-name="ProductCategory">
        <key-map field-name="productCategoryId"/>
      </relation>
    </entity>

  <!-- ========================================================= -->
  <!-- org.apache.ofbiz.party.party -->
  <!-- ========================================================= -->

    <entity entity-name="AddressMatchMap"
            package-name="org.apache.ofbiz.party.party"
            title="Address Matching Map">
      <field name="mapKey" type="id-vlong"></field>
      <field name="mapValue" type="id-vlong"></field>
      <field name="sequenceNum" type="numeric"></field>
      <prim-key field="mapKey"/>
      <prim-key field="mapValue"/>
    </entity>
    <entity entity-name="Affiliate"
            package-name="org.apache.ofbiz.party.party"
            title="Affiliate Party">
      <field name="partyId" type="id"></field>
      <field name="affiliateName" type="name"></field>
      <field name="affiliateDescription" type="description"></field>
      <field name="yearEstablished" type="very-short"></field>
      <field name="siteType" type="comment"></field>
      <field name="sitePageViews" type="comment"></field>
      <field name="siteVisitors" type="comment"></field>
      <field name="dateTimeCreated" type="date-time"></field>
      <field name="dateTimeApproved" type="date-time"></field>
      <prim-key field="partyId"/>
      <relation type="one" fk-name="AFFILIATE_PARTY" rel-entity-name="Party">
        <key-map field-name="partyId"/>
      </relation>
      <relation type="one" fk-name="AFFILIATE_PGRP" rel-entity-name="PartyGroup">
        <key-map field-name="partyId"/>
      </relation>
    </entity>
    <entity entity-name="Party"
            package-name="org.apache.ofbiz.party.party"
            title="Party">
      <field name="partyId" type="id"></field>
      <field name="partyTypeId" type="id"></field>
      <field name="externalId" type="id"></field>
      <field name="preferredCurrencyUomId" type="id"></field>
      <field name="description" type="very-long"></field>
      <field name="statusId" 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>
      <field name="dataSourceId" type="id"></field>
      <field name="isUnread" type="indicator"></field>
      <prim-key field="partyId"/>
      <relation type="one" fk-name="PARTY_PTY_TYP" rel-entity-name="PartyType">
        <key-map field-name="partyTypeId"/>
      </relation>
      <relation type="one" fk-name="PARTY_CUL" title="CreatedBy" rel-entity-name="UserLogin">
        <key-map field-name="createdByUserLogin" rel-field-name="userLoginId"/>
      </relation>
      <relation type="one" fk-name="PARTY_LMCUL" title="LastModifiedBy" rel-entity-name="UserLogin">
        <key-map field-name="lastModifiedByUserLogin" rel-field-name="userLoginId"/>
      </relation>
      <relation type="one" fk-name="PARTY_PREF_CRNCY" rel-entity-name="Uom">
        <key-map field-name="preferredCurrencyUomId" rel-field-name="uomId"/>
      </relation>
      <relation type="one" fk-name="PARTY_STATUSITM" rel-entity-name="StatusItem">
        <key-map field-name="statusId"/>
      </relation>
      <relation type="many" rel-entity-name="PartyTypeAttr">
        <key-map field-name="partyTypeId"/>
      </relation>
      <relation type="one" fk-name="PARTY_DATSRC" rel-entity-name="DataSource">
        <key-map field-name="dataSourceId"/>
      </relation>
      <index name="PARTYEXT_ID_IDX">
        <index-field name="externalId"/>
      </index>
    </entity>
    <view-entity entity-name="PartyAcctgPrefAndGroup"
        package-name="org.apache.ofbiz.party.party"
        title="PartyAcctgPreference and PartyGroup">
        <member-entity entity-alias="PTYACCPREF" entity-name="PartyAcctgPreference"/>
        <member-entity entity-alias="PTYGROUP" entity-name="PartyGroup"/>
        <member-entity entity-alias="PTYROLE" entity-name="PartyRole"/>
        <alias entity-alias="PTYACCPREF"  name="partyId"/>
        <alias entity-alias="PTYACCPREF"  name="baseCurrencyUomId"/>
        <alias entity-alias="PTYGROUP"  name="groupName"/>
        <alias entity-alias="PTYROLE"  name="roleTypeId"/>
        <view-link entity-alias="PTYACCPREF" rel-entity-alias="PTYGROUP">
            <key-map field-name="partyId"/>
        </view-link>
        <view-link entity-alias="PTYACCPREF" rel-entity-alias="PTYROLE">
            <key-map field-name="partyId"/>
        </view-link>
        <entity-condition>
            <condition-expr entity-alias="PTYROLE" field-name="roleTypeId" operator="equals" value="INTERNAL_ORGANIZATIO"/>
        </entity-condition>
    </view-entity>
    <view-entity entity-name="PartyAndGroup"
        package-name="org.apache.ofbiz.party.party"
        title="Party and Party Group View">
        <member-entity entity-alias="PTY" entity-name="Party"/>
        <member-entity entity-alias="PGRP" entity-name="PartyGroup"/>
        <alias-all entity-alias="PTY"/>
        <alias-all entity-alias="PGRP"/>
        <view-link entity-alias="PTY" rel-entity-alias="PGRP">
            <key-map field-name="partyId"/>
        </view-link>
    </view-entity>
    <view-entity entity-name="PartyAndPerson"
        package-name="org.apache.ofbiz.party.party"
        title="Party and Person View">
        <member-entity entity-alias="PTY" entity-name="Party"/>
        <member-entity entity-alias="PERS" entity-name="Person"/>
        <alias-all entity-alias="PTY"/>
        <alias-all entity-alias="PERS"/>
        <view-link entity-alias="PTY" rel-entity-alias="PERS">
            <key-map field-name="partyId"/>
        </view-link>
    </view-entity>
    <view-entity entity-name="PartyAndUserLogin"
            package-name="org.apache.ofbiz.party.party"
            title="Party and Contact Mech View">
      <member-entity entity-alias="PTY" entity-name="Party"/>
      <member-entity entity-alias="ULN" entity-name="UserLogin"/>
      <alias entity-alias="PTY" name="partyId"/>
      <alias entity-alias="PTY" name="partyTypeId"/>
      <alias entity-alias="ULN" name="userLoginId"/>
      <alias entity-alias="ULN" name="currentPassword"/>
      <alias entity-alias="ULN" name="passwordHint"/>
      <alias entity-alias="ULN" name="enabled"/>
      <alias entity-alias="ULN" name="disabledDateTime"/>
      <alias entity-alias="ULN" name="successiveFailedLogins"/>
      <view-link entity-alias="PTY" rel-entity-alias="ULN">
        <key-map field-name="partyId"/>
      </view-link>
      <relation type="one-nofk" rel-entity-name="Party">
        <key-map field-name="partyId"/>
      </relation>
      <relation type="one-nofk" rel-entity-name="UserLogin">
        <key-map field-name="userLoginId"/>
      </relation>
    </view-entity>
    <view-entity entity-name="PartyAndUserLoginAndPerson"
            package-name="org.apache.ofbiz.party.party"
            title="Parts of Party and UserLogin and Person">
      <member-entity entity-alias="PTY" entity-name="Party"/>
      <member-entity entity-alias="ULN" entity-name="UserLogin"/>
      <member-entity entity-alias="PER" entity-name="Person"/>
      <alias entity-alias="PTY" name="partyId"/>
      <alias entity-alias="PTY" name="partyTypeId"/>
      <alias entity-alias="PTY" name="createdDate"/>
      <alias entity-alias="PTY" name="statusId"/>
      <alias entity-alias="ULN" name="userLoginId"/>
      <alias entity-alias="ULN" name="currentPassword"/>
      <alias entity-alias="ULN" name="passwordHint"/>
      <alias entity-alias="ULN" name="enabled"/>
      <alias entity-alias="ULN" name="disabledDateTime"/>
      <alias entity-alias="ULN" name="successiveFailedLogins"/>
      <alias entity-alias="PER" name="lastName"/>
      <alias entity-alias="PER" name="firstName"/>
      <view-link entity-alias="PTY" rel-entity-alias="ULN">
        <key-map field-name="partyId"/>
      </view-link>
      <view-link entity-alias="PTY" rel-entity-alias="PER">
        <key-map field-name="partyId"/>
      </view-link>
      <relation type="one-nofk" rel-entity-name="Party">
        <key-map field-name="partyId"/>
      </relation>
      <relation type="one-nofk" rel-entity-name="UserLogin">
        <key-map field-name="userLoginId"/>
      </relation>
    </view-entity>
  <view-entity entity-name="PartyDetailAndWorkEffortAssign"
    package-name="org.apache.ofbiz.party.party"
    title="View to show the party assignment names for a workeffort with the partyStatus and AssignStatus">
    <member-entity entity-alias="PTY" entity-name="Party"/>
    <member-entity entity-alias="WEF" entity-name="WorkEffortPartyAssignment"/>
    <member-entity entity-alias="PER" entity-name="Person"/>
    <member-entity entity-alias="PGR" entity-name="PartyGroup"/>
    <member-entity entity-alias="WE" entity-name="WorkEffort"/>
    <alias entity-alias="PTY" name="partyId"/>
    <alias entity-alias="PTY" name="partyTypeId"/>
    <alias entity-alias="PTY" field="statusId" name="partyStatusId"/>
    <alias entity-alias="WE" name="workEffortTypeId"/>
    <alias entity-alias="WEF" name="workEffortId"/>
    <alias entity-alias="WEF" name="fromDate"/>
    <alias entity-alias="WEF" name="thruDate"/>
    <alias entity-alias="WEF" name="roleTypeId"/>
    <alias entity-alias="WEF" name="statusId"/>
    <alias entity-alias="PER" name="firstName"/>
    <alias entity-alias="PER" name="middleName"/>
    <alias entity-alias="PER" name="lastName"/>
    <alias entity-alias="PGR" name="groupName"/>
    <view-link entity-alias="WEF" rel-entity-alias="PTY">
      <key-map field-name="partyId"/>
    </view-link>
    <view-link entity-alias="WEF" rel-entity-alias="WE">
      <key-map field-name="workEffortId"/>
    </view-link>
    <view-link entity-alias="PTY" rel-entity-alias="PER" rel-optional="true">
      <key-map field-name="partyId"/>
    </view-link>
    <view-link entity-alias="PTY" rel-entity-alias="PGR" rel-optional="true">
      <key-map field-name="partyId"/>
    </view-link>
  </view-entity>
  
     <entity entity-name="PartyIdentification"
            package-name="org.apache.ofbiz.party.party"
            title="Party Identification">
      <field name="partyId" type="id"></field>
      <field name="partyIdentificationTypeId" type="id"></field>
      <field name="idValue" type="id-long"></field>
      <prim-key field="partyId"/>
      <prim-key field="partyIdentificationTypeId"/>
      <relation type="one" fk-name="PARTY_ID_TYPE" rel-entity-name="PartyIdentificationType">
        <key-map field-name="partyIdentificationTypeId"/>
      </relation>
      <relation type="one" fk-name="PARTY_ID_PRODUCT" rel-entity-name="Party">
        <key-map field-name="partyId"/>
      </relation>
      <index name="PARTY_ID_VALIDX" unique="false">
          <index-field name="idValue"/>
      </index>
    </entity> 
    <view-entity entity-name="PartyIdentificationAndParty"
                package-name="org.apache.ofbiz.party.party"
                title="PartyIdentification and Party View">
      <member-entity entity-alias="PIN" entity-name="PartyIdentification"/>
      <member-entity entity-alias="PIT" entity-name="PartyIdentificationType"/>
      <member-entity entity-alias="PA" entity-name="Party"/>
      <alias-all entity-alias="PIN" />
      <alias-all entity-alias="PA" />
      <alias name="partyIdentTypeDesc" field="description"  entity-alias="PIT"/>
      <view-link entity-alias="PIN" rel-entity-alias="PA">
        <key-map field-name="partyId"/>
      </view-link>
      <view-link entity-alias="PIN" rel-entity-alias="PIT">
        <key-map field-name="partyIdentificationTypeId"/>
      </view-link>
    </view-entity>
    <entity entity-name="PartyIdentificationType"
            package-name="org.apache.ofbiz.party.party"
            default-resource-name="PartyEntityLabels"
            title="Party Identification Type">
      <field name="partyIdentificationTypeId" type="id"></field>
      <field name="parentTypeId" type="id"></field>
      <field name="hasTable" type="indicator"></field>
      <field name="description" type="description"></field>
      <prim-key field="partyIdentificationTypeId"/>
      <relation type="one" fk-name="PARTY_ID_TYPE_PAR" title="Parent" rel-entity-name="PartyIdentificationType">
        <key-map field-name="parentTypeId" rel-field-name="partyIdentificationTypeId"/>
      </relation>
    </entity>
  
    <entity entity-name="PartyGeoPoint"
        package-name="org.apache.ofbiz.party.party"
        title="Party Geo Location with history">
        <field name="partyId" type="id"></field>
        <field name="geoPointId" type="id"></field>
        <field name="fromDate" type="date-time"></field>
        <field name="thruDate" type="date-time"></field>
        <prim-key field="partyId"/>
        <prim-key field="geoPointId"/>
        <prim-key field="fromDate"/>
        <relation type="one" fk-name="PARTYGEOPT_PARTY" rel-entity-name="Party">
            <key-map field-name="partyId"/>
        </relation>
        <relation type="one" fk-name="PARTYGEOPT_GEOPT" rel-entity-name="GeoPoint">
            <key-map field-name="geoPointId"/>
        </relation>
    </entity>
    <view-entity entity-name="PartyAndGeoPoint"
        package-name="org.apache.ofbiz.party.party"
        title="Party and Geo Point View">
        <member-entity entity-alias="PTY" entity-name="Party"/>
        <member-entity entity-alias="PGPT" entity-name="PartyGeoPoint"/>
        <member-entity entity-alias="GPT" entity-name="GeoPoint"/>
        <alias-all entity-alias="GPT"/>
        <alias entity-alias="PTY" name="partyId"/>
        <alias entity-alias="PGPT" name="fromDate"/>
        <alias entity-alias="PGPT" name="thruDate"/>
        <view-link entity-alias="PTY" rel-entity-alias="PGPT">
            <key-map field-name="partyId"/>
        </view-link>
        <view-link entity-alias="PGPT" rel-entity-alias="GPT">
            <key-map field-name="geoPointId"/>
        </view-link>
        <relation type="many" rel-entity-name="PartyGeoPoint">
            <key-map field-name="partyId"/>
            <key-map field-name="geoPointId"/>
        </relation>
        <relation type="one-nofk" rel-entity-name="Party">
            <key-map field-name="partyId"/>
        </relation>
        <relation type="one-nofk" rel-entity-name="GeoPoint">
            <key-map field-name="geoPointId"/>
        </relation>
    </view-entity>
    <view-entity entity-name="UserLoginAndPartyDetails"
            package-name="org.apache.ofbiz.party.party"
            title="UserLogin, Party, Person and PartyGroup">
      <member-entity entity-alias="ULN" entity-name="UserLogin"/>
      <member-entity entity-alias="PTY" entity-name="Party"/>
      <member-entity entity-alias="PER" entity-name="Person"/>
      <member-entity entity-alias="PTYGRP" entity-name="PartyGroup"/>
      <alias entity-alias="PTY" name="partyId"/>
      <alias entity-alias="PTY" name="partyTypeId"/>
      <alias entity-alias="PTY" name="createdDate"/>
      <alias entity-alias="PTY" name="statusId"/>
      <alias entity-alias="PTYGRP" name="groupName"/>
      <alias entity-alias="ULN" name="userLoginId"/>
      <alias entity-alias="ULN" name="currentPassword"/>
      <alias entity-alias="ULN" name="passwordHint"/>
      <alias entity-alias="ULN" name="enabled"/>
      <alias entity-alias="ULN" name="disabledDateTime"/>
      <alias entity-alias="ULN" name="successiveFailedLogins"/>
      <alias entity-alias="PER" name="lastName"/>
      <alias entity-alias="PER" name="middleName"/>
      <alias entity-alias="PER" name="firstName"/>
      <view-link entity-alias="ULN" rel-entity-alias="PTY" rel-optional="true">
        <key-map field-name="partyId"/>
      </view-link>
      <view-link entity-alias="ULN" rel-entity-alias="PER" rel-optional="true">
        <key-map field-name="partyId"/>
      </view-link>
      <view-link entity-alias="ULN" rel-entity-alias="PTYGRP" rel-optional="true">
        <key-map field-name="partyId"/>
      </view-link>
      <relation type="one-nofk" rel-entity-name="Party">
        <key-map field-name="partyId"/>
      </relation>
      <relation type="one-nofk" rel-entity-name="UserLogin">
        <key-map field-name="userLoginId"/>
      </relation>
    </view-entity>
    <entity entity-name="PartyAttribute"
            package-name="org.apache.ofbiz.party.party"
            title="Party Attribute">
      <field name="partyId" type="id"></field>
      <field name="attrName" type="id-long"></field>
      <field name="attrValue" type="value"></field>
      <field name="attrDescription" type="description"></field>
      <prim-key field="partyId"/>
      <prim-key field="attrName"/>
      <relation type="one" fk-name="PARTY_ATTR" rel-entity-name="Party">
        <key-map field-name="partyId"/>
      </relation>
      <relation type="many" rel-entity-name="PartyTypeAttr">
        <key-map field-name="attrName"/>
      </relation>
    </entity>
    <entity entity-name="PartyCarrierAccount"
        package-name="org.apache.ofbiz.party.party"
        title="Party Carrier Account">
        <field name="partyId" type="id"></field>
        <field name="carrierPartyId" type="id"></field>
        <field name="fromDate" type="date-time"></field>
        <field name="thruDate" type="date-time"></field>
        <field name="accountNumber" type="id"><!-- the customer's or user's account number, also known as the shipper number sometimes --></field>
        <prim-key field="partyId"/>
        <prim-key field="carrierPartyId"/>
        <prim-key field="fromDate"/>
        <relation type="one" fk-name="PARTY_CRRACT_PTY" rel-entity-name="Party">
            <key-map field-name="partyId"/>
        </relation>
        <relation type="one" fk-name="PARTY_CRRACT_CPT" title="Carrier" rel-entity-name="Party">
            <key-map field-name="carrierPartyId" rel-field-name="partyId"/>
        </relation>
    </entity>
    <entity entity-name="PartyClassification"
            package-name="org.apache.ofbiz.party.party"
            title="Party Classification">
      <field name="partyId" type="id"></field>
      <field name="partyClassificationGroupId" type="id"></field>
      <field name="fromDate" type="date-time"></field>
      <field name="thruDate" type="date-time"></field>
      <prim-key field="partyId"/>
      <prim-key field="partyClassificationGroupId"/>
      <prim-key field="fromDate"/>
      <relation type="one" fk-name="PARTY_CLASS_PARTY" rel-entity-name="Party">
        <key-map field-name="partyId"/>
      </relation>
      <relation type="one" fk-name="PARTY_CLASS_GRP" rel-entity-name="PartyClassificationGroup">
        <key-map field-name="partyClassificationGroupId"/>
      </relation>
    </entity>
    <entity entity-name="PartyClassificationGroup"
            package-name="org.apache.ofbiz.party.party"
            title="Party Classification Group">
      <field name="partyClassificationGroupId" type="id"></field>
      <field name="partyClassificationTypeId" type="id"></field>
      <field name="parentGroupId" type="id"></field>
      <field name="description" type="description"></field>
      <prim-key field="partyClassificationGroupId"/>
      <relation type="one" fk-name="PARTY_CLASS_GRPPAR" title="Parent" rel-entity-name="PartyClassificationGroup">
        <key-map field-name="parentGroupId" rel-field-name="partyClassificationGroupId"/>
      </relation>
      <relation type="one" fk-name="PARTY_CLSGRP_TYPE" rel-entity-name="PartyClassificationType">
        <key-map field-name="partyClassificationTypeId"/>
      </relation>
    </entity>
    <entity entity-name="PartyClassificationType"
            package-name="org.apache.ofbiz.party.party"
            default-resource-name="PartyEntityLabels"
            title="Party Classification Type">
      <field name="partyClassificationTypeId" type="id"></field>
      <field name="parentTypeId" type="id"></field>
      <field name="hasTable" type="indicator"></field>
      <field name="description" type="description"></field>
      <prim-key field="partyClassificationTypeId"/>
      <relation type="one" fk-name="PARTY_CLASS_TYPPAR" title="Parent" rel-entity-name="PartyClassificationType">
        <key-map field-name="parentTypeId" rel-field-name="partyClassificationTypeId"/>
      </relation>
    </entity>
    <view-entity entity-name="PartyContactWithPurpose"
            package-name="org.apache.ofbiz.party.party"
            title="Party Contact Purpose View">
      <member-entity entity-alias="PCMP" entity-name="PartyContactMechPurpose"/>
      <member-entity entity-alias="CM" entity-name="ContactMech"/>
      <member-entity entity-alias="PCM" entity-name="PartyContactMech"/>
      <member-entity entity-alias="PT" entity-name="ContactMechPurposeType"/>
      <alias entity-alias="CM" name="contactMechId"/>
      <alias entity-alias="PCM" name="partyId"/>
      <alias entity-alias="PCMP" name="contactMechPurposeTypeId"/>
      <alias entity-alias="PCM" name="contactFromDate" field="fromDate"/>
      <alias entity-alias="PCM" name="contactThruDate" field="thruDate"/>
      <alias entity-alias="PCMP" name="purposeFromDate" field="fromDate"/>
      <alias entity-alias="PCMP" name="purposeThruDate" field="thruDate"/>
      <alias entity-alias="CM" name="contactMechTypeId"/>
      <alias entity-alias="CM" name="infoString"/>
      <alias entity-alias="PCM" name="comments"/>
      <alias entity-alias="PCM" name="extension"/>
      <alias entity-alias="PCM" name="allowSolicitation"/>
      <alias entity-alias="PT" name="purposeDescription" field="description"/>
      <view-link entity-alias="PCMP" rel-entity-alias="CM">
        <key-map field-name="contactMechId"/>
      </view-link>
      <view-link entity-alias="PCMP" rel-entity-alias="PCM">
        <key-map field-name="partyId"/>
        <key-map field-name="contactMechId"/>
      </view-link>
      <view-link entity-alias="PCMP" rel-entity-alias="PT">
        <key-map field-name="contactMechPurposeTypeId"/>
      </view-link>
      <relation type="many" rel-entity-name="PartyContactMech">
        <key-map field-name="partyId"/>
        <key-map field-name="contactMechId"/>
      </relation>
      <relation type="one-nofk" rel-entity-name="ContactMechPurposeType">
        <key-map field-name="contactMechPurposeTypeId"/>
      </relation>
      <relation type="one-nofk" rel-entity-name="Party">
        <key-map field-name="partyId"/>
      </relation>
      <relation type="one-nofk" rel-entity-name="ContactMech">
        <key-map field-name="contactMechId"/>
      </relation>
      <relation type="one-nofk" rel-entity-name="TelecomNumber">
        <key-map field-name="contactMechId"/>
      </relation>
    </view-entity>
    <entity entity-name="PartyContent"
            package-name="org.apache.ofbiz.party.party"
            title="Party Data Object">
      <field name="partyId" type="id"></field>
      <field name="contentId" type="id"></field>
      <field name="partyContentTypeId" type="id"></field>
      <field name="fromDate" type="date-time"></field>
      <field name="thruDate" type="date-time"></field>
      <prim-key field="partyId"/>
      <prim-key field="contentId"/>
      <prim-key field="partyContentTypeId"/>
      <prim-key field="fromDate"/>
      <relation type="one" fk-name="PARTY_CNT_PARTY" rel-entity-name="Party">
        <key-map field-name="partyId"/>
      </relation>
      <relation type="one" fk-name="PARTY_CNT_CNT" rel-entity-name="Content">
        <key-map field-name="contentId"/>
      </relation>
      <relation type="one" fk-name="PARTY_CNT_TYPE" rel-entity-name="PartyContentType">
        <key-map field-name="partyContentTypeId"/>
      </relation>
    </entity>
    <view-entity entity-name="PartyContentDetail" package-name="org.apache.ofbiz.content.content" title="Party Content Detail View">
        <member-entity entity-alias="PCT" entity-name="PartyContent"/>
        <member-entity entity-alias="CNT" entity-name="Content"/>
        <alias-all entity-alias="PCT"/>
        <alias-all entity-alias="CNT"/>
        <view-link entity-alias="PCT" 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="PartyContentType"
            package-name="org.apache.ofbiz.party.party"
            default-resource-name="PartyEntityLabels"
            title="Party Content Type">
        <field name="partyContentTypeId" type="id"></field>
        <field name="parentTypeId" type="id"></field>
        <field name="description" type="description"></field>
        <prim-key field="partyContentTypeId"/>
        <relation type="one" fk-name="PARTYCNT_TP_PAR" title="Parent" rel-entity-name="PartyContentType">
            <key-map field-name="parentTypeId" rel-field-name="partyContentTypeId"/>
        </relation>
    </entity>
    <entity entity-name="PartyDataSource"
            package-name="org.apache.ofbiz.party.party"
            title="Party Data Source">
      <field name="partyId" type="id"></field>
      <field name="dataSourceId" type="id"></field>
      <field name="fromDate" type="date-time"></field>
      <field name="visitId" type="id"></field>
      <field name="comments" type="comment"></field>
      <field name="isCreate" type="indicator"></field>
      <prim-key field="partyId"/>
      <prim-key field="dataSourceId"/>
      <prim-key field="fromDate"/>
      <relation type="one" fk-name="PARTY_DATSRC_PTY" rel-entity-name="Party">
        <key-map field-name="partyId"/>
      </relation>
      <relation type="one" fk-name="PARTY_DATSRC_DSC" rel-entity-name="DataSource">
        <key-map field-name="dataSourceId"/>
      </relation>
    </entity>
    <entity entity-name="PartyGroup"
            package-name="org.apache.ofbiz.party.party"
            title="Party Group">
      <field name="partyId" type="id"></field>
      <field name="groupName" type="name"></field>
      <field name="groupNameLocal" type="name"></field>
      <field name="officeSiteName" type="name"></field>
      <field name="annualRevenue" type="currency-amount"></field>
      <field name="numEmployees" type="numeric"></field>
      <field name="tickerSymbol" type="very-short"></field>
      <field name="comments" type="comment"></field>
      <field name="logoImageUrl" type="url"></field>
      <prim-key field="partyId"/>
      <relation type="one" fk-name="PARTY_GRP_PARTY" rel-entity-name="Party">
        <key-map field-name="partyId"/>
      </relation>
      <index name="GROUP_NAME_IDX">
        <index-field name="groupName"/>
      </index>
    </entity>
    <entity entity-name="PartyIcsAvsOverride"
            package-name="org.apache.ofbiz.party.party"
            title="Party ICS AVS Override">
      <field name="partyId" type="id"></field>
      <field name="avsDeclineString" type="long-varchar"></field>
      <prim-key field="partyId"/>
      <relation type="one" fk-name="PARTY_ICSAVS_PARTY" rel-entity-name="Party">
        <key-map field-name="partyId"/>
      </relation>
    </entity>
    <entity entity-name="PartyInvitation"
            package-name="org.apache.ofbiz.party.party"
            title="Party Invitation">
        <field name="partyInvitationId" type="id"></field>
        <field name="partyIdFrom" type="id"></field>
        <field name="partyId" type="id"></field>
        <field name="toName" type="name"></field>
        <field name="emailAddress" type="long-varchar"></field>
        <field name="statusId" type="id"></field>
        <field name="lastInviteDate" type="date-time"></field>
        <prim-key field="partyInvitationId"/>
        <relation type="one" fk-name="PTYINV_PTY" rel-entity-name="Party">
            <key-map field-name="partyIdFrom" rel-field-name="partyId"/>
        </relation>
        <relation type="one" fk-name="PTYINV_STTS" rel-entity-name="StatusItem">
            <key-map field-name="statusId"/>
        </relation>
    </entity>
    <entity entity-name="PartyInvitationGroupAssoc"
            package-name="org.apache.ofbiz.party.party"
            title="Party Invitation Group Assoc">
        <field name="partyInvitationId" type="id"></field>
        <field name="partyIdTo" type="id"></field>
        <prim-key field="partyInvitationId"/>
        <prim-key field="partyIdTo"/>
        <relation type="one" fk-name="PTYINVGA_PTYGRP" title="To" rel-entity-name="PartyGroup">
            <key-map field-name="partyIdTo" rel-field-name="partyId"/>
        </relation>
        <relation type="one" fk-name="PTYINVGA_PTYTO" title="To" rel-entity-name="Party">
            <key-map field-name="partyIdTo" rel-field-name="partyId"/>
        </relation>
        <relation type="one" fk-name="PTYINVGA_PTYINV" rel-entity-name="PartyInvitation">
            <key-map field-name="partyInvitationId"/>
        </relation>
    </entity>
    <entity entity-name="PartyInvitationRoleAssoc"
            package-name="org.apache.ofbiz.party.party"
            title="Party Invitation Role Assoc">
        <field name="partyInvitationId" type="id"></field>
        <field name="roleTypeId" type="id"></field>
        <prim-key field="partyInvitationId"/>
        <prim-key field="roleTypeId"/>
        <relation type="one" fk-name="PTYINVROLE_ROLET" rel-entity-name="RoleType">
            <key-map field-name="roleTypeId"/>
        </relation>
        <relation type="one" fk-name="PTYINVROLE_PTYINV" rel-entity-name="PartyInvitation">
            <key-map field-name="partyInvitationId"/>
        </relation>
    </entity>
  <view-entity entity-name="PartyNameContactMechView"
    package-name="org.apache.ofbiz.party.party"
    title="Party Name Contact Mech View">
    <member-entity entity-alias="PTY" entity-name="Party"/>
    <member-entity entity-alias="PER" entity-name="Person"/>
    <member-entity entity-alias="PTYGRP" entity-name="PartyGroup"/>
    <member-entity entity-alias="PTYPCM" entity-name="PartyContactMech"/>
    <member-entity entity-alias="PTYCM" entity-name="ContactMech"/>
    <alias entity-alias="PTY" name="partyId"/>
    <alias entity-alias="PTY" name="partyTypeId"/>
    <alias entity-alias="PTY" name="statusId"/>
    <alias entity-alias="PER" name="firstName"/>
    <alias entity-alias="PER" name="middleName"/>
    <alias entity-alias="PER" name="lastName"/>
    <alias entity-alias="PER" name="firstNameLocal"/>
    <alias entity-alias="PER" name="lastNameLocal"/>
    <alias entity-alias="PER" name="personalTitle"/>
    <alias entity-alias="PER" name="suffix"/>
    <alias entity-alias="PTYGRP" name="groupName"/>
    <alias entity-alias="PTYGRP" name="groupNameLocal"/>
    <alias entity-alias="PTYPCM" name="contactMechId"/>
    <alias entity-alias="PTYPCM" name="fromDate"/>
    <alias entity-alias="PTYPCM" name="thruDate"/>
    <alias entity-alias="PTYCM" name="contactMechTypeId"/>
    <alias entity-alias="PTYCM" name="infoString"/>
    <view-link entity-alias="PTY" rel-entity-alias="PER" rel-optional="true">
      <key-map field-name="partyId"/>
    </view-link>
    <view-link entity-alias="PTY" rel-entity-alias="PTYGRP" rel-optional="true">
      <key-map field-name="partyId"/>
    </view-link>
    <view-link entity-alias="PTY" rel-entity-alias="PTYPCM" rel-optional="false">
      <key-map field-name="partyId"/>
    </view-link>
    <view-link entity-alias="PTYPCM" rel-entity-alias="PTYCM" rel-optional="false">
      <key-map field-name="contactMechId"/>
    </view-link>
    <relation type="one-nofk" rel-entity-name="Party">
      <key-map field-name="partyId"/>
    </relation>
  </view-entity>
  <entity entity-name="PartyNameHistory"
        package-name="org.apache.ofbiz.party.party"
        title="Party Name History">
        <field name="partyId" type="id"></field>
        <field name="changeDate" type="date-time"></field>
        <field name="groupName" type="name"><description>For Party Groups only</description></field>
        <field name="firstName" type="name"></field>
        <field name="middleName" type="name"></field>
        <field name="lastName" type="name"></field>
        <field name="personalTitle" type="name"></field>
        <field name="suffix" type="name"></field>
        <prim-key field="partyId"/>
        <prim-key field="changeDate"/>
        <relation type="one" fk-name="PTY_NMHIS_PARTY" rel-entity-name="Party">
            <key-map field-name="partyId"/>
        </relation>
    </entity>
    <view-entity entity-name="PartyNameView"
            package-name="org.apache.ofbiz.party.party"
            title="Party Name View">
      <member-entity entity-alias="PTY" entity-name="Party"/>
      <member-entity entity-alias="PER" entity-name="Person"/>
      <member-entity entity-alias="PTYGRP" entity-name="PartyGroup"/>
      <alias entity-alias="PTY" name="partyId"/>
      <alias entity-alias="PTY" name="partyTypeId"/>
      <alias entity-alias="PTY" name="description"/>
      <alias entity-alias="PTY" name="statusId"/>
      <alias entity-alias="PER" name="firstName"/>
      <alias entity-alias="PER" name="middleName"/>
      <alias entity-alias="PER" name="lastName"/>
      <alias entity-alias="PER" name="firstNameLocal"/>
      <alias entity-alias="PER" name="lastNameLocal"/>
      <alias entity-alias="PER" name="personalTitle"/>
      <alias entity-alias="PER" name="suffix"/>
      <alias entity-alias="PTYGRP" name="groupName"/>
      <alias entity-alias="PTYGRP" name="groupNameLocal"/>
      <view-link entity-alias="PTY" rel-entity-alias="PER" rel-optional="true">
        <key-map field-name="partyId"/>
      </view-link>
      <view-link entity-alias="PTY" rel-entity-alias="PTYGRP" rel-optional="true">
        <key-map field-name="partyId"/>
      </view-link>
      <relation type="one-nofk" rel-entity-name="Party">
        <key-map field-name="partyId"/>
      </relation>
    </view-entity>
  <entity entity-name="PartyNote"
            package-name="org.apache.ofbiz.party.party"
            title="Party Note">
      <field name="partyId" type="id"></field>
      <field name="noteId" type="id"></field>
      <prim-key field="partyId"/>
      <prim-key field="noteId"/>
      <relation type="one" fk-name="PARTY_NOTE_PARTY" rel-entity-name="Party">
        <key-map field-name="partyId"/>
      </relation>
      <relation type="one" fk-name="PARTY_NOTE_NOTE" rel-entity-name="NoteData">
        <key-map field-name="noteId"/>
      </relation>
    </entity>
    <view-entity entity-name="PartyNoteView"
            package-name="org.apache.ofbiz.party.party"
            title="Party Note View">
      <member-entity entity-alias="PN" entity-name="PartyNote"/>
      <member-entity entity-alias="ND" entity-name="NoteData"/>
      <alias entity-alias="PN" name="targetPartyId" field="partyId"/>
      <alias entity-alias="ND" name="noteId"/>
      <alias entity-alias="ND" name="noteName"/>
      <alias entity-alias="ND" name="noteInfo"/>
      <alias entity-alias="ND" name="noteDateTime"/>
      <alias entity-alias="ND" name="noteParty"/>
      <view-link entity-alias="PN" rel-entity-alias="ND">
        <key-map field-name="noteId"/>
      </view-link>
    </view-entity>
    <entity entity-name="PartyProfileDefault"
            package-name="org.apache.ofbiz.party.party"
            title="Party Profile Defaults">
      <field name="partyId" type="id"></field>
      <field name="productStoreId" type="id"></field>
      <field name="defaultShipAddr" type="id"></field>
      <field name="defaultBillAddr" type="id"></field>
      <field name="defaultPayMeth" type="id"></field>
      <field name="defaultShipMeth" type="id"></field>
      <prim-key field="partyId"/>
      <prim-key field="productStoreId"/>
      <relation type="one" fk-name="PARTY_PROF_PARTY" rel-entity-name="Party">
        <key-map field-name="partyId"/>
      </relation>
      <relation type="one" fk-name="PARTY_PROF_PSTORE" rel-entity-name="ProductStore">
        <key-map field-name="productStoreId"/>
      </relation>
    </entity>
    <entity entity-name="PartyRelationship"
            package-name="org.apache.ofbiz.party.party"
            title="Party Relationship">
      <field name="partyIdFrom" type="id"></field>
      <field name="partyIdTo" type="id"></field>
      <field name="roleTypeIdFrom" type="id"></field>
      <field name="roleTypeIdTo" type="id"></field>
      <field name="fromDate" type="date-time"></field>
      <field name="thruDate" type="date-time"></field>
      <field name="statusId" type="id"></field>
      <field name="relationshipName" type="name">
          <description>Official name of relationship, such as title in a company</description>
      </field>
      <field name="securityGroupId" type="id"></field>
      <field name="priorityTypeId" type="id"></field>
      <field name="partyRelationshipTypeId" type="id"></field>
      <field name="permissionsEnumId" type="id"></field>
      <field name="positionTitle" type="name"><description>The exact word used within the company</description></field>
      <field name="comments" type="comment"></field>
      <prim-key field="partyIdFrom"/>
      <prim-key field="partyIdTo"/>
      <prim-key field="roleTypeIdFrom"/>
      <prim-key field="roleTypeIdTo"/>
      <prim-key field="fromDate"/>
      <relation type="one-nofk" title="From" rel-entity-name="Party">
        <key-map field-name="partyIdFrom" rel-field-name="partyId"/>
      </relation>
      <relation type="one-nofk" title="To" rel-entity-name="Party">
        <key-map field-name="partyIdTo" rel-field-name="partyId"/>
      </relation>
      <relation type="one-nofk" title="From" rel-entity-name="RoleType">
        <key-map field-name="roleTypeIdFrom" rel-field-name="roleTypeId"/>
      </relation>
      <relation type="one-nofk" title="To" rel-entity-name="RoleType">
        <key-map field-name="roleTypeIdTo" rel-field-name="roleTypeId"/>
      </relation>
      <relation type="one" fk-name="PARTY_REL_FPROLE" title="From" rel-entity-name="PartyRole">
        <key-map field-name="partyIdFrom" rel-field-name="partyId"/>
        <key-map field-name="roleTypeIdFrom" rel-field-name="roleTypeId"/>
      </relation>
      <relation type="one" fk-name="PARTY_REL_TPROLE" title="To" rel-entity-name="PartyRole">
        <key-map field-name="partyIdTo" rel-field-name="partyId"/>
        <key-map field-name="roleTypeIdTo" rel-field-name="roleTypeId"/>
      </relation>
      <relation type="one" fk-name="PARTY_REL_STTS" rel-entity-name="StatusItem">
        <key-map field-name="statusId"/>
      </relation>
      <relation type="one" fk-name="PARTY_REL_PRTYP" rel-entity-name="PriorityType">
        <key-map field-name="priorityTypeId"/>
      </relation>
      <relation type="one" fk-name="PARTY_REL_TYPE" rel-entity-name="PartyRelationshipType">
        <key-map field-name="partyRelationshipTypeId"/>
      </relation>
      <relation type="one" fk-name="PARTY_REL_SECGRP" rel-entity-name="SecurityGroup">
        <key-map field-name="securityGroupId" rel-field-name="groupId"/>
      </relation>
    </entity>
    <view-entity entity-name="PartyRelationshipToFrom" package-name="org.apache.ofbiz.party.party">
        <description>
            Links two PartyRelationships together to be used to get a member of a group that is a member of a group, so links the to party of the first to the from party of the second.
            To query the group ID would go on onePartyIdFrom and the member ID would go in twoPartyIdTo.
        </description>
        <member-entity entity-alias="PR1" entity-name="PartyRelationship"/>
        <member-entity entity-alias="PR2" entity-name="PartyRelationship"/>
        <alias-all entity-alias="PR1" prefix="one"/>
        <alias-all entity-alias="PR2" prefix="two"/>
        <view-link entity-alias="PR1" rel-entity-alias="PR2">
            <key-map field-name="partyIdTo" rel-field-name="partyIdFrom"/>
        </view-link>
    </view-entity>
    <entity entity-name="PartyRelationshipType"
            package-name="org.apache.ofbiz.party.party"
            default-resource-name="PartyEntityLabels"
            title="Party Relationship Type">
      <field name="partyRelationshipTypeId" type="id"></field>
      <field name="parentTypeId" type="id"></field>
      <field name="hasTable" type="indicator"></field>
      <field name="partyRelationshipName" type="name"></field>
      <field name="description" type="description"></field>
      <field name="roleTypeIdValidFrom" type="id"></field>
      <field name="roleTypeIdValidTo" type="id"></field>
      <prim-key field="partyRelationshipTypeId"/>
      <relation type="one" fk-name="PARTY_RELTYP_PAR" title="Parent" rel-entity-name="PartyRelationshipType">
        <key-map field-name="parentTypeId" rel-field-name="partyRelationshipTypeId"/>
      </relation>
      <relation type="one" fk-name="PARTY_RELTYP_VFRT" title="ValidFrom" rel-entity-name="RoleType">
        <key-map field-name="roleTypeIdValidFrom" rel-field-name="roleTypeId"/>
      </relation>
      <relation type="one" fk-name="PARTY_RELTYP_VTRT" title="ValidTo" rel-entity-name="RoleType">
        <key-map field-name="roleTypeIdValidTo" rel-field-name="roleTypeId"/>
      </relation>
    </entity>
    <view-entity entity-name="PartyRelationshipAndDetail" package-name="org.apache.ofbiz.party.party" title="Party Relationship And Details">
      <member-entity entity-alias="PTY" entity-name="Party"/>
      <member-entity entity-alias="PTYREL" entity-name="PartyRelationship"/>
      <member-entity entity-alias="PER" entity-name="Person"/>
      <member-entity entity-alias="PTYGRP" entity-name="PartyGroup"/>
      <alias-all entity-alias="PTYREL"/>
      <alias entity-alias="PTY" name="partyId"/>
      <alias entity-alias="PTY" name="partyTypeId"/>
      <alias entity-alias="PTY" name="description"/>
      <alias entity-alias="PTY" name="partyStatusId" field="statusId"/>
      <alias entity-alias="PER" name="firstName"/>
      <alias entity-alias="PER" name="middleName"/>
      <alias entity-alias="PER" name="lastName"/>
      <alias entity-alias="PER" name="firstNameLocal"/>
      <alias entity-alias="PER" name="lastNameLocal"/>
      <alias entity-alias="PER" name="personalTitle"/>
      <alias entity-alias="PER" name="suffix"/>
      <alias entity-alias="PTYGRP" name="groupName"/>
      <alias entity-alias="PTYGRP" name="groupNameLocal"/>
      <view-link entity-alias="PTY" rel-entity-alias="PTYREL" rel-optional="true">
        <key-map field-name="partyId" rel-field-name="partyIdTo"/>
      </view-link>
      <view-link entity-alias="PTY" rel-entity-alias="PER" rel-optional="true">
        <key-map field-name="partyId"/>
      </view-link>
      <view-link entity-alias="PTY" rel-entity-alias="PTYGRP" rel-optional="true">
        <key-map field-name="partyId"/>
      </view-link>
      <relation type="one-nofk" rel-entity-name="Party">
        <key-map field-name="partyId"/>
      </relation>
    </view-entity>
    <view-entity entity-name="PartyRelationshipAndContactMechDetail" package-name="org.apache.ofbiz.party.party" title="Party Relationship And Contact Mech Details">
        <member-entity entity-alias="PTY" entity-name="Party"/>
        <member-entity entity-alias="PTYREL" entity-name="PartyRelationship"/>
        <member-entity entity-alias="PER" entity-name="Person"/>
        <member-entity entity-alias="PTYGRP" entity-name="PartyGroup"/>
        <member-entity entity-alias="PCM" entity-name="PartyContactMech"/>
        <member-entity entity-alias="CM" entity-name="ContactMech"/>
        <member-entity entity-alias="PA" entity-name="PostalAddress"/>
        <member-entity entity-alias="TN" entity-name="TelecomNumber"/>
        <alias-all entity-alias="PTY">
            <exclude field="statusId"/>
        </alias-all>
        <alias-all entity-alias="PTYREL"/>
        <alias-all entity-alias="CM"/>
        <alias-all entity-alias="PA" prefix="pa"/>
        <alias-all entity-alias="TN" prefix="tn"/>
        <alias entity-alias="PER" name="firstName"/>
        <alias entity-alias="PER" name="middleName"/>
        <alias entity-alias="PER" name="lastName"/>
        <alias entity-alias="PER" name="firstNameLocal"/>
        <alias entity-alias="PER" name="lastNameLocal"/>
        <alias entity-alias="PER" name="personalTitle"/>
        <alias entity-alias="PER" name="suffix"/>
        <alias entity-alias="PTYGRP" name="groupName"/>
        <alias entity-alias="PTYGRP" name="groupNameLocal"/>
        <alias entity-alias="PCM" name="contactMechId"/>
        <alias entity-alias="PTY" field="statusId" name="partyStatusId"/>
        <view-link entity-alias="PTY" rel-entity-alias="PTYREL" rel-optional="true">
            <key-map field-name="partyId" rel-field-name="partyIdTo"/>
        </view-link>
        <view-link entity-alias="PTY" rel-entity-alias="PER" rel-optional="true">
            <key-map field-name="partyId"/>
        </view-link>
        <view-link entity-alias="PTY" rel-entity-alias="PTYGRP" rel-optional="true">
            <key-map field-name="partyId"/>
        </view-link>
        <view-link entity-alias="PTY" rel-entity-alias="PCM" rel-optional="true">
            <key-map field-name="partyId"/>
        </view-link>
        <view-link entity-alias="PCM" rel-entity-alias="CM" rel-optional="true">
            <key-map field-name="contactMechId"/>
        </view-link>
        <view-link entity-alias="PCM" rel-entity-alias="PA" rel-optional="true">
            <key-map field-name="contactMechId"/>
        </view-link>
        <view-link entity-alias="PCM" rel-entity-alias="TN" rel-optional="true">
            <key-map field-name="contactMechId"/>
        </view-link>
        <relation type="one-nofk" rel-entity-name="PartyRelationship">
            <key-map field-name="partyIdFrom"/>
            <key-map field-name="partyIdTo"/>
            <key-map field-name="roleTypeIdFrom"/>
            <key-map field-name="roleTypeIdTo"/>
            <key-map field-name="fromDate"/>
        </relation>
        <relation type="one-nofk" rel-entity-name="PartyRelationshipType">
            <key-map field-name="partyRelationshipTypeId"/>
        </relation>
        <relation type="one-nofk" rel-entity-name="PartyContactMech">
            <key-map field-name="partyId"/>
            <key-map field-name="contactMechId"/>
            <key-map field-name="fromDate"/>
        </relation>
        <relation type="one-nofk" rel-entity-name="Party">
            <key-map field-name="partyId"/>
        </relation>
        <relation type="one-nofk" rel-entity-name="ContactMech">
            <key-map field-name="contactMechId"/>
        </relation>
        <relation type="one-nofk" rel-entity-name="PostalAddress">
            <key-map field-name="contactMechId"/>
        </relation>
        <relation type="one-nofk" rel-entity-name="TelecomNumber">
            <key-map field-name="contactMechId"/>
        </relation>
    </view-entity>
    
    <view-entity entity-name="PartyRelationshipAndPartyDetail" 
            package-name="org.apache.ofbiz.party.party"
            title="Party Relationship And Party Details">
        <member-entity entity-alias="TO_PTY" entity-name="Party"/><!-- Party To Detail -->
        <member-entity entity-alias="PTYREL" entity-name="PartyRelationship"/>
        <member-entity entity-alias="PTYRELTP" entity-name="PartyRelationshipType"/>
        <member-entity entity-alias="TO_PER" entity-name="Person"/>
        <member-entity entity-alias="TO_PTYGRP" entity-name="PartyGroup"/>
        <member-entity entity-alias="FROM_PER" entity-name="Person"/><!-- Party From Detail -->
        <member-entity entity-alias="FROM_PTYGRP" entity-name="PartyGroup"/>
        <alias-all entity-alias="PTYREL"/>
        <alias entity-alias="PTYRELTP" name="relParentTypeId" field="parentTypeId"/>
        <alias entity-alias="TO_PTY" name="partyId"/>
        <alias entity-alias="TO_PTY" name="partyTypeId"/>
        <alias entity-alias="TO_PTY" name="description"/>
        <alias entity-alias="TO_PTY" name="partyStatusId" field="statusId"/>
        <alias entity-alias="TO_PER" name="toFirstName" field="firstName"/>
        <alias entity-alias="TO_PER" name="toMiddleName" field="middleName"/>
        <alias entity-alias="TO_PER" name="toLastName" field="lastName"/>
        <alias entity-alias="TO_PER" name="tofirstNameLocal" field="firstNameLocal"/>
        <alias entity-alias="TO_PER" name="toLastNameLocal" field="lastNameLocal"/>
        <alias entity-alias="TO_PER" name="toPersonalTitle" field="personalTitle"/>
        <alias entity-alias="TO_PER" name="toSuffix" field="suffix"/>
        <alias entity-alias="TO_PTYGRP" name="toGroupName" field="groupName"/>
        <alias entity-alias="TO_PTYGRP" name="toGroupNameLocal" field="groupNameLocal"/>
        <alias entity-alias="FROM_PER" name="fromFirstName" field="firstName"/>
        <alias entity-alias="FROM_PER" name="fromMiddleName" field="middleName"/>
        <alias entity-alias="FROM_PER" name="fromLastName" field="lastName"/>
        <alias entity-alias="FROM_PER" name="fromfirstNameLocal" field="firstNameLocal"/>
        <alias entity-alias="FROM_PER" name="fromLastNameLocal" field="lastNameLocal"/>
        <alias entity-alias="FROM_PER" name="fromPersonalTitle" field="personalTitle"/>
        <alias entity-alias="FROM_PER" name="fromSuffix" field="suffix"/>
        <alias entity-alias="FROM_PTYGRP" name="fromGroupName" field="groupName"/>
        <alias entity-alias="FROM_PTYGRP" name="fromGroupNameLocal" field="groupNameLocal"/>
        
        <view-link entity-alias="TO_PTY" rel-entity-alias="PTYREL" rel-optional="true">
          <key-map field-name="partyId" rel-field-name="partyIdTo"/>
        </view-link>
        <view-link entity-alias="TO_PTY" rel-entity-alias="TO_PER" rel-optional="true">
          <key-map field-name="partyId"/>
        </view-link>
        <view-link entity-alias="TO_PTY" rel-entity-alias="TO_PTYGRP" rel-optional="true">
          <key-map field-name="partyId"/>
        </view-link>
        <view-link entity-alias="PTYREL" rel-entity-alias="FROM_PER" rel-optional="true">
          <key-map field-name="partyIdFrom" rel-field-name="partyId"/>
        </view-link>
        <view-link entity-alias="PTYREL" rel-entity-alias="PTYRELTP" rel-optional="true">
          <key-map field-name="partyRelationshipTypeId"/>
        </view-link>
        <view-link entity-alias="PTYREL" rel-entity-alias="FROM_PTYGRP" rel-optional="true">
          <key-map field-name="partyIdFrom" rel-field-name="partyId"/>
        </view-link>
        <relation type="one-nofk" rel-entity-name="Party">
          <key-map field-name="partyId"/>
        </relation>
    </view-entity>
    
    <entity entity-name="PartyRole"
            package-name="org.apache.ofbiz.party.party"
            title="Party Role">
      <field name="partyId" type="id"></field>
      <field name="roleTypeId" type="id"></field>
      <prim-key field="partyId"/>
      <prim-key field="roleTypeId"/>
      <relation type="one" fk-name="PARTY_RLE_PARTY" rel-entity-name="Party">
        <key-map field-name="partyId"/>
      </relation>
      <relation type="one" fk-name="PARTY_RLE_ROLE" rel-entity-name="RoleType">
        <key-map field-name="roleTypeId"/>
      </relation>
      <relation type="many" rel-entity-name="RoleTypeAttr">
        <key-map field-name="roleTypeId"/>
      </relation>
      <relation type="many" rel-entity-name="PartyAttribute">
        <key-map field-name="partyId"/>
      </relation>
    </entity>
    <view-entity entity-name="PartyRoleAndPartyDetail"
            package-name="org.apache.ofbiz.party.party"
            title="Party Role and Party Detail (Person, PartyGroup, etc.) View">
      <member-entity entity-alias="PTY" entity-name="Party"/>
      <member-entity entity-alias="PR" entity-name="PartyRole"/>
      <member-entity entity-alias="PERSON" entity-name="Person"/>
      <member-entity entity-alias="PTYGRP" entity-name="PartyGroup"/>
      <alias-all entity-alias="PTY"/>
      <alias-all entity-alias="PR"/>
      <alias-all entity-alias="PERSON">
        <exclude field="comments"/>
      </alias-all>
      <alias-all entity-alias="PTYGRP">
        <exclude field="comments"/>
      </alias-all>
      <alias entity-alias="PERSON" name="personComments" field="comments"/>
      <alias entity-alias="PTYGRP" name="partyGroupComments" field="comments"/>
      <view-link entity-alias="PTY" rel-entity-alias="PR">
        <key-map field-name="partyId"/>
      </view-link>
      <view-link entity-alias="PTY" rel-entity-alias="PERSON" rel-optional="true">
        <key-map field-name="partyId"/>
      </view-link>
      <view-link entity-alias="PTY" rel-entity-alias="PTYGRP" rel-optional="true">
        <key-map field-name="partyId"/>
      </view-link>
    </view-entity>
    <view-entity entity-name="PartyRoleDetailAndPartyDetail"
        package-name="org.apache.ofbiz.party.party"
        title="Party Role and Party Detail (Person, PartyGroup, etc.) View">
        <member-entity entity-alias="PTY" entity-name="Party"/>
        <member-entity entity-alias="PR" entity-name="PartyRole"/>
        <member-entity entity-alias="RT" entity-name="RoleType"/>
        <member-entity entity-alias="PERSON" entity-name="Person"/>
        <member-entity entity-alias="PTYGRP" entity-name="PartyGroup"/>
        <alias-all entity-alias="PTY">
            <exclude field="description"/>
            </alias-all>
        <alias-all entity-alias="PR"/>
        <alias-all entity-alias="RT"/>
        <alias-all entity-alias="PERSON">
            <exclude field="comments"/>
            </alias-all>
        <alias-all entity-alias="PTYGRP">
            <exclude field="comments"/>
            </alias-all>
        <alias entity-alias="PERSON" name="personComments" field="comments"/>
        <alias entity-alias="PTYGRP" name="partyGroupComments" field="comments"/>
        <view-link entity-alias="PTY" rel-entity-alias="PR">
            <key-map field-name="partyId"/>
            </view-link>
        <view-link entity-alias="PTY" rel-entity-alias="PERSON" rel-optional="true">
            <key-map field-name="partyId"/>
            </view-link>
        <view-link entity-alias="PTY" rel-entity-alias="PTYGRP" rel-optional="true">
            <key-map field-name="partyId"/>
            </view-link>
        <view-link entity-alias="PR" rel-entity-alias="RT">
            <key-map field-name="roleTypeId"/>
            </view-link>
    </view-entity>

    <view-entity entity-name="PartyRoleNameDetail"
        package-name="org.apache.ofbiz.party.party"
        title="Party Role and Party Detail (Person, PartyGroup, etc.) View">
        <member-entity entity-alias="PTY" entity-name="Party"/>
        <member-entity entity-alias="PR" entity-name="PartyRole"/>
        <member-entity entity-alias="PERSON" entity-name="Person"/>
        <member-entity entity-alias="PTYGRP" entity-name="PartyGroup"/>
        <alias-all entity-alias="PTY"/>
        <alias-all entity-alias="PR"/>
        <alias-all entity-alias="PERSON">
            <exclude field="comments"/>
        </alias-all>
        <alias-all entity-alias="PTYGRP">
            <exclude field="comments"/>
        </alias-all>
        <view-link entity-alias="PTY" rel-entity-alias="PR">
            <key-map field-name="partyId"/>
        </view-link>
        <view-link entity-alias="PTY" rel-entity-alias="PERSON" rel-optional="true">
            <key-map field-name="partyId"/>
        </view-link>
        <view-link entity-alias="PTY" rel-entity-alias="PTYGRP" rel-optional="true">
            <key-map field-name="partyId"/>
        </view-link>
    </view-entity>
    <view-entity entity-name="PartyRoleAndContactMechDetail" package-name="org.apache.ofbiz.party.party" title="Party Role And Contact Mech Details">
        <member-entity entity-alias="PTY" entity-name="Party"/>
        <member-entity entity-alias="PR" entity-name="PartyRole"/>
        <member-entity entity-alias="RT" entity-name="RoleType"/>
        <member-entity entity-alias="PERSON" entity-name="Person"/>
        <member-entity entity-alias="PTYGRP" entity-name="PartyGroup"/>
        <member-entity entity-alias="PCM" entity-name="PartyContactMech"/>
        <member-entity entity-alias="CM" entity-name="ContactMech"/>
        <member-entity entity-alias="PA" entity-name="PostalAddress"/>
        <member-entity entity-alias="TN" entity-name="TelecomNumber"/>
        <alias-all entity-alias="PTY">
            <exclude field="description"/>
        </alias-all>
        <alias-all entity-alias="PR"/>
        <alias-all entity-alias="RT"/>
        <alias-all entity-alias="PERSON">
            <exclude field="comments"/>
            </alias-all>
        <alias-all entity-alias="PTYGRP">
            <exclude field="comments"/>
        </alias-all>
        <alias-all entity-alias="PCM">
            <exclude field="roleTypeId"/>
        </alias-all>
        <alias-all entity-alias="CM"/>
        <alias-all entity-alias="PA" prefix="pa"/>
        <alias-all entity-alias="TN" prefix="tn"/>
        <alias entity-alias="PERSON" name="personComments" field="comments"/>
        <alias entity-alias="PTYGRP" name="partyGroupComments" field="comments"/>
        <view-link entity-alias="PTY" rel-entity-alias="PR">
            <key-map field-name="partyId"/>
            </view-link>
        <view-link entity-alias="PTY" rel-entity-alias="PERSON" rel-optional="true">
            <key-map field-name="partyId"/>
            </view-link>
        <view-link entity-alias="PTY" rel-entity-alias="PTYGRP" rel-optional="true">
            <key-map field-name="partyId"/>
            </view-link>
        <view-link entity-alias="PR" rel-entity-alias="RT">
            <key-map field-name="roleTypeId"/>
        </view-link>
        <view-link entity-alias="PTY" rel-entity-alias="PCM" rel-optional="true">
            <key-map field-name="partyId"/>
        </view-link>
        <view-link entity-alias="PCM" rel-entity-alias="CM" rel-optional="true">
            <key-map field-name="contactMechId"/>
        </view-link>
        <view-link entity-alias="PCM" rel-entity-alias="PA" rel-optional="true">
            <key-map field-name="contactMechId"/>
        </view-link>
        <view-link entity-alias="PCM" rel-entity-alias="TN" rel-optional="true">
            <key-map field-name="contactMechId"/>
        </view-link>
        <relation type="one-nofk" rel-entity-name="PartyRole">
            <key-map field-name="partyId"/>
            <key-map field-name="roleTypeId"/>
        </relation>
        <relation type="one-nofk" rel-entity-name="PartyContactMech">
            <key-map field-name="partyId"/>
            <key-map field-name="contactMechId"/>
            <key-map field-name="fromDate"/>
        </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>
        <relation type="one-nofk" rel-entity-name="ContactMech">
            <key-map field-name="contactMechId"/>
        </relation>
        <relation type="one-nofk" rel-entity-name="PostalAddress">
            <key-map field-name="contactMechId"/>
        </relation>
        <relation type="one-nofk" rel-entity-name="TelecomNumber">
            <key-map field-name="contactMechId"/>
        </relation>
    </view-entity>
    <entity entity-name="PartyStatus"
            package-name="org.apache.ofbiz.party.party"
            title="Tracks a history of the status of a Party">
      <field name="statusId" type="id"></field>
      <field name="partyId" type="id"></field>
      <field name="statusDate" type="date-time"></field>
      <field name="changeByUserLoginId" type="id-vlong"></field>
      <prim-key field="statusId"/>
      <prim-key field="partyId"/>
      <prim-key field="statusDate"/>
      <relation type="one" fk-name="PARTY_STS_STSITM" rel-entity-name="StatusItem">
        <key-map field-name="statusId"/>
      </relation>
      <relation type="one" fk-name="PARTY_STS_PARTY" rel-entity-name="Party">
        <key-map field-name="partyId"/>
      </relation>
      <relation type="one" fk-name="PARTY_STTS_USRLGN" title="ChangeBy" rel-entity-name="UserLogin">
          <key-map field-name="changeByUserLoginId" rel-field-name="userLoginId"/>
      </relation>
    </entity>
    <entity entity-name="PartyType"
            package-name="org.apache.ofbiz.party.party"
            default-resource-name="PartyEntityLabels"
            title="Party Type">
      <field name="partyTypeId" type="id"></field>
      <field name="parentTypeId" type="id"></field>
      <field name="hasTable" type="indicator"></field>
      <field name="description" type="description"></field>
      <prim-key field="partyTypeId"/>
      <relation type="one" fk-name="PARTY_TYPE_PAR" title="Parent" rel-entity-name="PartyType">
        <key-map field-name="parentTypeId" rel-field-name="partyTypeId"/>
      </relation>
      <relation type="many" title="Sibling" rel-entity-name="PartyType">
        <key-map field-name="parentTypeId"/>
      </relation>
    </entity>
    <entity entity-name="PartyTypeAttr"
            package-name="org.apache.ofbiz.party.party"
            title="Party Type Attribute">
      <field name="partyTypeId" type="id"></field>
      <field name="attrName" type="id-long"></field>
      <field name="description" type="description"></field>
      <prim-key field="partyTypeId"/>
      <prim-key field="attrName"/>
      <relation type="one" fk-name="PARTY_TYP_ATTR" rel-entity-name="PartyType">
        <key-map field-name="partyTypeId"/>
      </relation>
      <relation type="many" rel-entity-name="PartyAttribute">
        <key-map field-name="attrName"/>
      </relation>
      <relation type="many" rel-entity-name="Party">
        <key-map field-name="partyTypeId"/>
      </relation>
    </entity>
    <entity entity-name="Person"
            package-name="org.apache.ofbiz.party.party"
            title="Person">
      <field name="partyId" type="id"></field>
      <field name="salutation" type="name"></field>
      <field name="firstName" type="name"></field>
      <field name="middleName" type="name"></field>
      <field name="lastName" type="name"></field>
      <field name="personalTitle" type="name"></field>
      <field name="suffix" type="name"></field>
      <field name="nickname" type="name"></field>
      <field name="firstNameLocal" type="name"></field>
      <field name="middleNameLocal" type="name"></field>
      <field name="lastNameLocal" type="name"></field>
      <field name="otherLocal" type="name"></field>
      <field name="memberId" type="id"></field>
      <field name="gender" type="indicator"></field>
      <field name="birthDate" type="date"></field>
      <field name="deceasedDate" type="date"></field>
      <field name="height" type="floating-point"></field>
      <field name="weight" type="floating-point"></field>
      <field name="mothersMaidenName" type="long-varchar" encrypt="true"></field>
      <field name="maritalStatus" type="indicator"></field>
      <field name="socialSecurityNumber" type="long-varchar" encrypt="true"></field>
      <field name="passportNumber" type="long-varchar" encrypt="true"></field>
      <field name="passportExpireDate" type="date"></field>
      <field name="totalYearsWorkExperience" type="floating-point"></field>
      <field name="comments" type="comment"></field>
      <field name="employmentStatusEnumId" type="id"></field>
      <field name="residenceStatusEnumId" type="id"></field>
      <field name="occupation" type="name"></field>
      <field name="yearsWithEmployer" type="numeric"></field>
      <field name="monthsWithEmployer" type="numeric"></field>
      <field name="existingCustomer" type="indicator"></field>
      <field name="cardId" type="id-long" ></field>
      <prim-key field="partyId"/>
      <relation type="one" fk-name="PERSON_PARTY" rel-entity-name="Party">
        <key-map field-name="partyId"/>
      </relation>
      <relation type="one" fk-name="PERSON_EMPS_ENUM" title="EmploymentStatus" rel-entity-name="Enumeration">
        <key-map field-name="employmentStatusEnumId" rel-field-name="enumId"/>
      </relation>
      <relation type="one" fk-name="PERSON_RESS_ENUM" title="ResidenceStatus" rel-entity-name="Enumeration">
        <key-map field-name="residenceStatusEnumId" rel-field-name="enumId"/>
      </relation>
      <index name="FIRST_NAME_IDX">
        <index-field name="firstName"/>
      </index>
      <index name="LAST_NAME_IDX">
        <index-field name="lastName"/>
      </index>
      <index name="CARD_ID_IDX" unique="true">
        <index-field name="cardId"/>
      </index>
    </entity>
    <entity entity-name="PriorityType"
            package-name="org.apache.ofbiz.party.party"
            title="Priority Type">
      <field name="priorityTypeId" type="id"></field>
      <field name="description" type="description"></field>
      <prim-key field="priorityTypeId"/>
    </entity>
    <entity entity-name="RoleType"
            package-name="org.apache.ofbiz.party.party"
            default-resource-name="PartyEntityLabels"
            title="Role Type">
      <field name="roleTypeId" type="id"></field>
      <field name="parentTypeId" type="id"></field>
      <field name="hasTable" type="indicator"></field>
      <field name="description" type="description"></field>
      <prim-key field="roleTypeId"/>
      <relation type="one" fk-name="ROLE_TYPE_PAR" title="Parent" rel-entity-name="RoleType">
        <key-map field-name="parentTypeId" rel-field-name="roleTypeId"/>
      </relation>
    </entity>
    <view-entity entity-name="RoleTypeIn3Levels"
        package-name="org.apache.ofbiz.party.party" title="Party Role View in 4 levels">
        <member-entity entity-alias="RT1" entity-name="RoleType" />
        <member-entity entity-alias="RT2" entity-name="RoleType" />
        <member-entity entity-alias="RT3" entity-name="RoleType" />
        <alias entity-alias="RT1" name="topRoleTypeId" field="roleTypeId" />
        <alias entity-alias="RT1" name="topDescription" field="description" />
        <alias entity-alias="RT2" name="midRoleTypeId" field="roleTypeId" />
        <alias entity-alias="RT2" name="midDescription" field="description" />
        <alias entity-alias="RT3" name="lowRoleTypeId" field="roleTypeId" />
        <alias entity-alias="RT3" name="lowDescription" field="description" />
        <view-link entity-alias="RT1" rel-entity-alias="RT2" rel-optional="true">
            <key-map field-name="roleTypeId" rel-field-name="parentTypeId"/>
        </view-link>
        <view-link entity-alias="RT2" rel-entity-alias="RT3" rel-optional="true">
            <key-map field-name="roleTypeId" rel-field-name="parentTypeId"/>
        </view-link>
    </view-entity>
    <view-entity entity-name="RoleTypeAndParty"
            package-name="org.apache.ofbiz.party.party"
            title="Party Role View">
      <member-entity entity-alias="PR" entity-name="PartyRole"/>
      <member-entity entity-alias="RT" entity-name="RoleType"/>
      <alias entity-alias="PR" name="partyId"/>
      <alias entity-alias="RT" name="roleTypeId"/>
      <alias entity-alias="RT" name="parentTypeId"/>
      <alias entity-alias="RT" name="description"/>
      <view-link entity-alias="RT" rel-entity-alias="PR">
        <key-map field-name="roleTypeId"/>
      </view-link>
    </view-entity>
    <entity entity-name="RoleTypeAttr"
            package-name="org.apache.ofbiz.party.party"
            title="Role Type Attribute">
      <field name="roleTypeId" type="id"></field>
      <field name="attrName" type="id-long"></field>
      <field name="description" type="description"></field>
      <prim-key field="roleTypeId"/>
      <prim-key field="attrName"/>
      <relation type="one" fk-name="ROLE_TYPATR_RTYP" rel-entity-name="RoleType">
        <key-map field-name="roleTypeId"/>
      </relation>
      <relation type="many" rel-entity-name="PartyAttribute">
        <key-map field-name="attrName"/>
      </relation>
      <relation type="many" rel-entity-name="PartyRole">
        <key-map field-name="roleTypeId"/>
      </relation>
      <relation type="many" title="ValidFrom" rel-entity-name="PartyRelationshipType">
        <key-map field-name="roleTypeId" rel-field-name="roleTypeIdValidFrom"/>
      </relation>
      <relation type="many" title="ValidTo" rel-entity-name="PartyRelationshipType">
        <key-map field-name="roleTypeId" rel-field-name="roleTypeIdValidTo"/>
      </relation>
    </entity>
    <entity entity-name="Vendor"
            package-name="org.apache.ofbiz.party.party"
            title="Vendor">
      <field name="partyId" type="id"></field>
      <field name="manifestCompanyName" type="name"></field>
      <field name="manifestCompanyTitle" type="name"></field>
      <field name="manifestLogoUrl" type="url"></field>
      <field name="manifestPolicies" type="very-long"></field>
      <prim-key field="partyId"/>
      <relation type="one" fk-name="VENDOR_PARTY" rel-entity-name="Party">
        <key-map field-name="partyId"/>
      </relation>
    </entity>
    <extend-entity entity-name="CustomTimePeriod">
        <field name="organizationPartyId" type="id"></field>
        <relation type="one" fk-name="ORG_PRD_PARTY" title="Organization" rel-entity-name="Party">
            <key-map field-name="organizationPartyId" rel-field-name="partyId"/>
        </relation>
    </extend-entity>
    <extend-entity entity-name="NoteData">
        <field name="noteParty" type="id"></field>
        <relation type="one" fk-name="NOTE_DATA_PTY" title="Note" rel-entity-name="Party">
            <key-map field-name="noteParty" rel-field-name="partyId"/>
        </relation>
    </extend-entity>
    <extend-entity entity-name="ServerHit">
        <field name="internalContentId" type="id"></field>
        <field name="partyId" type="id"></field>
        <field name="idByIpContactMechId" type="id"></field>
        <field name="refByWebContactMechId" type="id"></field>
        <relation type="one" fk-name="SERVER_HIT_PARTY" rel-entity-name="Party">
            <key-map field-name="partyId"/>
        </relation>
        <relation type="one" fk-name="SERVER_HIT_IDBYIP" title="IdByIp" rel-entity-name="ContactMech">
            <key-map field-name="idByIpContactMechId" rel-field-name="contactMechId"/>
        </relation>
        <relation type="one" fk-name="SERVER_HIT_REFWEB" title="RefByWeb" rel-entity-name="ContactMech">
            <key-map field-name="refByWebContactMechId" rel-field-name="contactMechId"/>
        </relation>
        <relation type="one" fk-name="SERVER_HIT_CNT" rel-entity-name="Content">
            <key-map field-name="internalContentId" rel-field-name="contentId"/>
        </relation>
    </extend-entity>
    <extend-entity entity-name="ServerHitBin">
        <field name="internalContentId" type="id"></field>
        <relation type="one" fk-name="SERVER_HBIN_CNT" rel-entity-name="Content">
            <key-map field-name="internalContentId" rel-field-name="contentId"/>
        </relation>
    </extend-entity>
    <extend-entity entity-name="Visit">
        <field name="contactMechId" type="id"></field>
        <field name="partyId" type="id"></field>
        <field name="roleTypeId" type="id"></field>
    </extend-entity>
    <extend-entity entity-name="Visitor">
        <field name="partyId" type="id"></field>
    </extend-entity>
    <extend-entity entity-name="UserLogin">
        <field name="partyId" type="id"></field>
        <relation type="one" fk-name="USER_PARTY" 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>
    </extend-entity>
    <extend-entity entity-name="UserLoginHistory">
        <field name="partyId" type="id"></field>
        <relation type="one" fk-name="USER_LH_PARTY" rel-entity-name="Party">
            <key-map field-name="partyId"/>
        </relation>
    </extend-entity>
    <view-entity entity-name="PartyExport" package-name="org.apache.ofbiz.accounting.reports">
        <member-entity entity-alias="PRT" entity-name="Party"/>
        <member-entity entity-alias="GRP" entity-name="PartyGroup"/>
        <member-entity entity-alias="PER" entity-name="Person"/>
        <member-entity entity-alias="PR" entity-name="PartyRelationship"/>
        <member-entity entity-alias="CGRP" entity-name="PartyGroup"/>
        <member-entity entity-alias="PRL" entity-name="PartyRole"/>
        <member-entity entity-alias="PCM" entity-name="PartyContactMech"/>
        <member-entity entity-alias="PCP" entity-name="PartyContactMechPurpose"/>
        <member-entity entity-alias="CM" entity-name="ContactMech"/>
        <member-entity entity-alias="TN" entity-name="TelecomNumber"/>
        <member-entity entity-alias="PA" entity-name="PostalAddress"/>
        <alias entity-alias="PRT" name="partyId" />
        <alias entity-alias="PRT" name="statusId" />
        <alias entity-alias="PRT" name="preferredCurrencyUomId" />
        <alias entity-alias="GRP" name="groupName"/>
        <alias entity-alias="PER" name="firstName"/>
        <alias entity-alias="PER" name="middleName"/>
        <alias entity-alias="PER" name="lastName"/>
        <alias entity-alias="PR" name="companyPartyId" field="partyIdFrom"/>
        <alias entity-alias="CGRP" name="companyName" field="groupName"/>
        <alias entity-alias="PRL" name="roleTypeId"/>
        <alias entity-alias="CM" name="contactMechTypeId"/>
        <alias entity-alias="PCP" name="contactMechPurposeTypeId"/>
        <alias entity-alias="CM" name="emailAddress" field="infoString"/>
        <alias entity-alias="TN" name="telCountryCode" field="countryCode"/>
        <alias entity-alias="TN" name="telAreaCode"  field="areaCode"/>
        <alias entity-alias="TN" name="telContactNumber" field="contactNumber"/>
        <alias entity-alias="PA" name="address1"/>
        <alias entity-alias="PA" name="address2"/>
        <alias entity-alias="PA" name="city"/>
        <alias entity-alias="PA" name="stateProvinceGeoId"/>
        <alias entity-alias="PA" name="postalCode"/>
        <alias entity-alias="PA" name="countryGeoId"/>
        <alias entity-alias="PCM" name="fromDate"/>
        <alias entity-alias="PCM" name="thruDate"/>
        <view-link entity-alias="PRT" rel-entity-alias="GRP" rel-optional="true">
            <key-map field-name="partyId"/>
        </view-link>
        <view-link entity-alias="PRT" rel-entity-alias="PER" rel-optional="true">
            <key-map field-name="partyId"/>
        </view-link>
        <view-link entity-alias="PRT" rel-entity-alias="PR" rel-optional="true">
            <key-map field-name="partyId" rel-field-name="partyIdTo"/>
            <entity-condition>
                <condition-list combine="and">
                    <condition-expr field-name="roleTypeIdFrom" entity-alias="PR" value="ACCOUNT"/>
                    <condition-expr field-name="partyRelationshipTypeId" entity-alias="PR" value="EMPLOYMENT"/>
                </condition-list>
            </entity-condition>
        </view-link>
        <view-link entity-alias="PR" rel-entity-alias="CGRP" rel-optional="true">
            <key-map field-name="partyIdFrom" rel-field-name="partyId"/>
        </view-link>
        <view-link entity-alias="PRT" rel-entity-alias="PRL" rel-optional="true">
            <key-map field-name="partyId"/>
        </view-link>
        <view-link entity-alias="PRT" rel-entity-alias="PCM" rel-optional="true">
            <key-map field-name="partyId"/>
            <entity-condition filter-by-date="true"/>
        </view-link>
        <view-link entity-alias="PCM" rel-entity-alias="PA" rel-optional="true">
            <key-map field-name="contactMechId"/>
        </view-link>
        <view-link entity-alias="PCM" rel-entity-alias="CM" rel-optional="true">
            <key-map field-name="contactMechId"/>
        </view-link>
        <view-link entity-alias="PCM" rel-entity-alias="TN" rel-optional="true">
            <key-map field-name="contactMechId"/>
        </view-link>
        <view-link entity-alias="PCM" rel-entity-alias="PCP" rel-optional="true">
            <key-map field-name="contactMechId"/>
            <key-map field-name="partyId"/>
            <entity-condition filter-by-date="true"/>
        </view-link>
    </view-entity>
    
    <view-entity entity-name="PartyClassificationGroupAndType" package-name="org.apache.ofbiz.party.party" title="PartyClassificationGroup and PartyClassificationTypeView">
        <member-entity entity-alias="PCG" entity-name="PartyClassificationGroup"/>
        <member-entity entity-alias="PCT" entity-name="PartyClassificationType"/>
        <alias-all entity-alias="PCG"/>
        <alias entity-alias="PCT" name="typeDescription" field="description"/>
        <alias entity-alias="PCT" name="parentTypeId"/>
        <view-link entity-alias="PCG" rel-entity-alias="PCT">
            <key-map field-name="partyClassificationTypeId"/>
        </view-link>
    </view-entity>
    
</entitymodel>
