XSD 架构 - JAXB 封送处理 - 数据存储(JPA/JDO)往返 [英] XSD Schema - JAXB marshaling - Datastore(JPA/JDO) Roundtrip

查看:23
本文介绍了XSD 架构 - JAXB 封送处理 - 数据存储(JPA/JDO)往返的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试找到一种方法来完成 xsd 架构到数据存储的往返,而且工作量最小.

I'm trying to find a way to accomplish a xsd schema to datastore roundtrip, with minimum effort.

我使用 jaxb 从模式构建对象模型,现在我想基于 JPA(或 JDO 或其他东西?)存储这些对象.是否可以根据 JAXB 注释自动增强缺少注释的对象?这是可取的吗?

I used jaxb to build my object model from schemas, now I would like to store these objects based on JPA (or JDO or something else?). Is it possible, to auto enhance the objects with the missing annotations based on the JAXB Annotations? Is it desirable?

谢谢

推荐答案

这个用例有几个选项.

选项 #1 - Hyperjaxb3

我自己没有用过这个,但是Hyperjaxb3应该在模型上同时生成JAXB和JPA注解:

I have not used this myself, but Hyperjaxb3 is supposed to generate both JAXB and JPA annotations on the model:

选项 #2 - 使用 Dali 将您的 POJO 映射到数据库 (JPA)

Eclipse Dali 工具提供了使用 JPA 将 POJO 轻松映射到关系数据库的工具:

The Eclipse Dali tool provides tooling to easily map your POJOs to a relational database using JPA:

选项 #3 - 使用 EclipseLink

EclipseLink 提供 JPA 和 JAXB 实现.JAXB 实现 (MOXy) 包含专门用于处理 JPA 实体的扩展:

EclipseLink provides both JPA and JAXB implementations. The JAXB implementation (MOXy) contains extensions specifically for handling JPA entities:

这篇关于XSD 架构 - JAXB 封送处理 - 数据存储(JPA/JDO)往返的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆