218 Epilogue Imagine a situation where you have

218 Epilogue Imagine a situation where you have a collection of Orders and wish to identify each Product for which more than a designated quantity was ordered on a single OrderLine. Using JDOQL you can filter the original collection of orders to only those that contain individual OrderLines with more than the designated quantity. However, you then have to iterate through the returned collection of Orders, and each Orders collection of OrderLines, to programmatically locate the individual Product instances. This would be easier if a JDOQL query could take one candidate class (Order) and return a collection of a different class (Product) according to the filter criteria. Such functionality, referred to as projection, is expected in a future release. 13.1.3.2 Aggregates JDOQL does not define any aggregate functions (e.g. maximum, count, average, etc.). Queries to determine the maximum value of a persistent field, such as an order number, can be written to return the entire candidate collection in an appropriate sequence (e.g. by orderNumber descending). However, the definition of a maximum aggregate function would be far more flexible. Aggregates are expected in a future release. 13.1.3.3 Additional filter operators It is also likely that the filter operators will be complemented in due course with an operator equivalent to the Java keyword instanceof. This could be used to restrict the result of a query to certain subbranches of inheritance or implementation hierarchies. 13.1.3.4 String-based query definition It is already possible to define a query as a set of strings, as illustrated by the Dynamic Query Window presented in Chapter 8. However, there is no standard for a single string grammar encapsulating all query elements. If such a grammar is defined, JDO query monitors could be written that would accept, compile, and execute queries in this form. For example, the query shown in the Dynamic Query Window in Figure 8.2 (page 144) might be typed into a JDO query monitor as: EXECUTE-NEW-QUERY CANDIDATE com.ogilviepartners.jdobook.op.BusinessPartner IMPORTS com.ogilviepartners.jdobook.op.* VARIABLES Order o PARAMETERS Double searchValue FILTER customer.orders.contains(o) && o.totalValue > searchValue ORDERING name ascending PARAMETER-VALUES 1000;
Note: If you are looking for top 10 and very good webhost to host and run your jsp application check Actions jsp hosting services

Comments are closed.