Simple O/R Mapping Tool Help

Main Screen

Code Generator Main Screen

After running codegen.sh, you should see the main screen. Here you will see a tree pane for the schema objects (tables and views) for the Oracle database to which
you will connect to extract schema information and generate Java code for a simple  one-to-one  object relational mapping.  On the right pane titled Code Generation
you have fields which are prepopulated and default code type to generate as dao (Data Access Object).
Currently three types of Java classes can be generated


Schema Extraction

The first step in code generation is schema extraction from an Oracle database. First, select Load Schema Objects from File Menu.
The following dialog box will appear. Initially the fields in the dialog box will be empty. However, the code generator saves the last setting after each run.

DB Params Dialog


Here you need to provide the database type (Oracle or Postgres), database host, port, name and user/schema information for the schema
where your database tables /views reside. Then, press OK. After successful schema extraction, the Generate and Select All buttons
in the Code Generation panel will be enabled. And you will see the tree and schema object list box populated.

Now you can select the schema objects from the list, adjust the parameters like code type and output directory and press Generate button.

after code generation

Here, two data access objects are generated for NC_USERCLASS and NC_EXPSEGMENT schema objects and saved to /tmp/clinical/server/dao directory. The Package Name is the name of the package for the data access objects. Since data access objects depend both on code generated (like value objects) and programmer written Java code residing in clinical.exception and clinical.server.utils packages, if you want to use a different package structure, you need to move the dependencies in clinical.exception and  clinical.server.utils packages to your package structure and set the Package Name, Value Object Package Name, Exception Package Name and Utilities Package Name fields accordingly.

Custom Code in Generated Java Code and Code Regeneration

During development, there may be cases where you need to customize some of the generated code. If you don't want your custom code to disappear after code regeneration,
you should put your custom code within delimeters like shown below.

 /*+++    */
  // Enter your code here
String myVar;

public String getMyVar() { return this.myVar; }
/*+++    */