package gw.commons.entity uses gw.lang.reflect.IType class KeyableBeanUtil { /** * Returns the actual EntityType of this Bean - this property is used to get the database-backed * type of a bean. Most beans return their own type; but beans that are an IProductModelType * return the Supertype of their type - this will be an actual EntityType backed by the database. */ static function getProductModelAwareEntityType(bean : KeyableBean) : IType { if ((typeof bean).Namespace == "productmodel") { return (typeof bean).Supertype } else { return typeof bean } } }