Do you have a bug in our office?  I happen to be working on this very thing
today.  A number of months ago a developer here had added this support to
the entity model.  In affect, you could union two entities together -- the
issues we had today were around proper typing in the model (it needed to
derive its type based on its union members).  Here is a snippet from one of
ours ...

    <union-view-entity entity-name="PhoneAddressContactView"
package-name="com.emforium.ofbiz" title="all contacts">
        <member-entity entity-alias="phone" entity-name="PartyPhoneView" />
        <member-entity entity-alias="address" entity-name="PartyAddressView"
/>

        <union-field name="partyId">
            <union-member-field entity-alias="phone" name="partyId"/>
            <union-member-field entity-alias="address" name="partyId"/>
        </union-field>
        <union-field name="contactMechId">
            <union-member-field entity-alias="phone" name="contactMechId"/>
            <union-member-field entity-alias="address"
name="contactMechId"/>
        </union-field>
        <union-field name="contactMechPurposeTypeId">
            <union-member-field entity-alias="phone"
name="contactMechPurposeTypeId"/>
            <union-member-field entity-alias="address"
name="contactMechPurposeTypeId"/>
        </union-field>
    </union-view-entity>

We do not have an equivalent to "alias-all" here, we have to be explicit
about the fields we want to expose by our union entity.  What happens at
load and basic populate time, a ModelViewEntity is constructed (there is a
union flag on it) with the appropriate set of aliases.

What you do not see here is that we have added support to be able to create
view-entities based on other view-entities and we support a
complex-alias-constant that can be used as "filler columns" when your two
unioned entities do not match up exactly.

If there is interest we fit our support into Ofbiz trunk and provide a
patch.
-- 
View this message in context: 
http://n4.nabble.com/entity-engine-union-support-tp1607240p1609334.html
Sent from the OFBiz - Dev mailing list archive at Nabble.com.

Reply via email to