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)往返
基础教程推荐
- 如何在 Spring @Value 注解中正确指定默认值? 2022-01-01
- Java 实例变量在两个语句中声明和初始化 2022-01-01
- 验证是否调用了所有 getter 方法 2022-01-01
- Java Swing计时器未清除 2022-01-01
- 不推荐使用 Api 注释的描述 2022-01-01
- 多个组件的复杂布局 2022-01-01
- 如何在 JFrame 中覆盖 windowsClosing 事件 2022-01-01
- 在 Java 中创建日期的正确方法是什么? 2022-01-01
- 从 python 访问 JVM 2022-01-01
- 大摇大摆的枚举 2022-01-01
