JDX Programming Code Snippets

Here are some simple programming snippets to illustrate JDX ORM mapping specifications and APIs for sample object models (class definitions). Each sample is named to signify a typical modeling or usage pattern.

In the interest of keeping our description short and to the point, we may not show different constructors and accessor (setter/getter) methods in a class definition. Similarly, although a mapping specification (provided in a text file) may contain mapping information for multiple classes used in a particular application, we might just show and concentrate on the mapping information for only one or a few classes. Also, we may not show any business logic or user interface (UI) related code.

Please notice the following advantages of using JDX ORM in the following programming snippets:

  • The object model class definitions do not have any ORM specific artifacts:
    - There is no subclassing from any ORM related base class.
    - There are no mapping annotations cluttering a class definition.
  • The mapping specification is simple, declarative, and totally non-intrusive to the object model definitions.
  • The APIs are simple, intuitive, and flexible. There is no need to create and use a ‘Data Access Object (DAO)’ for each object model class.