HJ3 Modules

This page decsribes HJ3 modules and their functionality.
Initial description based upon Aleksei's email

Modules can be divided into following groups:

  • generic modules (runtime, tools, testing)
  • hibernate (hibernate-mapping, hibernate-configuration,

hibernate-customizations, hibernate-roundtrip, hibernate-runtime, hibernate-plugin)

  • ejb (ejb-roundtrip, ejb-schemas, ejb-plugin)
  • maven (maven, maven-testing)
  • tests (tests, tests-ejb)

Generic modules.

Generic modules actually better suit jaxb2-commons project and will be probably
moved there some time in the future. This is generic functionality which has
nothing specific to the persistence semantics of Hyperjaxb3.

runtime

Contains some interfaces and classes which will be used in the runtime. For
instance, if you use equals or hashCode plugins from the hyperjaxb3-tools (next
module), they will make your JAXB classes implement Equals, HashCode or ToString
interfaces which are defined in the runtime module.

tools

Contains generic JAXB2 tools and plugins like toString, equals, hashCode etc.

testing

Generic testing framework. Defines, for instance, an AbstractSamplesTest which
will execute some checks (implemented bu subclasses ) against the *.xml files
from src/test/samples.

Hibernate modules.

hibernate-mapping and hibernate-configuration

These two modules are just JAXB compilation of Hibernate mapping and
configuration DTDs. Hyperjaxb3 uses these modules to generate the XML of
Hibernate mapping and configuration files. Rather than generate XML directly,
Hyperjaxb3 produces object structures which are then serialized.

hibernate-customizations

This is a JAXB compilation of the Hyperjaxb3 Hibernate customizations schema.
Generated mapping are customized by the XML fragments defined either within the
schema (in xsd:annotations) or externally in binding files (xjb). Being XML,
customizations respect their own schema which is compiled with JAXB in this
module. So internally Hyperjaxb3 works with object representation of
customizations rather than with XML directly.

hibernate-roundtrip

Roundtrip tests for Hibernate: unmarshall, save, load, compare.

hibernate-runtime

Runtime classes and interfaces. For instance, Hibernate custom types,
implementation of accessors etc.

hibernate-plugin

Implementation of the JAXB2 Hyperjaxb3 Hibernate plugin. This is what generates
*.hbm.xml and *.cfg.xml.

EJB modules.

They are under and active development rioght now.

ejb-roundtrip

Similar to hibernate-roundtrip but via JPA.

ejb-schemas

JAXB compilation of persistence_1_0.xsd and orm_1_0.xsd. I'll need them to
generate META-INF/persistence.xml and possible XML mappings.

ejb-plugin

Responsible for generating JPA-annotated entities.

Maven

maven

Hyperjaxb3 plugin for Maven.

If you use maven-jaxb2-plugin and want to use Hyperjaxb3 as well, you'll have to
add Hyperjaxb3 dependencies and turn on the JAXB2 Hyperjaxb3 plugin using the
<args/> in the plugin config. maven-hyperjaxb3-plugin does it for you. It adds
all the required dependencies, activates the necessary JAXB2 plugins, and
provides convenient means of configuration.

maven-testing

Testing infrastructure for maven-hyperjaxb3-plugin. Allows to configure and
execute the maven-hyperjaxb3-plugin in the frame of an automated test (unit
test). Very useful when debugging JAXB2 plugins

Tests

These modules contains test scenarios. Each test scenario is a just a small
project built with Maven/Hyperjaxb3. It typically contains a schema and a number
of sample files. Each test scenatio has an own Maven build. During this build,
the schema is processed with JAXB2/Hyperjaxb3 and generated code is compiled.
Test scenarios also typically generate roundtrip test cases. So at the end,
generated code is checked for roundtripping against the sample files.

tests

These are Hibernate tests. There are plenty of them but only four are currently
deployed. Other test are just taken from Hyperjaxb2. They should theoretically
work, but must be adapted (like namespaces and so on).

tests-ejb

These will be tests for the upcoming ejb-plugin. There's only one po test there
currently.