<nonPersistentEntity> elements and related data object types

The <nonPersistentEntity> XML root element defines non-persistent entity data object types. A non-persistent entity data object type defines a temporary entity instance or object. PolicyCenter creates and uses this object only during the time that the PolicyCenter server is running. When the server shuts down, PolicyCenter discards the object data. It is not possible to commit a non-persistent entity object to the database.

Guidewire defines non-persistent entities in data model metadata files.

Note: You cannot subtype a persistent entity with a non-persistent entity.

Guidewire recommendations for non-persistent entities

As a general rule, Guidewire recommends that you do not create new non-persistent entities. In addition, do not extend existing non-persistent entities unless instructed to do so. For example, the base configuration contains non-persistent entities that you can extend to specify new search criteria.

A major issue with non-persistent entities is that they do not interact well with data bundles. For example, passing a non-persistent entity instance to a PCF page is generally a bad idea because it generally does not work in the manner that you expect.

A non-persistent entity instance has to live in a bundle and can only live in one bundle. Therefore, passing it to one context removes it from the other context. Even worse, it is possible that in passing the non-persistent entity instance from one context to another, the object loses any nested arrays or links associated with it. Thus, it is possible to lose parts of the entity graph as the non-persistent entity instance moves around.

In situations where you want the behavior of a non-persistent entity, use a Gosu class instead. For example:

  • If you want the behavior of a non-persistent entity in web services, create a Gosu class. Then, expose the class as a web service. Do not rely on non-persistent entities and entity serialization.
  • If you want a field that behaves as a column, specify a data type through the use of annotations. For example, you could use this technique for nonnegativeinteger column behavior. After specifying the data type, add the wanted data type behavior to properties on Gosu classes. For information on how to associate data types with object properties using the annotation syntax, see Defining a data type for a property.

Attributes of <nonPersistentEntity>

The <nonPersistentEntity> element contains the following attributes.

<nonPersistentEntity>  attribute       

Description

Default

abstract

If true, you cannot create an instance of the entity type at runtime. Instead, you must declare a subtype entity with abstract=false, which you can instantiate. Any of the generated code is abstract.

false

desc

A description of the purpose and use of the entity.

None

displayName

Optional. Creates a more human-readable form of the entity name. You can access this name using the following:

  entity.displayName

If you do not specify a value for the displayName attribute, then the entity.displayName method returns the value of the entity attribute, instead. If you subtype an entity that has a specified display name, then the entity.displayName method returns the name of the subtype key.

None

entity

Required. The name of the entity. You use this name to access the entity in data views, rules, and other areas within PolicyCenter.

None

exportable

Unused.

extendable

If true, it is possible to extend this entity.

true

final

If true, you cannot subtype the entity. If false, you can define subtypes using this entity as the supertype.

true

platform

Internal. Do not use. The only real effect is to change the location in which the table appears in a data distribution report.

false

priority

The priority of the corresponding subtype key. This value is meaningful only for entities participating in a subtype hierarchy, which can be either the <subtype> entities or the root <entity>.

-1

typelistTableName

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 the 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 <nonPersistentEntity>

The <nonPersistentEntity> element contains the following subelements.

<nonPersistentEntity>  subelement 

Description

array

See <array>.

column

See <column>.

edgeForeignKey

See <edgeForeignKey>.

foreignkey

See <foreignkey>.

fulldescription

See <fulldescription>.

implementsEntity

See <implementsEntity>.

implementsInterface

See <implementsInterface>.

monetaryamount

Handles monetary amounts. The <monetaryamount> subelement is a compound data type that stores its values in two separate database columns: a <money> column type and a typekey to the Currency typelist.

onetoone

See <onetoone>.

typekey

See <typekey>.