JPA,查询提示是特定于供应商的吗? [英] JPA, are query hints vendor specific?

查看:108
本文介绍了JPA,查询提示是特定于供应商的吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否存在可以使用的JPA(供应商中立)查询提示?在我的Google搜索查询提示的过程中,每次提到它都是针对特定供应商的查询提示.

Are there JPA - vendor neutral - query hints that can be used ? During my google searches on query hints every mention of it has been a vendor specific query hint.

文档:

设置查询属性或提示.提示元素可用于 指定查询属性和提示.由此定义的属性 提供者必须遵守规范.供应商特定提示 提供程序无法识别的内容必须被静默忽略. 可移植应用程序不应依赖于标准超时提示. 取决于正在使用的数据库和使用的锁定机制 提供者,此提示可能会或可能不会被观察到.

Set a query property or hint. The hints elements may be used to specify query properties and hints. Properties defined by this specification must be observed by the provider. Vendor-specific hints that are not recognized by a provider must be silently ignored. Portable applications should not rely on the standard timeout hint. Depending on the database in use and the locking mechanisms used by the provider, this hint may or may not be observed.

我不确定我是否正确理解了这一点.这是否意味着有供应商中立的查询提示或没有?如果是这样,我在哪里可以找到描述这些内容的列表?

I'm not sure I'm understanding this correctly. Does this mean that there are vendor neutral query hints or there are not ? If so where can I find a list describing those ?

推荐答案

根据Eclipse网站上的文章(

According to the article found on Eclipse's website (http://www.eclipse.org/eclipselink/documentation/2.6/concepts/queries006.htm) query hints are vendor specific.

Eclipse指出:查询提示的定义是特定于供应商的.以下各节描述了JPA查询提示和EclipseLink查询提示"

Eclipse states that: "The definitions of query hints are vendor-specific. The following sections describe JPA query hints and EclipseLink query hints"

本文继续介绍两种查询提示(JPA和EclipseLink)的具体实现细节.

The article continues with specific implementation details for the two types of query hints (JPA and EclipseLink).

在Apache网站上进行的进一步研究( http: //openjpa.apache.org/builds/2.3.0/apache-openjpa/docs/manual.html#jpa_hints_named )似乎确认查询提示是特定于供应商的.

Further research on Apache's website (http://openjpa.apache.org/builds/2.3.0/apache-openjpa/docs/manual.html#jpa_hints_named) seemed to confirm that query hints are vendor specific.

第1.8节查询提示...

Section 1.8 Query Hints...

无法被特定数据库处理或OpenJPA不知道的提示.OpenJPA已知但提供了不兼容值的提示将导致抛出IllegalArgumentException."

"Hints which can not be processed by a particular database or are unknown to OpenJPA are ignored. Hints known to OpenJPA but supplied with an incompatible value will result in an IllegalArgumentException being thrown."

基于我已阅读的内容以及您在问题中所链接的内容,我认为不存在与供应商无关"的查询提示.预期的行为是,如果供应商不支持指定的查询提示,它将被忽略.

Based on what I've read and what you have linked in the question, I do not believe that there are "vendor-neutral" query hints. The expected behavior is that if a vendor does not support the query hint specified, it will simply be ignored.

这篇关于JPA,查询提示是特定于供应商的吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆