Previous | Next
WireHose Developers Guide

Automatic subentity creation

If the system property WHDisableAutoSubEntities is false, WHApplicationHelper uses WHEnterpriseObject's createSubEntitiesForAffiliates to automatically create subentities for a given list of affiliates for each entity which has an "affiliate" or "entityType" attribute. You can override this behavior on a per-entity basis by including a WHPreventAutoSubEntities = YES entry in the entity's userinfo dictionary. (If you are not using the WireHoseLayoutSupport framework, as in a command-line tool, you will need to call createSubEntitiesForAffiliates yourself.)

You can also create subentities at runtime which use multiple-table rather than single-table inheritance. WHEnterpriseObject's createSubEntity method lets you specify a restricting qualifier as well as an external name (i.e., table name) for a subentity. Any subentity created by WHEnterpriseObject will have a WHCreatedSubEntity = YES entry in its userinfo dictionary, and createSubEntitiesForAffiliates will not create subentities for a given entity if it finds this. WHApplicationHelper posts a notification before it creates subentities, so you can register for this notification if you need to customize subentity creation.

The property WHUserEntityName controls which base entity WHApplicationHelper will use when fetching and creating users. The actual entity fetched and created will be an affiliate-based subentity of this entity for the default affiliate, if available. For example, if WHDefaultAffiliate is "Seattle" and WHUserEntityName is "WHUser" (the default), users and guest users will be of the "SeattleUser" entity if it exists.

You can override WHApplicationHelper's automatic subentity creation in several ways:


Previous | Next