<subtype> elements and related data object types
The <subtype> XML root element defines an entity type that is a subtype of another entity. The subtype entity has all of the fields and elements of its supertype. The subtype entity can also have additional fields and elements. Guidewire defines subtype entities in the data model metadata files.
PolicyCenter
does not associate a separate database table with a subtype. Instead,
PolicyCenter stores all subtypes
of a supertype in the table of the supertype and resolves the entity
to the correct subtype based on the value of the Subtype field. To accommodate
this, PolicyCenter stores all
fields of a subtype in the database as nullable columns—even the ones
defined as non-nullable. However, if you define a field as non-nullable,
then the PolicyCenter metadata
service enforces this for all data operations.
You can only define a subtype for any entity
that has its final attribute
set to false. PolicyCenter automatically creates
a Subtype field for non-final
entities.
Attributes of <subtype>
The <subtype>
element contains the following attributes:
|
Description |
Default |
|---|---|---|
|
If |
|
|
A description of the purpose and use of the subtype. |
None |
|
Optional. Occasionally in the PolicyCenter interface, you want
to display the subtype name of subtyped entity instances. Use the If you do not specify a value for the |
None |
|
Required. This attribute has a maximum length of 50. |
|
|
If |
|
|
Internal. Do not use. The only real effect is to change the location in which the table appears in a data distribution report. |
|
|
The priority of the
corresponding subtype key. This value is meaningful only for entities
participating in a subtype hierarchy, which can be either the |
|
|
Optional. The typical use of read-only entities is for tables of reference data that you import as administrative data and then never touch again. You
can add a read-only entity only to a bundle that has the You cannot set bundle commit options from Gosu. Therefore, you cannot modify these entities from Gosu, unless some Gosu-accessible interface gives you a special bundle. The administrative XML import tools use such a special bundle. However, Guidewire uses these tools internally only in the PolicyCenter product model. |
None |
|
See Data objects and scriptability for information. |
None |
|
Required. |
Subelements of <subtype>
The <subtype>
element contains the following subelements.
|
Description |
|---|---|
|
See <array>. |
|
Internal. |
|
See <column>. |
|
Internal. |
|
Internal. |
|
Internal. |
|
See <edgeForeignKey>. |
|
See <events>. |
|
See <foreignkey>. |
|
See <fulldescription>. |
|
See <implementsEntity>. |
|
|
|
See <index>. |
|
Internal. |
|
Handles monetary amounts.
The |
|
See <onetoone>. |
|
|
|
Defines a search denormalization typekey in the database. The denormalization copies the value of a column on another table into a typekey field on the denormalizing table. You must link the tables through a foreign key. The purpose of this denormalization is to avoid costly joins in performance critical searches. |
|
Internal. |
|
See <typekey>. |
|
Internal. |
|
Internal. |
Subtypes and typelists
After you define a new subtype, PolicyCenter automatically adds that
entity type to the associated entity typelist. This is true, even if
PolicyCenter marks that typelist
as final.
For example, suppose that you define an
Inspector entity as a
subtype of Person.
<?xml version="1.0"?>
<subtype xmlns="http://guidewire.com/datamodel" desc="Professional inspector" displayName="Inspector"
entity="InspectorExt"
supertype="Person">
<column name="InspectorLicenseExt" type="varchar" desc="Inspector's business license number">
<columnParam name="size" value="30"/>
</column>
</subtype>
Notice that while InspectorExt is subtype of Person, Person, itself, is a subtype of
Contact. PolicyCenter automatically adds the
new InspectorExt type
to the Contact typelist.
This is true, even though PolicyCenter
marks the Contact typelist
as final.
To see this change:
- In the PolicyCenter Data Dictionary, you must restart the application server.
- In the
Contacttypelist in Studio, you must restart Studio.
See also
