ObjectExtender User's Guide and Reference

Using converters

There may be times when you need to convert data being read from the database and being stored to the database. An example of this would be converting a character to a Boolean. In the database, a value may be stored as 'Y', but when it is retrieved, it may be converted to the Boolean object true and vice versa. There are many different types of converters that may be used, for example, VapCharToBoolean, VapCharToString, and so on. You may also create your own converter by subclassing from VapAbstractConverter.

The steps for using a converter are as follows:

  1. Launch the Schema Browser.
  2. Select a schema from the Schemas view.
  3. Select a table from the Tables view.
  4. Select Edit Table from the Tables menu.

    This opens the Table Editor.

  5. Select an existing column to edit from the Table columns view, and click on Edit.

    This opens the Column Editor.


    Figure pgs2s not displayed.

  6. Select the desired converter from the Converter list.
  7. Select OK.

Various vendor database drivers treat single-character data differently. Some will return a Character, some will return a String of length one. To be sure, if an application may run with multiple drivers, type Char(1) fields as Strings, and use the VapCharToString converter. It will guarantee that a String will always be returned.


[ Top of Page | Previous Page | Next Page | Table of Contents | Index ]