First of all,
I´m new to ebeans, thanks to the stackoverflow question strategy (it
worked well for me).
I loved what I read from the manual and decided to give it a try. So
far, it´s beens easy to use, but one cenario is giving me a hard time:
I have one use case in witch an Entity must be serialized into XML,
with an specific format. I´m using XStream for that, and vanila mode
on the query did the trick of removing enhancers.
The problem is when I have to deserialize that XML to the entity,
since XStream does not call the default constructor, I end up with the
enhanced version of the entity with all enchancements null, so any
call to setProperty will throw a NullPointerException.
Xstream has a method that let you pass the instance, so I used it. I
called new MyEntity() and passed that instance to XStream, but all
related Entities (One2Many or Many2Many) have the same problem, null
for every _ebean intercept.
Is there a way to ask ebean to "attach" (populate the internal fields
_ebean) for that entity?
I can use readResolve() (
http://xstream.codehaus.org/
faq.html#Serialization_initialize_transient) on the entities to
populate _ebean fields, but how should that be done?
Thanks in advance,
Raul.