Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 5.3

In order to generate code based on a database table, the template has to somehow know about the database table. This means supplying metadata through a property that refers to the table. Fortunately, CodeSmith Generator includes the SchemaExplorer library, which contains a rich set of types designed specifically for interacting with databases. One of these types, TableSchema, allows the user to pick a table from a database. You can then use the object model in the SchemaExplorer library to retrieve just about any information you need about the table and the database. Here's the Property directive that we need:

Code Block
languagehtml/xml
<%@ Property Name="SourceTable" Type="SchemaExplorer.TableSchema" Category="Context" Description="Table that the Web service will access." %>

...