The ability to serialize entity introduced with Hibernate 3 using the configurable EntityMode is very powerful.
I've found simple examples on how serialize to XML persisted object using the
Hibernate API.
BUT I haven't found any example that shows how to serialize (with a EntityMode.DOM4J session) a transient object i.e. an object that has not been persisted.
I would like to to something like that:
Code:
MyEntity e = new MyEntity();
e.setXxx(..);
Session dom4jSession = session.getSession(EnityMode.DOM4J);
xmlString = dom4jSession.serializeToXml( e );
// .. store xmlString in local repository
Is it possible to do something like that using Hibernate mapping API or I'm on the wrong way?
Thank you.
Regards, Paolo