Overview of data types
In the Guidewire data model, a data type is an augmentation of an object property, along three axes:
Axis |
Description |
|---|---|
Constraint |
A data type can restrict
the range of allowable values. For example, a |
Persistence |
A data type can specify
how PolicyCenter stores a value
in the database and in the object layer. For example, one |
Presentation |
A data type can specify
how the PolicyCenter interface
treats a value. For example, a |
Guidewire stores the definitions for the base configuration data types in *.dti files in the datatypes directory. Each file corresponds to a separate data type, which the file name specifies.
Every data type has an associated Java
or Gosu type (defined in the valueType
attribute). For example, the associated type for the datetime data type is java.util.Date. Thus, you see
the following XML code in the datetime.dti
file.
<DataTypeDef xmlns="http://guidewire.com/datatype"
type="com.guidewire.pl.metadata.datatype2.impl.DateTimeDataTypeDef"
valueType="java.util.Date">
...
In a similar manner, the decimal data type has an associated
type of java.math.BigDecimal.
<DataTypeDef xmlns="http://guidewire.com/datatype"
type="com.guidewire.pl.metadata.datatype2.impl.DecimalDataTypeDef"
valueType="java.math.BigDecimal">
...Working with data types
In working with data types, you can do the following:
Operation |
Description |
|---|---|
Customize an existing data type |
Modify the data type definition in file datatypes.xml, which you access through Studio. You can modify only a select subset of the base configuration data types. |
Create a new data type |
Create a .dti definition file and place it in . You also need to create Gosu code to manage the data type. |
Override the data type on a column |
Override the parameterization
of the data type on individual columns (fields) on an entity. For example,
you can make a |
Using data types
You can use any of the data types for data
fields (except for those that are internal). This includes data types
that are part of the base configuration or data types that you create
yourself. If you add a new column to an entity or create a new entity,
then you can use any data type that you want for that column. You do
this by setting the type
attribute on the column. For example:
<extension entityName="Policy">
<column name="NewCompanyName" type="CompanyName" nullok="true" desc="Name for the new company."/>
</extension>
If you add too many large fields to any one table,
you can easily reach the maximum row size of a table. In particular,
this is a problem if you add a large number of long text or VARCHAR fields. Have your company
database administrator (DBA) determine the maximum row size and increase
the page size, if needed.
Guidewire-reserved data types
Guidewire reserves the right to use the following data types exclusively. Guidewire does not support the use of these data types except for its own internal purposes. Do not attempt to create or extend an entity using one of the following data types:
foreignkeykeytypekeytypelistkey
Database data types
Guidewire bases its base configuration data types on the following database data types:
BITBLOBCLOBDECIMALINTEGERTIMESTAMPVARCHAR
Data types and database vendors
It is possible to see both VARCHAR and varchar in the Guidewire documentation.
This usage has the following meanings.
All uppercase characters
This refers to database data types generally,
for example VARCHAR and
CLOB (Character Large
Object). Of the supported database vendors, the Oracle (and H2) databases
use uppercase data type names, while the SQL Server database uses lowercase
data type names. To view the entire set of database data types, consult
the database vendor's documentation.
All lowercase characters
This refers to Guidewire data types generally,
for example, varchar and
text. You can determine
the set of Guidewire data types by viewing the names of the data type
metadata definition files (*.dti)
in .
Defining a data type for a property
Guidewire associates data types with object properties using the following annotation:
gw.datatype.annotation.DataTypeThe annotation requires you to provide the name of the data type along with any parameters that you want to supply to the data type.
- You associate a data type with
a metadata property by specifying the
typeattribute on the<column>element. - You specify any parameters for the data type with
<columnParam>elements, which are children of the<column>element.
Each data type has a value type. You can
associate a data type only with a property that has a feature type that
matches the data type of the value type. For example, you can only associate
a String data type with
String properties.
