Summary


Queries are very important for applications that use persistent storage. In JDO, the Query interface retrieves results based on criteria expressed in JDOQL. The syntax of JDOQL is simple. It is similar to Java and uses the field names of the application data classes in its query terms. Although less powerful than SQL, JDO can express most search criteria.

JDO hides the query interface and query language of the datastore. When an application programmer uses JDBC, he is bilingually working simultaneously with Java and with SQL. He also works with two state models, the persistent object model expressed in the Java code and the data model expressed in the relational schema. When working with JDBC, the application programmer must translate between the two models and the two languages. On the other hand, when working with JDO, the programmer works with two dialects of the same language, Java and JDOQL. When coding, the only model that he needs to consider is the object model. By focusing exclusively on the persistent object model, JDO's query service helps application programmers achieve clarity of design and simplicity of code.

The query service is an important exposed component of JDO's persistence service. Many of the other exposed services of JDO are found in the PersistenceManager interface. The next chapter describes the properties and operations of this interface.




Using and Understanding Java Data Objects
Using and Understanding Java Data Objects
ISBN: 1590590430
EAN: 2147483647
Year: 2005
Pages: 156
Authors: David Ezzio

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