Apache's Torque - any macros or clip libs avalible?

General questions about using TextPad

Moderators: AmigoJack, bbadmin, helios, Bob Hansen, MudGuard

Post Reply
User avatar
davidakoontz
Posts: 8
Joined: Thu Nov 13, 2003 8:36 pm
Location: Arkansas USA
Contact:

Apache's Torque - any macros or clip libs avalible?

Post by davidakoontz »

I've just started to use Apache's Torque (it builds the object-relational mapping Java classes & creates the DB tables - for you).

You have to define the tables via XML files that define the DB schema. Simple but wordy. Are there any macros or clip libs that would help with this stuff? Thanks!!

Here's an example of the file:

Code: Select all

<database
  name="bookstore"
  defaultIdMethod="idbroker">
  
  <table name="book" description="Book Table">
    <column
      name="book_id"
      required="true"
      primaryKey="true"
      type="INTEGER"
      description="Book Id"/>
    <column
      name="title"
      required="true"
      type="VARCHAR"
      size="255"
      description="Book Title"/>
    <column
      name="isbn"
      required="true"
      type="VARCHAR"
      size="25"
      javaName="ISBN"
      description="Book ISBN"/>
    <column
      name="publisher_id"
      required="true"
      type="INTEGER"
      description="Foreign Key Publisher"/>
    <column
      name="author_id"
      required="true"
      type="INTEGER"
      description="Foreign Key Author"/>
    <foreign-key foreignTable="publisher">
      <reference
        local="publisher_id"
        foreign="publisher_id"/>
    </foreign-key>
    <foreign-key foreignTable="author">
       <reference
         local="author_id"
         foreign="author_id"/>
    </foreign-key>
  </table>

... blah, blah, blah
Post Reply