<h3>All generated classes implement Serializable</h3>
in order the generated classes to implement Serializable (because you may want to save them in a db) then add to xsd:
<pre name="code" class="xml">
<schema ...
xmlns:jaxb="http://java.sun.com/xml/ns/jaxb"
xmlns:xjc="http://java.sun.com/xml/ns/jaxb/xjc"
jaxb:extensionBindingPrefixes="xjc"
jaxb:version="1.0">
<annotation>
<appinfo>
<jaxb:globalBindings generateIsSetMethod="true">
<xjc:serializable uid="12343"/>
</jaxb:globalBindings>
</appinfo>
</annotation>
...
</pre>
<h3>References</h3>
http://download.oracle.com/docs/cd/E17802_01/webservices/webservices/docs/1.6/jaxb/vendorCustomizations.html#serializable
http://stackoverflow.com/questions/3677088/how-to-generate-classes-from-xsd-that-implements-serializable
in order the generated classes to implement Serializable (because you may want to save them in a db) then add to xsd:
<pre name="code" class="xml">
<schema ...
xmlns:jaxb="http://java.sun.com/xml/ns/jaxb"
xmlns:xjc="http://java.sun.com/xml/ns/jaxb/xjc"
jaxb:extensionBindingPrefixes="xjc"
jaxb:version="1.0">
<annotation>
<appinfo>
<jaxb:globalBindings generateIsSetMethod="true">
<xjc:serializable uid="12343"/>
</jaxb:globalBindings>
</appinfo>
</annotation>
...
</pre>
<h3>References</h3>
http://download.oracle.com/docs/cd/E17802_01/webservices/webservices/docs/1.6/jaxb/vendorCustomizations.html#serializable
http://stackoverflow.com/questions/3677088/how-to-generate-classes-from-xsd-that-implements-serializable
No comments:
Post a Comment