<viewEntity> elements and related data object types
The <viewEntity> XML root element defines view entity data
object types. A view entity data object type is a logical view of entity data. You
can use a view entity to enhance performance during the viewing of tabular data. A
view entity provides a logical view of data for an entity of interest to a list
view. A view entity can include paths from the root or primary entity to other
related entities.
For example, from the DesktopActivityView, you can
specify a column with a Job.JobNumber value. The
Activity entity is the primary entity of the
DesktopActivityView. The Activity entity has
a corresponding view entity called ActivityView.
Unlike a standard entity, a view entity does not have an underlying database table. PolicyCenter does not persist view entities to the database. Instead of storing data, a view entity restricts the amount of data that a database query returns. A view entity does not represent or create a materialized view, which is a database table that caches the results of a database query.
Queries against a view entity type are actually run against the normal entity table in the
database, as specified by the primaryEntity attribute of the view
entity definition. The query against a view entity automatically adds any joins
necessary to retrieve view entity columns if they include a bean path. However,
access to view entity columns is not possible when constructing the query.
A view entity improves the performance of PolicyCenter on frequently used pages that list entities. Like other entities, you can subtype a view entity.
For example, the My Activities page uses a view entity, the
ActivityDesktopView, which is a subtype of the ActivityView.
Because PolicyCenter can export view entity types, it generates SOAP interfaces for them.
type="currencyamount", then you must handle the view entity
extension in a particular manner. See Extending an existing view entity with a currency column for
details.Guidewire defines view entities in the data model metadata files.
Attributes of <viewEntity>
The <viewEntity>
element contains the following attributes:
|
Description |
Default |
|---|---|---|
|
If |
|
|
A description of the purpose and use of the entity. |
None |
|
Optional. Creates a more human-readable form of the entity name. You can access this name using the following: If you do not specify a value for the |
None |
|
Required. Name of this viewEntity object. |
None |
|
Unused. |
|
|
If |
|
|
If |
|
|
Internal. Do not use. The only real effect is to change the location in which the table appears in a data distribution report. |
|
|
Required. The primary entity type for
this viewEntity
object. The primary entity must be |
None |
|
For supertypes and subtypes, the priority of the corresponding subtype key. |
|
|
Whether to show retired beans in the view. |
None |
|
Optional. The name of supertype of this entity. |
None |
|
If you create a non-final entity, then PolicyCenter automatically creates a typelist to keep track of the subtypes of that entity. That typelist has an associated database table. If you do not specify a value for this attribute, then PolicyCenter uses the name of the entity as the table name for the subtype typelist. However, PolicyCenter places a restriction of 25 characters on the length of the database table name. You use this attribute to specify an alternate database table name for the typelist if an entity name is too long to become a valid typelist table name. It is not valid to use this attribute with entity types marked as final. |
None |
Subelements of <viewEntity>
The <viewEntity>
elements contain the following subelements:
|
Description |
|---|---|
|
Specifies a column
with row values that Guidewire computes while querying the database.
For example, the values of a computed column might be the sum of the
values from two database columns ( |
|
Specifies a typekey that has some type of transformation applied to it during querying from the database. |
|
See the discussion following the table. |
|
|
|
Represents a column in a |
|
Uses to access another entity through a foreign key. Typically, you use this value within the PolicyCenter interface to create a link to that entity. |
|
Represents an entity
name column in a |
|
Represents a typekey
column in a |
The Data Dictionary uses the fulldescription
subelement. The following example illustrates how to use this element:
<fulldescription>
<![CDATA[<p>Aggregates the information needed to display one activity row (base entity for all other
activity views).</p>]]>
</fulldescription>
The other subelements all require both a name and path attribute. The following code illustrates this:
<viewEntityName name="RelActAssignedUserName" path="RelatedActivity.AssignedUser"/>Specify the path value relative to the primaryEntity on which you base the view.
The computedcolumn takes a required expression attribute and an additional, optional function attribute. The
following is an example of a computedcolumn:
<computedcolumn name="Amount" expression="${1}" paths="LineItems.Amount" function="SUM"/>The expression for this column can take multiple column values
${column_num} passed from the PolicyCenter interface. For example, a valid expression is
${1} - ${2}, where ${1} represents the first
column and ${2} represents the second column. The
function value must be an SQL function that you can apply to
this expression. The following are legal values:
SUMAVGCOUNTMINMAX
