users@jaxb.java.net

Re: whats the current status of hyperjaxb3?

From: Aleksei Valikov <valikov_at_gmx.net>
Date: Tue, 03 Oct 2006 13:42:17 +0200

Hi.

> This is wonderful news.
>
> Is there any bits that we/people can play? Is there any plan to post an
> alpha release or something?

I have deployed the 0.1 version into the maven2-repository of dev.java.net. This
means all libraries/plugins are available to use.

If anyone wants to play, there are two sample projects available:

Hyperjaxb3 Hibernate Sample Project:
https://hyperjaxb3.dev.java.net/repository/org/jvnet/hyperjaxb3/hyperjaxb3-hibernate-sample/0.1/hyperjaxb3-hibernate-sample-0.1-src.zip
This is the "usual" generation of Hibernate *.hbm.xml and *.cfg.xml.

Hyperjaxb3 EJB Hibernate Sample Project:
https://hyperjaxb3.dev.java.net/repository/org/jvnet/hyperjaxb3/hyperjaxb3-ejb-hibernate-sample/0.1/hyperjaxb3-ejb-hibernate-sample-0.1-src.zip
This is the new EJB stuff. Annotates classes with JPA annotations and some
Hibernate annotation extensions. Roundtrip test uses pure JPA API.

As usual, these are simply zipped projects, so just unzip and mvn clean install.
(Maven will download everything itself). You'll see the code/mappings
generated/annotated and the roundtrip tested against the sample XML file.

Now about the Hibernate annotations.

It appears that EJB3 spec has some severe flaws which limit its usage with JAXB.
What's relevant to us is:

* There is no way to map a collection of primitive values (List<String>, for
instance). JAXB does generate such fields.
* There are no custom types. You just can't map stuff like QName or
XMLGregorianCalendar - used by JAXB for xsd:QName or xsd:dateTime types.
* There is no accessor infrastructure. This imposes two problems for JAXB. (1)
JAXB geneerates no setters for collections so custom list accessors come quite
handy here. (2) Custom accessors allow to distinguish null/zero/empty semantics
for numeric primitive types using isSet/unset methods.

It seems that Hyperjaxb3 will have several EJB3-vendor specific dialects so I've
started with Hibernate dialect since it's what I'm most familiar with. yes, I
can imagine a "pure" vendor-independent EJB3 solution - but with massing code
augmentation.

Ok for now. If you have two minutes of time and Maven installed, please try out
the sample projects:
https://hyperjaxb3.dev.java.net/repository/org/jvnet/hyperjaxb3/hyperjaxb3-hibernate-sample/0.1/hyperjaxb3-hibernate-sample-0.1-src.zip
https://hyperjaxb3.dev.java.net/repository/org/jvnet/hyperjaxb3/hyperjaxb3-ejb-hibernate-sample/0.1/hyperjaxb3-ejb-hibernate-sample-0.1-src.zip
Just unzip/mvn clean install and report. This will help me ensure the
cross-environment stability of builds.
Thanks in advance.

Bye.
/lexi