cxf-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Benson Margulies (JIRA)" <j...@apache.org>
Subject [jira] Commented: (CXF-2041) XmlTransient annotation seems to be ignored
Date Sun, 15 Feb 2009 21:36:59 GMT

    [ https://issues.apache.org/jira/browse/CXF-2041?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12673750#action_12673750
] 

Benson Margulies commented on CXF-2041:
---------------------------------------

You have the @XmlTransient in the wrong place. It needs to be on the setter for the property,
not on the private field. It's the setter that JAXB is looking at.

When I changed this, schemagen.sh started to stop emitting the 'parent' field.

Your junit test continued to fail, but I didn't debug that.


> XmlTransient annotation seems to be ignored
> -------------------------------------------
>
>                 Key: CXF-2041
>                 URL: https://issues.apache.org/jira/browse/CXF-2041
>             Project: CXF
>          Issue Type: Bug
>          Components: JAXB Databinding
>    Affects Versions: 2.1.4
>         Environment: Spring 2.5.6
>            Reporter: Kariem Hussein
>         Attachments: test-cxf-xmltransient.zip
>
>
> Properties marked with @XmlTransient  should be prevented from being mapped to XML. For
two objects with a parent-child relationship where the object references are bi-directional,
properties annotated accordingly should be ignored during marshalling. I have tried different
options, but could never observe that @XmlTransient is actually taken into account.
> # examples in peudo-code (test project will be attached)
> Models:
> class Parent {
>   List<Child> children;
> }
> class Child {
>   @XmlTransient  // <-- annotated to exclude this property from XML marshalling
>   Parent parent;
> }
> Test:
> testMarshalling {
>   Parent p = new Parent();
>   Child c = new Child();
>   c.setParent(p);
>   p.setChildren(Arrays.asList(c));
>   doSomethingViaWebService(p);  // <-- throws Exception here
> }
> I could imagine that some problems arise when using another spring version than the one
packaged with CXF, but I think there should not be issues in such a limited scenario. Either
the documentation is missing important parameters or there is actually a problem somewhere.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message