Oracle TopLink Developer's Guide
10g Release 3 (10.1.3) B13593-01 |
|
![]() Previous |
![]() Next |
In TopLink, you execute most queries using the Session
API summarized in Table 96-2.
Table 96-2 Session Methods for Executing a Query
Query Type | Session Method | Advantages and Disadvantages |
---|---|---|
|
|
Advantages: the most convenient way to perform common data source operations on objects. Disadvantages: less control over query execution and results; less efficient for frequently executed queries. |
|
|
Advantages: greatest configuration and execution flexibility; can take advantage of named queries for efficiency. Disadvantages: you must explicitly create and configure |
|
|
Advantages: convenient way to directly apply an action to unmapped data. Disadvantages: least control over query execution and results; your application must do more work to handle raw data results. |
Note: Oracle recommends that you perform all data source operations using a unit of work: doing so is the most efficient way to manage transactions, concurrency, and referential constraints. For more information, see "Understanding TopLink Transactions".Alternatively, you can execute queries outside of a unit of work using a session API directly, but doing so places greater responsibility on your application to manage transactions, concurrency, and referential constraints. |
TopLink executes DescriptorQueryManager
queries when you execute a session query. For more information, see "Descriptor Query Manager Queries".
You execute EJB finders when you call the appropriate finder method on an EJB. For more information, see "EJB Finders".
WARNING: Allowing an unverified SQL string to be passed into methods (for example: |
For more information, see the following: