Configuring Weblogic 8 EJB for automatic key generation in JBuilder 9

Abstract: Configuring Weblogic 8 EJB for automatic key generation in JBuilder 9

Question:

Using JBuilder 9 with Weblogic 8.1, how do I configure an EJB 2.0 CMP entity bean, to auto-generate the key for a table using a sequence in Oracle. If I try and manually edit the weblogic-cmp-rdbms-jar.xml deployment descriptor by hand, the changes get overwritten when I rebuild the project.

How do I tell JBuilder to put these lines in the xml file?

___________________________

<automatic-key-generation>

<generator-type>ORACLE</generator-type>

<generator_name>case_key_seq</generator-name>

<key-cache-size>20</key-cache-size>

</automatic-key-generation>

___________________________

Answer:

In the Project Pane, under the EJB module, double-click on your (Entity) bean, and then in the main window area, click on the "Weblogic 8.x General" tab. This will open a new editor view with fields available for you to configure the "Automatic key generation" information.

The reason that your manual edits to the deployment descriptors get overwritten, is because the deployment descriptors are created from the information indicated from the "DD Editor" (Deployment Descriptor Editor). The idea is that you should be able to configure everything you need for the deployment descriptors from the DD Editor.