NORDIC Schema for TopLink Demonstration (3)


Now to complete the creation of the ANIMAL type started in NORDIC Schema for TopLink Demonstration (2) by using JDeveloper and TopLink.

Create the Animal Types

ANIMAL_STATEFLOW

The name ANIMAL_STATEFLOW nows conforms to the original intent of the Nordic Database example.

In the Intro project of the Oklahoma project,

  1. Right-click on the NORDIC folder under Nordic_database which is under Offline Database Sources
  2. Select New Database Object...
  3. Select Type
  4. Change the name to ANIMAL_STATEFLOW
  5. In the editor window, change the code to:
  6. CREATE OR REPLACE
    TYPE ANIMAL_STATEFLOW AS OBJECT
    ( 
      current_state VARCHAR2( 30 )
    )
    NOT FINAL;
    
  7. Right-click on ANIMAL_STATEFLOW in the Application Navigator, and choose Generate to....
  8. Choose Create and click Finish

The other types are created similarly.

HUMAN_STATEFLOW

The name HUMAN_STATEFLOW nows conforms to the original intent of the Nordic Database example.

CREATE OR REPLACE
TYPE human_stateflow UNDER animal_stateflow ();

ANIMAL

CREATE OR REPLACE
TYPE animal AS OBJECT
( 
name VARCHAR2(30),
current_state animal_stateflow
) NOT FINAL;

HORSE

CREATE OR REPLACE
TYPE horse UNDER animal ();

HUMAN

CREATE OR REPLACE
TYPE human under animal
( 
) NOT FINAL;

GUY

CREATE OR REPLACE
TYPE guy UNDER human();

GIRL

CREATE OR REPLACE
TYPE girl UNDER human();

Implement the Type Definitions

Use the CTRL key along with the left-click to select the following types:

  • ANIMAL
  • ANIMAL_STATEFLOW
  • GIRL
  • GUY
  • HORSE
  • HUMAN
  • HUMAN_STATEFLOW

Then right-click on the selection to get the context menu:

  1. Select Generate to...
  2. Select XE_Nordic... (Name of database connection)
  3. Select REPLACE as the method to reconcile the objects
  4. Click Finish to start to operation
  5. Click OK on the results message box to acknowledge completion of the database schema update.

Conclusion

I had hoped that JDeveloper would have had a more sophisticated UI to create database types other that an online text editor.

I was further disappointed in the creation of views. There is no support for Object Views and imported object views have any object-related information stripped.

This leaves me in a quandry of how to proceed with this demonstration of TopLink. I could do all of the object-orientated stuff in the XE database only to have the development tool ignore it.

Advertisements

One thought on “NORDIC Schema for TopLink Demonstration (3)

  1. NORDIC Schema for TopLink Demonstration (3)4 « Yet Another OCM

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s