没有 Enterprise Server 的 Java 数据持久性?

发布于 2024-08-20 13:25:23 字数 796 浏览 4 评论 0原文

有哪些解决方案可以在不需要成熟的企业服务器的情况下保存数据?我对 Java 还很陌生。在大学,整个课程都是基于 Java 的,所以我已经编写了一些代码。但它从未深入探讨可用的框架。我们实际接触持久化的唯一方法是使用“vanilla”JDBC 连接。

我做了一些挖掘并发现了典型的解决方案。最突出的是“JAXB”、“JPA”、“Hibernate”和“TopLink”。据我所知,最后两个实际上是在实现“JPA”,这只是一个规范。我在这儿吗?

到目前为止我找到的所有教程都很好地解释了这些内容,我不得不说我非常喜欢 JPA。但我见过的所有教程都是使用网页来解释的。然而,我正在寻找基于 swing 的解决方案。没有网络启动或类似的东西。我想创建一个独立的 Java 桌面应用程序。考虑到目标受众和需求,我无论如何都不需要客户端/服务器架构。

现在,还有 Beans Binding 的话题。对我来说,这看起来很有趣。即使考虑到您必须手动触发“PropertyChanged”事件。老实说,我不在乎添加的几行。

那么...为了创建独立的桌面应用程序,从现有遗留数据库保存(和读取)数据:

您对框架/库/规范有什么建议?

  • JPA?
  • 数据库连接?
  • 豆子绑定?

更重要的一件事:我要编写应用程序的主数据库包含多表继承和缓慢变化的维度。我已经在 TopLink 上乱涂乱画了,结果还不错。但我想摆脱应用程序服务器。

...哦,还有...将 Beans Binding 与实体结合使用是否可行?使属性可读/可写?

What solutions exist to persist data, without requiring a full-blown enterprise server? I am fairly new to Java. At uni the whole curriculum was based on Java, so I coded a bit already. But it never went into depth with the available frameworks. The only way we actually touched on persistens was using "vanilla" JDBC connections.

I've done some digging around and came across the typical solutions. Most prominently "JAXB", "JPA", "Hibernate" and "TopLink". As far as I can tell, the last two are actually implementing "JPA", which is just a spec. Am I right here?

All the tutorials I have found so far explained these fairly well, and I have to say that I like JPA quite a lot. But all the tutorials I have seen, explained it all using web-pages. I am looking for a swing based solution however. Without webstart or the likes. I'd like to create a stand-alone Java desktop app. Given the target audience and the requirements, I don't need a client/server architecture anyways.

Now, there is also the topic of Beans Binding. Which, to me, looks like fun. Even considering that you have to fire you "PropertyChanged" events manually. Honestly, I don't care about the few added lines.

So... for creating a stand-alone desktop app, saving (and reading) data from already existing legacy databases:

What are your recommendations of frameworks/libraries/specs?

  • JPA?
  • JDBC?
  • Beans Binding?

One more important thing: The primary database I would be writing the app against contains Mutliple Table Inheritance and Slowly Changing Dimensions. I've been doodling around with TopLink already, and the results are fine. But I want to get rid of the application server.

... oh, and... would it be feasible to use Beans Binding in conjunction with Entities? Making the properties read/writable?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

苏大泽ㄣ 2024-08-27 13:25:23

我推荐 JPA——虽然它是一个标准,但它与整个 Java EE 规范完全分开。您不需要企业应用程序服务器即可使用它。事实上,Sun 有一个“在桌面应用程序中使用 JPA”文章。

I recommend JPA -- while it's a standard, it is completely separate from the whole Java EE spec. You don't need a enterprise application server to use it. In fact, Sun has a "Using JPA in Desktop Applications" article.

难理解 2024-08-27 13:25:23

JPA + Hibernate、内存java数据库中的Derby、Swing destop App。在对我的 Model 类进行注释并在 XML 文件中指定 derby 驱动程序和此类琐事之后,持久性就变得非常自动了。

JPA + Hibernate, Derby in memory java database, Swing destop App. After annotating my Model classes and specifying the derby driver and such trivia in XML files, persistency was all automagic.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文