Hi, I have a problem which may be a bug in the OJB xdoclet plugin and/or in OJB itself. Or I'm doing something wrong, of course ;-) Can anyone shed any light?

I have a persistent class with a static inner class which is also persistent. The outer class holds a collection of instances of the inner class. Both are marked up with xdoclet tags, so I have something like this:

/**
 * @ojb.class
 */
public class History {
    /**
     * @ojb.class
     */
    public static class Change {
        // change log info...
    }

    /**
     * @ojb.collection foreignkey="..."
     *         element-class-ref="...History$Change"
     */
    private List changes;
}

The first problem is that xdoclet chokes on the '$' in the element-class-ref, givig the error "Collection changes in class ...History references an unknown class ...History$Change." That's legal syntax for an inner class, so I'd call that a bug... Would I be wrong?

Secondly, if I change the '$' to '.', the repository is generated OK but OJB chokes on startup, throwing a ClassNotFoundException for ...History.Change. I thought both '.' and '$' were legal ways to reference an inner class; is OJB at fault here, or is the '.' syntax really not allowed?

If I manually edit the generated repository_user.xml and change the references to Change to use '$', it works, so I know my mappings are otherwise correct.

So:
- is xdoclet (or the OJB plugin) at fault for not accepting the '$' form?
- is OJB at fault for not accepting the '.' form?
- Am *I* at fault for doing something wrong?

If it's the last case, what should I be doing?

Thanks,

L.

[PS, I can post a more complete code example, generated mapping files, etc, if it helps.]


--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to