XBird handling persistence objects

2 views
Skip to first unread message

djd

unread,
Mar 13, 2009, 6:27:07 PM3/13/09
to xbird-users
Nice library guys.

I have a few questions :) for startup projects
I couldn't find an example of how to persist java objects (i.e. entity
beans), including updating.

More: does the API have a system to detect changes in persistent
objects? Something like: in a directory you have all .class files (for
entity beans). While running, I decide to change one (or more) of
these classes, recompile them and just drop them in that directory.
New class members should be inited to null (via reflection) or default
values (for primitive types). Is that possible?

Makoto YUI

unread,
Mar 14, 2009, 6:12:38 AM3/14/09
to xbird...@googlegroups.com
djd wrote:
> Nice library guys.

Thanks :-)

> I have a few questions :) for startup projects
> I couldn't find an example of how to persist java objects (i.e. entity
> beans), including updating.

Unfortunatery, *live* persistence is not supported as written in
http://code.google.com/p/xbird/wiki/XmlObjectBinding#Limitations

You have to explicitly replace an the old objects to new one,
i.e., a different object, in XMLMap|XMLSet|XMLArrayList
in just the same manner as you normally do it with the standard collections.

> More: does the API have a system to detect changes in persistent
> objects? Something like: in a directory you have all .class files (for
> entity beans). While running, I decide to change one (or more) of
> these classes, recompile them and just drop them in that directory.
> New class members should be inited to null (via reflection) or default
> values (for primitive types). Is that possible?

The deserialization behavior completely depends on XStream.
Declaring new fields as 'transient' will avoid the exceptions.

Get the detail on
http://xstream.codehaus.org/faq.html#Serialization_newer_class_versions

Makoto YUI

Reply all
Reply to author
Forward
0 new messages