ExtendedEntityClass
ExtendedEntityClass[class,"name"f]
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.
ExtendedEntityClass[class,{"name1"f1,"name2"f2,…}]
adds the properties namei defined by the functions fi.
Details
- 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.
Examples
open allclose allBasic 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:
Applications (1)
ExtendedEntityClass can be used to avoid repeating code:
Possible Issues (1)
Text
Wolfram Research (2019), ExtendedEntityClass, Wolfram Language function, https://reference.wolfram.com/language/ref/ExtendedEntityClass.html.
CMS
Wolfram Language. 2019. "ExtendedEntityClass." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/ExtendedEntityClass.html.
APA
Wolfram Language. (2019). ExtendedEntityClass. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/ExtendedEntityClass.html