XSD Schema - JAXB marshaling - Datastore(JPA/JDO) Roundtrip(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:
- http://confluence.highsource.org/display/HJ3/Home
选项 #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:
- http://www.eclipse.org/webtools/dali/
选项 #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:
- http://wiki.eclipse.org/EclipseLink/Examples/MOXy/JPA
这篇关于XSD 架构 - JAXB 封送处理 - 数据存储(JPA/JDO)往返的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:XSD 架构 - JAXB 封送处理 - 数据存储(JPA/JDO)往返


- Eclipse 插件更新错误日志在哪里? 2022-01-01
- Jersey REST 客户端:发布多部分数据 2022-01-01
- Spring Boot连接到使用仲裁器运行的MongoDB副本集 2022-01-01
- value & 是什么意思?0xff 在 Java 中做什么? 2022-01-01
- C++ 和 Java 进程之间的共享内存 2022-01-01
- Safepoint+stats 日志,输出 JDK12 中没有 vmop 操作 2022-01-01
- 如何使用WebFilter实现授权头检查 2022-01-01
- 从 finally 块返回时 Java 的奇怪行为 2022-01-01
- Java包名称中单词分隔符的约定是什么? 2022-01-01
- 将log4j 1.2配置转换为log4j 2配置 2022-01-01