represents an entity class derived from class by adding a new computed property "name" whose value for each entity is obtained by applying the entity function f.
adds the properties namei defined by the functions fi.
- In ExtendedEntityClass[class,"name"->f], the function f must be an EntityFunction object.
- ExtendedEntityClass works with any EntityStore object, whether defined explicitly or based on a RelationalDatabase object.
- ExtendedEntityClass[class,"new"->f] effectively represents a virtual database table derived from class, with a new column named new added, with values f[entityi] for each entity entityi.
- For an extended entity class ExtendedEntityClass[class,"new"->f], the full name of the new property added is EntityProperty[ExtendedEntityClass[class,"new"f],"new"].
- ExtendedEntityClass[class,"new"->f] adds a new computed property even if class already has a property whose name is "new". In this case, however, the new computed property must be referred to using the full name EntityProperty[ExtendedEntityClass[class,"new"f],"new"].
- If the name of a new property does not conflict with the names of any existing properties, then EntityValue[class,"new"] can be used to get values of the new property.
Examplesopen all close all
Basic Examples (3)
Use ExtendedEntityClass to add a computed property to a class of entities:
When used with relational-database-backed entities, ExtendedEntityClass is equivalent to adding an expression in the SELECT statement: