This page last changed on Mar 11, 2008.
eDocs Home > BEA AquaLogic Data Services Platform Documentation > Data Services Developer's Guide > Contents How To Add Update Map ProceduresThis topic describes how to add a create, update, or delete procedure to a logical entity service. OverviewIn a logical entity service, you can add create, update, and delete procedures (called update map procedures) that act on underlying data sources. A procedure is an operation that can have side effects, for example, a create procedure that adds a new record to a database table and returns a key value. You can create update map procedures visually in Studio and have the framework generate XQuery pragma statements and source code, or you can write the source code directly in XQuery or XQSE. The XQuery pragma statement looks something like this: (::pragma function <f:function kind="create" visibility="public" isPrimary="true" xmlns:f="urn:annotations.ld.bea.com"> This statement defines a create procedure, with public visibility, that is primary. Even though the pragma statement uses the keyword function, the operation you define is a procedure, as you can see from the declaration: declare procedure cus:createCustomerAndAddress($arg as element(cus:CustomerAndAddress)*) as element(cus:CustomerAndAddress_KEY)\* external; This line declares the procedure with the name createCustomerAndAddress, defines one argument with the service's return type, and specifies a key as a return value. Generate Default ProceduresWhen you generate default update map procedures, they have these parameters and return values:
Before you create update map procedures, especially create procedures, add a key to your service. A primary create procedure must return a key. Primary update and delete procedures require the Return type as an argument; their non-primary equivalents can be written to accept a key instead. To generate a default update map procedure:
Design Custom ProceduresYou can also create procedures with the arguments and return types you choose. This is useful for procedures in addition to the primary create, update, and delete procedures. To design custom procedures:
See AlsoConceptsHow Tos
|
![]() |
Document generated by Confluence on Apr 28, 2008 15:57 |