Chapter 6. Finding Your Data


"If you can find a path with no obstacles, it probably doesn't lead anywhere ."

Frank A. Clark

The capability to transparently persist object instances directly is a powerful feature; however, it would be incomplete without a mechanism to query and retrieve the information stored in those persistent instances. The JDO specification include a query facility, pieces of which have already been introduced and used in previous chapters. The query facility consists of two parts ”the API that can be used in application code to programmatically locate the information and a query language called JDO Query Language (JDOQL) that defines the grammar associated with structuring the queries. This concept is analogous to how the traditional relational database persistence works in Java. There is an API called JDBC that specifies the programmatic contract and the query language (SQL) that defines the grammar. In this chapter, we look at the query API that the JDO provides as a part of the javax.jdo package, and we also look at JDOQL, its syntax, and how it can be used for specifying meaningful queries.



Core Java Data Objects
Core Java Data Objects
ISBN: 0131407317
EAN: 2147483647
Year: 2003
Pages: 146

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net