Java Reference
In-Depth Information
<<interface>>
PlaceOrderTransactionScripts
PlaceOrderTransactionScriptsImpl
<<interface>>
PendingOrderDAO
<<interface>>
RestaurantDAO
PendingOrder
DAOImpl
Restaurant
DAOImpl
Figure 10.6
EJB 3 version of the
PlaceOrderTransactionsScripts
DataSource
important that the queries be optimized. To implement efficient paged queries,
there are several features that a persistence framework must provide. Let's see
how EJB 3 does.
First, the persistence framework must allow you to configure eager loading in
order for a query to retrieve related objects using a single SQL SELECT statement.
In this respect EJB 3 does well because it lets you configure eager loading. The
only limitation is that dynamically configuring eager loading can be difficult for
the reasons we outlined in section 10.1.2.
Second, the persistence framework should support SQL queries, which are
sometimes necessary in order to get good performance. EJB 3 also supports SQL
queries, which are useful when a query must use database-specific SQL features to
be efficient. SQL queries can be statically defined in the O/R metadata or dynami-
cally created by the application. A query returns a result set that can contain a
mixture of entities and scalar values.
Search WWH ::




Custom Search