-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
 Post subject: Proxy and JAXB
PostPosted: Mon Apr 18, 2011 5:06 pm 
Newbie

Joined: Mon Jul 09, 2007 10:48 am
Posts: 7
I have found strange behaviour in Hibernate 3.5.x.
I have class with long @id field. This field is also annotated with @XmlElement

Code:
public class Abc {
@XmlElement
@Id
private long id;

....


If object is loaded via proxy (result of refresh/merge/load) then when I invoke JAXB.marshal then I have id=0 in generated XML.
If I use proxy initialization then everything is OK. Any idea why JAXB takes precedence over Hibernate javassist?

Regards

Jan


Top
 Profile  
 
 Post subject: Re: Proxy and JAXB
PostPosted: Tue Mar 27, 2012 7:09 pm 
Newbie

Joined: Wed Oct 13, 2010 11:19 am
Posts: 7
Check to see if you XmlAccessorType is set to Field. If it is, try setting it to property


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.