3.AddEntities To Data Model
3.AddEntities To Data Model
“We want a CSR (Customer Service Representative) such as Alice Applegate to be able to create and
edit details about contact interactions.” – Insurance company business analysts
In this lab, your job is to make the necessary data model changes to meet customer requirements. As a
configuration developer, you will use the Entity Editor in Guidewire Studio to modify the TrainingApp data
model. You will implement the user interface changes in a later module.
Prerequisites
For this exercise, use TrainingApp, Guidewire Studio, and a supported web browser.
http://localhost:8880/ab/ContactManager.do is the default URL for TrainingApp. To view, edit, and delete
various contacts, log in to TrainingApp as Alice Applegate. The login/password for Alice Applegate is
aapplegate/gw.
1. Create a new entity named Interaction_Ext and add the following fields:
Tip
When creating an entity which will have an “owned by” relationship to a core entity
(in this case ABContact), you must set the Exportable property to true. Failure to do
so will result in errors that prevent the application from starting. This is a technical
issue related to the implementation of Archiving, which is covered in another lesson.
1. Use Studio’s code generation feature to generate the Java class from the entity and verify the
generated Java class
Important!
Read carefully.
2. For each new entity element, remember to set the nullok attribute to true if not specifically
defined to be false.
3. When required, add an element description and specify column parameters
Best Practices
Use _Ext in the entity name
Notice that the name of the entity has an _Ext suffix. For new entities, Guidewire recommends that the
name of the entity should end with _Ext. This is to prevent potential conflicts during the upgrade to the
next version of the Guidewire application.
“An ABContact entity can have zero or many Interactions associated with it.” – Insurer business analysts
Extend the ABContact entity to define a new array. The array key field should point to
Interaction_Ext. The array name should be descriptive and should follow the recommended naming
conventions.
2. Use Studio’s code generation feature to generate the Java class from the entity and verify the
generated Java class
Best Practices
Use _Ext in entity field name when extending base application entities
For fields that are added to a base application entity, Guidewire recommends that the field name should
end with _Ext. This is to prevent potential conflicts during the upgrade to the next version of the
Guidewire application.
Activity
Verify the work you have done
As a configuration developer, you want to be able to properly deploy new and changed data model
resources.
During server restart Studio first runs the code generators, then compiles the project and finally
deploys the resources
2. Regenerate the Data Dictionary
Solution
Exact details on how to complete the lab.
4. Entities support incremental code generation. You can click on the validate icon or use the
CTRL + S keystroke to kick off incremental code generation. You can open the generated Java
class once the code generation is completed.
Note: The code generation was successful if the Codegen tool window has nothing to show.
Solution
Exact details on how to complete the lab.
2. You must also add a foreign key to Interaction_Ext.eti since every array requires a reverse
foreign key on the other side of the relationship.
3. Entities support incremental code generation. You can click on the validate icon or use the
CTRL + S keystroke to kick off incremental code generation. You can open the generated Java
class once the code generation is completed.
Note: The code generation was successful if the Codegen tool window has nothing to show.