blob: 074e314d93abb91accaeb8d7a130ae46a9dd6a34 [file] [log] [blame]
<?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>OLAP entities for the Product component</title>
<description>None</description>
<!-- ========================================================= -->
<!-- Dimensions -->
<!-- ========================================================= -->
<entity entity-name="ProductDimension" package-name="org.ofbiz.bi.dimension.product" title="Product Dimension">
<description>Product dimension. The natural key is [productId]</description>
<field name="dimensionId" type="id-ne">
<description>Unique identifier of the Product dimension record</description>
</field>
<field name="productId" type="id-ne">
<description>The natural key. From Product.productId</description>
</field>
<field name="productType" type="description">
<description>The product type. From ProductType.description</description>
</field>
<field name="brandName" type="name"></field>
<field name="internalName" type="description"></field>
<prim-key field="dimensionId"/>
</entity>
<!-- ========================================================= -->
<!-- Inventory Item Facts and Star schema -->
<!-- ========================================================= -->
<entity entity-name="InventoryItemFact" package-name="org.ofbiz.bi.fact.product" title="Inventory Item Fact">
<description>A transaction fact entity with inventory item.</description>
<field name="inventoryItemId" type="id-ne"></field>
<field name="facilityId" type="id-ne"></field>
<field name="productDimId" type="id-ne"></field>
<field name="origCurrencyDimId" type="id-ne"></field>
<field name="inventoryDateDimId" type="id-ne"></field>
<field name="quantityOnHandTotal" type="fixed-point"></field>
<field name="availableToPromiseTotal" type="fixed-point"></field>
<field name="unitCost" type="fixed-point"></field>
<field name="soldoutAmount" type="fixed-point"></field>
<prim-key field="inventoryItemId"/>
<relation type="one" fk-name="IIF_INVPRODUCT" rel-entity-name="ProductDimension">
<key-map field-name="productDimId" rel-field-name="dimensionId"/>
</relation>
<relation type="one" fk-name="IIF_INVCURRENCY" rel-entity-name="CurrencyDimension">
<key-map field-name="origCurrencyDimId" rel-field-name="dimensionId"/>
</relation>
<relation type="one" fk-name="IIF_INVDATE" rel-entity-name="DateDimension">
<key-map field-name="inventoryDateDimId" rel-field-name="dimensionId"/>
</relation>
</entity>
<view-entity entity-name="InventoryItemSchema" package-name="org.ofbiz.bi.starschema.product" title="Inventory Item Schema">
<description>"Inventory Item Schema.</description>
<member-entity entity-alias="IIF" entity-name="InventoryItemFact"/>
<!--member-entity entity-alias="SIIF" entity-name="SalesOrderItemFact"/-->
<member-entity entity-alias="PD" entity-name="ProductDimension"/>
<member-entity entity-alias="IDD" entity-name="DateDimension"/>
<member-entity entity-alias="CD" entity-name="CurrencyDimension"/>
<alias-all entity-alias="IIF" function="sum">
<exclude field="inventoryItemId"/>
<exclude field="orderId"/>
<exclude field="facilityId"/>
<exclude field="inventoryDateDimId"/>
<exclude field="productDimId"/>
<exclude field="origCurrencyDimId"/>
</alias-all>
<!--alias-all entity-alias="SIIF" function="sum">
<exclude field="orderItemSeqId"/>
<exclude field="orderDateDimId"/>
<exclude field="productDimId"/>
<exclude field="billToCustomerDimId"/>
<exclude field="origCurrencyDimId"/>
<exclude field="orderId"/>
<exclude field="orderItemSeqId"/>
<exclude field="orderStatus"/>
<exclude field="saleChanel"/>
</alias-all-->
<alias-all entity-alias="PD" prefix="product" group-by="true">
<exclude field="dimensionId"/>
</alias-all>
<alias-all entity-alias="IDD" prefix="inventoryDate" group-by="true">
<exclude field="dimensionId"/>
</alias-all>
<alias-all entity-alias="CD" prefix="currency" group-by="true">
<exclude field="dimensionId"/>
</alias-all>
<alias entity-alias="IIF" name="inventoryItemId" group-by="true">
<description>Inventory Item Id</description>
</alias>
<alias entity-alias="IIF" name="facilityId" group-by="true">
<description>Facility Id</description>
</alias>
<alias entity-alias="PD" name="productId" group-by="true">
<description>Product id</description>
</alias>
<view-link entity-alias="IIF" rel-entity-alias="PD" rel-optional="true">
<key-map field-name="productDimId" rel-field-name="dimensionId"/>
</view-link>
<!--view-link entity-alias="PD" rel-entity-alias="SIIF" rel-optional="true">
<key-map field-name="dimensionId" rel-field-name="productDimId"/>
</view-link-->
<view-link entity-alias="IIF" rel-entity-alias="IDD">
<key-map field-name="inventoryDateDimId" rel-field-name="dimensionId"/>
</view-link>
<view-link entity-alias="IIF" rel-entity-alias="CD">
<key-map field-name="origCurrencyDimId" rel-field-name="dimensionId"/>
</view-link>
</view-entity>
</entitymodel>