Documentation Archive Developer
Search
PATH  Documentation > WebObjects 4.5 > EOF Tools and Techniques

Table of Contents Previous Section

Assigning a Stored Procedure to an Entity

You can assign stored procedures to entities to be used to perform the following operations:

If you associate a stored procedure with an entity's operation, the Framework invokes it automatically when the operation occurs. For example, if you want to use a stored procedure to insert new Customer objects:

  1. Define the stored procedure in the database.

  2. Define the stored procedure in the model as described in the previous section.

  3. Associate the stored procedure with the Customer entity's insert operation.
You can associate a stored procedure with an entity using EOModeler or you can do it programmatically (see the chapter "Answers to Common Design Questions" in the book Enterprise Objects Framework Developer's Guide).

To assign a stored procedure to an entity in EOModeler:

  1. Select the entity with which you want to associate a stored procedure.

  2. Open the inspector.

  3. Click the Stored Procedures Inspector icon.

  4. Type the name of the stored procedure in the field associated with the appropriate database operation.

    Figure 39. The Stored Procedure Inspector

Requirements for Framework-Invoked Stored Procedures

When Enterprise Objects Framework invokes a stored procedure for an operation, the procedure must behave in an expected way. The Framework specifies what a stored procedure's arguments, results, and return values should be. For more information on these requirements, see the chapter "Answers to Common Design Questions" in the book Enterprise Objects Framework Developer's Guide.

Table of Contents Next Section