JDO2.0 query language features _ MySQL

Source: Internet
Author: User
The improvement of the query language is an important part of the JDO2.0 specification. This article describes some new functions provided by JDO2.0 from a higher level. As the JDO2.0 specification has not yet entered the public draft state, nothing has been finalized yet, and everything may be subject to changes. However, JDO2.0 will soon enter the final stage, and the query feature mentioned here is the JDO2.0 Expert Group

The improvement of the query language is an important part of the JDO2.0 specification. This article describes some new functions provided by JDO2.0 from a higher level. As the JDO2.0 specification has not yet entered the public draft state, nothing has been finalized yet, and everything may be subject to changes. However, JDO2.0 will soon enter the final stage, and the query feature mentioned here is that the JDO2.0 Expert Group (Translator's note: David Jordan is an important member of the expert group) takes the most time and is relatively stable. Therefore, I have enough reason to believe that the final specification will be basically consistent with the description here.

If you think this article misses some important features, it is recommended to go to the JDO Forum immediately (http://www.jdocentral.com/forums/index.php? Showforum = 10. Here, we would like to thank Craig Russell, the leader of JDO2.0 standards, for authorizing me to publish the new features of these JDO2.0 query languages.

Query result

You can create A query for Class A, reference it to class B through contains (), reference it to class C through another layer of contains (), and then use A ". class D. However, the returned collection only contains the object instance of Class A. If you want to obtain other classes from the result, you must use the reference of Class A to obtain relevant other class objects one by one. If your query conditions contain constraints of Class B, class C, or Class D, when other class objects are referenced through Class A objects in the result set, you must repeat these constraints in Java code. that is to say, you have to declare the constraints repeatedly in Java and JDOQL. Furthermore, you may only care about class D objects that meet the query conditions, rather than creating class B and Class C objects in the middle by the JDO underlying layer to save memory or related resources.

In JDO2.0, you are no longer bound to these restrictions. You can return:

One or more fields of the data Class (PersistentCapable)
Other class objects other than candidate classes

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.