Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Classes annotated with @XmlTransient are still mapped to XML #794

Closed
Tomas-Kraus opened this issue Nov 11, 2010 · 7 comments
Closed

Classes annotated with @XmlTransient are still mapped to XML #794

Tomas-Kraus opened this issue Nov 11, 2010 · 7 comments

Comments

@Tomas-Kraus
Copy link
Member

The JAXB javadoc states:

"When placed on a class, it indicates that the class shouldn't be mapped to XML
by itself. Properties on such class will be mapped to XML along with its derived
classes, as if the class is inlined."

Therefore, I expected that, given the code snippet below as an example, the
class Book would not be included in schema.xsd after running schemagen. But
schemagen is including it in the generated XML schema.

@XmlTransient
public class Book {
public String title;
public String author;
public String isbn;
}

@XmlRootElement
public class Library

{ @XmlElementWrapper(name="books") @xmlelement(name="book") @XmlJavaTypeAdapter(BookISBNAdapter.class) public Set book; }

public class BookISBNAdapter extends XmlAdapter<String, Book> {

public String marshal(Book book)

{ return book.isbn; }

public Book unmarshal(String isbn)

{ return BookLookupService.getByISBN(isbn);}

}

Environment

Operating System: All
Platform: All

Affected Versions

[2.2]

@Tomas-Kraus
Copy link
Member Author

@glassfishrobot Commented
Reported by deleted_user

@Tomas-Kraus
Copy link
Member Author

@glassfishrobot Commented
Was assigned to snajper

@Tomas-Kraus
Copy link
Member Author

@glassfishrobot Commented
@pavelbucek said:
metro2.1-waived

@Tomas-Kraus
Copy link
Member Author

@glassfishrobot Commented
snajper said:
Cannot reproduce, appears to be fixed.

@Tomas-Kraus
Copy link
Member Author

@glassfishrobot Commented
Marked as fixed on Tuesday, November 22nd 2011, 2:17:35 am

@Tomas-Kraus
Copy link
Member Author

@glassfishrobot Commented
This issue was imported from java.net JIRA JAXB-794

@Tomas-Kraus
Copy link
Member Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants