Home

  

Product

  

Buy

  

Support

 First Line 
 FAQs 
 Tutorials 
 Registered Users 
 User Guide 
 Knowledge Base 

News

  

Press

  

Downloads

  

Contact

  

Company

  

Partners

  

Resources

 
 

User Guide - Entities

Index    Previous   <<>>  Next
  
8.1 Overview

8.1.1 Adding an entity

8.1.2 Editing an entity

8.1.3 Removing an entity

  8.1  OverviewTo top of page

Entities in JCodeBox represent logical business entities such as Customer or Account. Other components are then built on top of these logical representations i.e. EJBs.

There is no Java code generated from entities unless they have a pattern applied to them that generates code i.e. Data Access Object (DAO) applied to BMP EJBs. However, manual entities do generate scripts that will allow you to create the entity in your selected database.

If an entity has dependant objects defined from it i.e. an EJB - significantly modifying the entity (i.e. changing the structure, removing it) will result in the dependant objects being invalidated (or in some cases removed). Invalidated objects are displayed in red in the JCodeBox GUI. Before committing changes of this nature, JCodeBox will display a list of affected objects and ask you to confirm making the change.

JCodeBox allows you to define 2 types of entities:

  • Manual entities
  • Manual entities are defined in manual applications using the JCodeBox GUI. You enter all the details (data columns, primary key columns, etc) for manual entities via the Define manual entity dialog. This is useful for defining applications when the target database is not currently available.

  • Database entities
  • Database entities are defined in database applications directly from a database schema object. After selecting your database you select the table/object that represents your entity. JCodeBox will interrogate the table and automatically build your entity based on the table definition.

In database applications only, you can define numerous entities simultaneously by selecting a number of database tables. JCodeBox can create database entities from tables as long as they have a primary key assigned.

  8.1.1  Adding an entityTo top of page

  1. Adding a single entity
    1. Manual entity
      • Right mouse click on EIS Tier in the define application dialog
      • Select Add Manual Entity from the popup menu
      • Or

      • Select the Action=>Tier menu option from the main menu in the define application dialog
      • Select EIS Tier and press next
      • Select Add Manual Entity and press finish
      • The define manual entity dialog is displayed.

      • Enter a name for the entity
      • Press the Add button to define a column/field for your entity (This displays the Define column dialog).
      • Repeat the previous step until your entity is fully defined
      • Press the set button to assign primary key columns/fields to your entity (this displays the select primary key fields dialog) Note: only columns that are not nullable can be assigned as primary key columns/fields
      • Use the Edit button to modify a column defined on your entity
      • Use the Remove button to delete a column defined on your entity
      • Optionally select the patterns tab to add patterns to your entity
      • Press OK to save your entity definition
      • Your manual entity is now displayed in the EIS Tier of the define application dialog.

    2. Database entity
      • Right mouse click on EIS Tier in the define application dialog
      • Select Add Database Entity from the popup menu
      • Or

      • Select the Action=>Tier menu option from the main menu in the define application dialog
      • Select EIS Tier and press next
      • Select Add Database Entity and press finish
      • The define database entity dialog is displayed.

      • Press the Select button. The select table dialog is displayed.
      • Expand the list of tables and select the required one.
      • Press OK. The database entity dialog will be populated from the table definition.
      • Edit the entity name as required
      • Press the set button to modify the primary key columns/fields assigned to your entity (this displays the select primary key fields dialog) Note: only columns that are not nullable can be assigned as primary key columns/fields
      • Use the Add button to add columns (from the table) to your entity
      • Use the Remove button to delete columns from your entity Note: this action will only delete the columns from your entity definition - not from the underlying database table
      • Optionally select the patterns tab to add patterns to your entity
      • Press OK to save your entity definition
      • Your database entity is now displayed in the EIS Tier of the define application dialog.

  2. Adding multiple entities (database applications only)
    • Right mouse click on EIS Tier in the define application dialog
    • Select Add multiple database entities from the popup menu
    • Or

    • Select the Action=>Tier menu option from the main menu in the define application dialog
    • Select EIS Tier and press next
    • Select Add multiple database entities and press finish
    • The select table dialog is displayed.

    • Expand the list of tables and select the required ones (use the shift key to select multiple tables).
    • Press OK. Your database entities will be automatically defined and displayed in the EIS Tier of the define application dialog.

  8.1.2  Editing an entityTo top of page

  1. Editing a manual entity
    • Right mouse click on the entity in the define application dialog
    • Select Edit from the popup menu
    • Or

    • Select the Action=>Component menu option from the main menu in the define application dialog
    • Select EIS Tier and press next
    • Select the entity you would like to edit and press next
    • Select Edit and press finish
    • The define manual entity dialog is displayed.

    • To modify the name of your entity type the new name in the entity name text field.
    • To add a new column/field to your entity, press the Add button (This displays the Define column dialog).
    • To edit a column in your entity select the column then press the Edit button (This displays the Define column dialog)
    • To remove a column from your entity select the column then press the Remove button
    • To modify the primary key columns/fields assigned to your entity, press the set button (this displays the select primary key fields dialog). Note: only columns that are not nullable can be assigned as primary key columns/fields
    • Optionally select the patterns tab to add or edit patterns applied to your entity
    • Press OK to save your entity definition
    • Your manual entity has now been updated and is displayed in the EIS Tier of the define application dialog.

  2. Editing a database entity
    • Right mouse click on the entity in the define application dialog
    • Select Edit from the popup menu
    • Or

    • Select the Action=>Component menu option from the main menu in the define application dialog
    • Select EIS Tier and press next
    • Select the entity you would like to edit and press next
    • Select Edit and press finish
    • The define database entity dialog is displayed.

    • To change the main table of your entity type press the select button. This will display the select table dialog. Expand the list of tables and select the one required. Press OK.
    • To modify the name of your entity type the new name in the entity name text field.
    • To add a new column/field to your entity, press the Add button (This displays the select columns dialog).
    • To remove a column from your entity select the column then press the Remove button
    • To modify the primary key columns/fields assigned to your entity, press the set button (this displays the select primary key fields dialog). Note: only columns that are not nullable can be assigned as primary key columns/fields
    • Optionally select the patterns tab to add or edit patterns applied to your entity
    • Press OK to save your entity definition
    • Your database entity has now been updated and is displayed in the EIS Tier of the define application dialog.

  8.1.3  Removing an entityTo top of page

You remove a manual entity and a database entity in the same way

  • Right mouse click on the entity in the define application dialog
  • Select Remove from the popup menu
  • Press Yes if the remove component dialog is displayed
  • Or

  • Select the Action=>Component menu option from the main menu in the define application dialog
  • Select EIS Tier and press next
  • Select the entity you would like to remove and press next
  • Select Remove and press finish
  • Press Yes if the remove component dialog is displayed
  • The entity will be removed from the EIS Tier of the define application dialog.

Index    Previous   <<>>  Next

[an error occurred while processing this directive]