如何读取 JPA 实现使用的架构

发布于 2024-09-26 06:16:28 字数 179 浏览 0 评论 0原文

我的 EntityManager 使用的持久性单元使用由我们的 Websphere 配置提供的数据源。 DS 配置包括要使用的特定于环境的数据库。

EM 成功使用了此模式,但我无法找到记录或显示正在使用的模式的方法。我觉得 em.getCurrentSchema 之类的东西可以使用。

任何帮助都会很棒,谢谢。

My EntityManager is using a persistence unit that uses a data source provided by our Websphere configuration. The DS configuration includes an environment specific DB to use.

The EM successfully uses this schema, but I can't figure out a way to log or display the schema being used. I was thing something like em.getCurrentSchema would be available..

Any help would be great, thanks.

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

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

发布评论

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

评论(1

仅冇旳回忆 2024-10-03 06:16:28

没有 API 可以执行此操作(在 JPA 中)。您可以通过 JDBC 并使用 DatabaseMetaData 来完成此操作。

JPA 旨在提供数据的对象视图并简化这些对象的持久性,而不仅仅是向用户呈现数据存储细节。

No API to do this (in JPA). You could do it via JDBC and use of DatabaseMetaData.

JPA is to provide an object view of the data and ease persistence of those objects, not to just present datastore specifics to the user.

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