开发者

How to export EclipseLink objects to XML

开发者 https://www.devze.com 2022-12-25 13:16 出处:网络
is there an easy approach to store my model, which I use with EclipseLink, in XML files? I want to implement an export functionality in my progr开发者_如何学运维am and I was wondering if this can be

is there an easy approach to store my model, which I use with EclipseLink, in XML files?

I want to implement an export functionality in my progr开发者_如何学运维am and I was wondering if this can be done with eclipselink or with any other framework.

Thanks


Take a look at the EclipseLink MOXy component ( https://wiki.eclipse.org/EclipseLink/FAQ/MOXy ). This will easily allow you to map your existing POJO's to XML.


Depending on the complexity of your data model, using JAXB should be a relatively easy way to marshal (export) your objects to XML. You will have to annotate your entities with @XmlRootElement or @XmlType and your fields with @XmlElement or @XmlAttribute.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号