|
Re: Dynamic Moxy can not work together with JPA Lazy Loading [message #1107111 is a reply to message #1107026] |
Thu, 12 September 2013 01:20 |
jason zhang Messages: 31 Registered: July 2009 |
Member |
|
|
I am trying to use VirtualMapping as a workaround. I do not need DynamicJaxbContext to control my entity since entity is already created by JPA.
Here is an example mapping
<java-type name="SingleInt" super-type="java.lang.Object" xml-accessor-type="PUBLIC_MEMBER">
<xml-root-element name="SingleInt"/>
<xml-virtual-access-methods get-method="realGet" set-method="set"/>
<java-attributes>
<xml-attribute java-attribute="id" name="id" xml-id="true" type="java.lang.Long"/>
<xml-element java-attribute="DateCreated" name="DateCreated" required="true" type="java.sql.Timestamp"/>
<xml-element java-attribute="DateModified" name="DateModified" required="true" type="java.sql.Timestamp"/>
<xml-element java-attribute="defaultCase" name="defaultCase" type="java.lang.Long"/>
<xml-element java-attribute="withdefault" name="withdefault" type="java.lang.Long"/>
<xml-element java-attribute="requiredAndAuto" name="requiredAndAuto" required="true" type="java.lang.Long"/>
<xml-element java-attribute="AutoButNotRequired" name="AutoButNotRequired" type="java.lang.Long"/>
<xml-element java-attribute="withminandmax" name="withminandmax" type="java.lang.Integer"/>
<xml-element java-attribute="allowedValue" name="allowedValue" type="java.lang.Long"/>
<xml-element java-attribute="allowedWithDefault" name="allowedWithDefault" type="java.lang.Long"/>
</java-attributes>
</java-type>
If I specify the super-object is Object, all of my property are skipped by JAXB.
If I do not specify super-type, I got this error no matter xml-accessor-type is PUBLIC_MEMBER or NONE
Exception Description: The class org.eclipse.persistence.internal.dynamic.DynamicEntityImpl$PropertyWrapper requires a zero argument constructor or a specified factory method. Note that non-static inner classes do not have zero argument constructors and are not supported.
Is there a way I ask the JAXB do not scan my class?
[Updated on: Thu, 12 September 2013 01:21] Report message to a moderator
|
|
|
|
Powered by
FUDForum. Page generated in 0.02999 seconds