Add User-Defined Methods

You can define your own methods in a Data Access Builder session and code will be generated for them. The method is added to the generated classes for a mapping. Do the following steps to add a method:

  1. From the Data Access Builder window, open the Methods or Manager Methods window to add a user-defined method:
    1. Select the mapping icon to which you want to add the method.
    2. Select either Methods or Manager Methods from the icon's popup menu. Data Access Builder generates <class> classes that provide database access to handle a single object and it generates the <class>Manager classes to handle a collection of objects (returns a result set). If you want to add your method to the <class> class, select Methods. If you want to add your method to the <class>Manager class, select Manager Methods.
    3. Either in the Methods window or the Manager Methods window is opened for you to add the method.
  2. Indicate whether your method is specified with a customized SQL statement, as a stored procedure call, or with an SQL predicate.
    1. In the Methods window or Manager Methods window, click Add under the appropriate container to indicate the method that you want to add. For example, click Add under the Customized SQL Statement container when you want to add a method by typing the SQL statement for it.
    2. A window is opened for you to add your method.
  3. Perform the steps in one of the following user-defined methods:
    1. Add User-Defined Methods with Customized SQL Statements
    2. Add User-Defined Methods That Are Stored Procedure Calls
    3. Add User-Defined Methods with SQL Predicates
  4. Click Close to close the Methods or Manager Methods window.

When you generate code for the mapping, the method you have defined will be included in the appropriate class.



User-Defined Methods


Modify User-Defined Methods
Delete User- Defined Methods
Copy User-Defined Methods


Support for Non-Nullable Columns with Default Values