users@jaxb.java.net

Re: XSd key's and keyref's

From: Vincent Lamareille <vinc_at_sorengo.com>
Date: Wed, 14 Sep 2005 00:18:49 +0200

Kohsuke Kawaguchi wrote:
>
> I'd imagine it's probably easier to write them as a part of your
> application logic internal/external (depending on whether you need to
> regenerate classes often from a schema or not) to the generated code.

In respect of simplicity of code you are certainly right Kohsuke, and I
shall probably rely on control classes to check objects, at least in the
first steps.
BTW, we are prototyping design in an early elaboration phase.

The IF/IDREF mechanism is really annoying, since it provides only
textual comparison...
So I come back to my first question, are identity constraints xs:unique,
xs:key and xs:keyref available in JAXB2.0 RI EA or are they still
unsupported?

>
> You can certainly write a plugin that injects referential integrity
> checks into the generated code, if you prefer. Having such a plug-in
> that can work with arbitrary constraints (not just your particular one)
> would be very useful, but personally I don't really have a good idea
> about how to approach this problem. If you have some idea, by all means
> please try. I'm happy to help you with any plug-in questions.
>

I shall probably try writing a plugin to inject code, a bit later. I
have just read again your interesting blog.

> If you look at the current state of referential integrity support in
> schema languages for XML, it's really quite pathetic (perhaps except
> Schematron, but it doesn't express constraints in a way usable for a
> databinding tool like JAXB.)
>

That's true

> --
> Kohsuke Kawaguchi
> Sun Microsystems kohsuke.kawaguchi_at_sun.com