"jason.greene(a)jboss.com" wrote : Or different schemas need to be associated with
the same object model.
| -Jason
Yes, this is also broken as well. :-)
The namspace is associated with the
package level annotation rather the root element.
This is a basic reusability issue.
e.g. It should be:
| public class AbstractEJBModel
| {
| @XMLElement(name="enterpriseBeans")
| public void setEJBs(List<EJB> ejbs);
| }
|
| @XmlRootElement(namespace="EJB21Namespace")
| public class Ejb21Model extends AbstractEJBModel
| {
| }
|
| @XmlRootElement(namespace="EJB30Namespace")
| public class Ejb30Model extends AbstractEJBModel
| {
| }
|
The ejbs property should be mapped to EJB21Namespace/EJB21Model or
EJB30Namespace/EJB30Model
depending on the model chosen (the namespace in the xml).
I have this in my prototype of bindings for JBossXB annotations -
the USE_PARENT_NAMESPACE.
| /**
| * SchemaProperty.
| *
| * @author <a href="adrian(a)jboss.com">Adrian Brock</a>
| * @version $Revision: 1.1 $
| */
| @Documented
| @Target(ElementType.METHOD)
| @Retention(RetentionPolicy.RUNTIME)
| public @interface SchemaProperty
| {
| /** Whether it is mandatory */
| boolean mandatory() default true;
|
| /** The namespace, default empty */
| String namespace() default SchemaConstants.USE_PARENT_NAMESPACE;
|
| /** The local name, default use the property name */
| String name() default SchemaConstants.USE_PROPERTY_NAME;
|
| /** The implementation class */
| Class<?> impl() default Object.class;
|
| /** TODO remove this when groups work properly */
| boolean noInterceptor() default false;
|
| /** TODO combine with mandatory */
| boolean ignore() default false;
| }
|
View the original post :
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4006802#...
Reply to the post :
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&a...