是否可以在 JPA/EclipseLink CriteriaQuery 中包含数据库视图?
我正在开发一个项目,需要能够在 H2 数据库中创建动态查询。这还包括带有内置 H2 逻辑、表格和触发器的全文搜索。
我一直在试图弄清楚如何将全文搜索添加到我的 CriteriaQuery 中,但一直遇到障碍,即所使用的表不是我的模型中的实体。我可以将它们添加为实体,但我不希望在创建新数据库文件时由 EclipseLink 自动创建它们,因为 H2 中有一个函数可以创建表并执行其他必要的内务处理。
我尝试过创建视图来查询全文表的路径,以便以我需要的格式提供我需要的信息。但我仍然遇到同样的问题,即该视图不是实体。
有人以前遇到过这种情况和/或找到解决方法吗?
谢谢!
I am working on a project that needs to be able to create dynamic queries into an H2 database. This also includes a full text search with built-in H2 logic, tables, and triggers.
I have been trying to figure out how to add that full-text search into my CriteriaQuery but keep running into the road block that the tables used aren't entities in my model. I could add them as entities, but I don't want them created automatically by EclipseLink when a new database file is created since there is a function in H2 that creates the tables and does other necessary housekeeping.
I had tried the path of creating a view to query the full text tables to give me the information I need in the format I need. But I still keep running into the same problem that that view is not an Entity.
Has anyone encountered this situation before and/or figured out a way around it?
Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论