5.4. Persistable Data Objects

From Red Hat JBoss BRMS 6.2 onwards, the Data Modeler is extended to support the generation of persistable Data Objects by checking the Persistable check box on the perspective menu when you create a new Data Object. Persistable Data Objects are based on the JPA specification. When the Persistable check box is selected when the object is created, the platform will set some configurations required for persistence by default. The object can also be made persistable after the object has already been created. This can then be customized as required.

Procedure: Creating a Persistable Data Object

  1. When creating a persistable Data Object, the Identifier field id will be generated automatically, along with the @Entity annotation.

    Selecting the List option changes a property to have multiple values. For example, it can enable an attribute Name, to have a list of strings with multiple names.

  2. Create fields of the data object:

    1. By clicking add field button in the main editor window, you can add a field to the object with the attributes Id, Label and Type. Required attributes are marked with *.

      • Id: field ID unique within the data object
      • Label: label to be used in the Fields panel (optional)
      • Type: data type of the field

        DataModelerNewField2 new
    2. Click the Create button (the new field is created and the New field window closes) or the Create and continue button (the new field is created and the New field window remains open, so it is possible to continue adding more fields).

    Attributes can be edited selecting the attribute and editing the fields using the general properties screen to the right.