In brief, use the Schema Browser to define a schema. The Schema Browser handles descriptions of tables, their columns, and key (primary and foreign) definitions.
Creating schemas. To create a schema:
Creating tables and columns. To create a table for your schema:
Select a column(s) to be the Primary key and click the double arrow (>>).
Using Converters. A converter is used to change a class attribute type into another type before storing to the database. When reading from the database, the converter will change a particular database type into the correct class attribute type. For example, if you have a class attribute that has a Date type and the database column has a SQL type of DATE, no converter is needed. However, if you wanted to take this same class attribute and store it in a database column of SQL type VARCHAR, a converter is necessary because the class attribute of Date does not map directly to this SQL type.
The default converter used for fixed character columns is the VapTrimStringConverter. This converter truncates spaces from the end of the column value. If an object's identifier contains this column, object cache lookup is done with the truncated value, thus eliminating the chance of false cache hits or multiple cache entries. The drawback of this scenario is the key derived from a relating object will have a truncated value, and the resulting query will not find the appropriate rows in the database. Changing the converter to VapConverter will solve the later problem, but you must be aware of trailing spaces that become significant in object lookups.
Exporting schemas. Once your schema is defined, and saved, you will export the schema to the database. Note that the column name used for constraints uses the physical name.
You can wait to do this step until you are really ready to use the database. This is done as follows:
Saving schemas. Save your schema definition to an application and storage class that you supply. Saving your schema enables you to take advantage of the existing library management functions. These functions are the same ones you use when sharing code with other developers such as versioning, releasing, and loading different editions of an application.
Suggestion: A useful naming convention is to name your application as follows: XYZMetadataApp where the XYZ is some prefix you choose. Use this application to store a model, schema, and map for a given application.
Recommendation: Save the schema definition to an application different from the generated model calsses.