Using the EclipseJDO plugin with FastObjects

Introduction

Eclipse is an open, extensible IDE that can be used to create applications as diverse as web sites, embedded Java™ programs, C++ programs, and Enterprise JavaBeans™.

EclipseJDO is a plugin that makes it easy and fast to develop transaction applications in Java using JDO drivers. This tool integrates the JDO enhance command with the JDT building process. The EclipseJDO plugin for JDO development in Eclipse 3.0 can be used with all FastObjects products. The FastObjects tools can be used for bytecode enhancment, schema and database creation.

To use EclipseJDO with FastObjects the FastObjects Driver is required.

Updates for EclipseJDO and the FastObjects Driver can be found at SourceForge.net:

http://sourceforge.net/projects/eclipsejdo/

System Requirements

1.      Windows XP/2000. Tests on on Linux were also successfully but EclipseJDO is officially only tested under Windows XP/2000.

2.      FastObjects e7/t7/j1 or j2 version 9.5.9.80 or later. Make sure that the FastObjects installation path name does not contain spaces.

3.      Eclipse 3.0 (http://www.eclipse.org/downloads/)

4.      EclipseJDO 0.9.9 (http://sourceforge.net/projects/eclipsejdo/). EclipseJDO requires the EMF plugin (http://www.eclipse.org/emf)

Installation

Make sure that the required versions of FastObjects, Eclipse and EclipseJDO are installed.

1.      Unzip the com.versant.eclipse.jdo.fastobjects_0.9.9.zip file to <eclipse-dir>/plugins.

2.      Configure the FastObjects Driver for EclipseJDO:

1.      Copy the com.versant.eclipse.jdo.fastobjects.jar from the FastObjects Driver installation directory to the lib directory of your FastObjects installation.

2.      Before starting Eclipse, modify the plugin.xml to contain the FastObjects Driver installation directory:

1.       the XML element
<driver
.....
driverPath="C:\Programs\FastObjects_t7_9.5\lib"
>
must contain the absolute path to the lib directory of your FastObjects installation.

2.      the XML element
<library name="JDO" value="C:\Programs\FastObjects_t7_9.5\runtime\lib\jdo.jar"/>
must contain the absolute path to the jdo.jar file found in the runtime\lib directory of your FastObjects installation.

3.      the XML element
<library name="FastObjects SDK" value=" FastObjects_t7_SDK.jar"/>
must contain the SDK jar file name of the FastObjects_<product>_SDK.jar file found in the lib directory of your FastObjects installation (<product> is j1, j2, e7 or t7).

Configuration

1.      Create a new Eclipse project using the JDO Java Project wizard (choose 'File'->'New Project...' from the Eclipse main menu and then 'JDO'->'JDO Java Project' from the displayed dialog)

2.      In the 'Project Properties' dialog choose 'JDO Settings' and select 'FastObjects' as Enhancer Type. Make sure that the the jdo.jar and the FastObjects SDK jar file from your FastObjects installation appears under 'Other jars needed'. The name of the FastObjects SDK jar is FastObjects_<product>_SDK.jar (<product> is j1, j2, e7 or t7). Click Apply.
Tip:
You can make the FastObjects Enhancer the default Enhancer Type by choosing 'Window->Preferences' from the Eclipse main menu. Choose 'JDO'->'Drivers' in the shown up dialog, choose 'FastObjects' and click the 'As default' button found at the left lower corner of the dialog. Click 'OK' to close the dialog.

3.      In the 'Project Properties' under 'Java Build Path' select the 'Libraries' tab. Select the 'FastObjects' entry and click edit. Remove the entries for the com.versant.eclipse.jdo.fastobects.jar and the FastObjects SDK jar and add the absolute path to the FastObjects_<product>_JDO.jar (<product> is j1, j2, e7 or t7). If the 'FastObjects' entry should not show up on the 'Libraries' tab, click 'OK' to close the Project 'Properties' dialog and re-open it by choosing 'Project->Properties' from the Eclipse main menu. The 'FastObjects' entry should now appear on the 'Libraries tab of the 'Java Build Path'. If the 'Project Properties' dialog will not be closed on clicking 'OK' with an error message shown up, remove the 'Sun (Reference)' entry from the 'Libraries' tab before clicking 'OK'.
Tip:
Every time you have changed the Enhancer Type for some reasons and then change it back to FastObjects, you must re-adjust the entries in the 'FastObjects' entry of the 'Java Build Path'->'Libraries' tab.

Schema and Database Creation

This section decribes how to use an enhancer response file for schema and database creation.

Make sure that the FastObjects bin and runtime/bin directories are in the PATH environment variable when running Eclipse.

If classes should be registered in the database schema when they are enhanced, you can use a response file to specifiy the command line arguments for ptj for schema and database creation. Please note that registration in the schema is only required for FastObjects e7/t7. For FastObjects j1/j2 classes are registered on-the-fly during runtime.

To register classes in the schema 'mydict' and create a database 'mybase' place a file named options.ptj with the following contents in the root-directory of the Eclipse project:

options.ptj:

-register -updateOrCreate -schema mydict -database mybase

It is important to use the -updateOrCreate switch. When only -create or -update is used Eclipse can hang if the FastObjects Enhancer must request user-input.

Please see the FastObjects JDO Programmers Guide for more information about the ptj command line switches.

Limitations

5.      'Input folder' with classes for enhancement is not supported

6.      currently all external jars are passed to the enhancer, this might be slow

Known Issues

7.      when using package.jdo files with individual class jdo files, enhancement might not work

8.      under Linux Motif the enhancer view contains only one line

9.      Eclipse hangs when ptj requests interaction (schema create/update)