Custom SQL Queries

Use to create custom SQL queries for the TopLink descriptor.

Insert
Generates the insertObject() method of the Session class.
Update
Generates the updateObject() method of the Session class.
When customizing a descriptor's update string if the application uses optimistic locking, you must ensure that the row is not written if the version field has changed since the object was read. Also, the update string must increment the version field if the row is written. In addition, the update string must maintain the row count of the database.
Delete
Generates the deletebject() method of the Session class.
Read
Generates the readObject() method of the Session class
Customizing a descriptor's read-object query works only for the version of the readObject() that takes a primary key expression as a parameter. If other expressions are used, TopLink generates dynamic SQL. You can define additional named queries for other read-object queries.
Read All
Generates the readAllObjects() method of the Session class.
Customizing a descriptor's read-all query works only for the version of the readAll() that takes the class as a parameter-not the version that takes the class and an expression. As a result, the query reads every single instance. You can define additional named queries for other read-all queries.


Note: The TopLink Mapping editor does not validate the SQL code that you enter. The code is defined by the specific database type.


Related Topics

Setting Descriptor Information
Working with Descriptor Properties

 

Copyright © 1997, 2004, Oracle. All rights reserved.