velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jon Stevens <>
Subject Re: pull model design pattern question
Date Thu, 13 Sep 2001 01:15:56 GMT
on 9/12/01 5:25 PM, "Lane Sharman" <> wrote:

> what about a method to provide the field list as well? does that exist?
> -lane

Duh. Of course.

Here is an example of the generated code within Scarab's class
(which represents a table called "SCARAB_WORD").

     * Generate a list of field names.
    public static synchronized List getFieldNames()
      if (fieldNames_ == null)
        fieldNames_ = new Vector();
      return fieldNames_;

There are actually several methods to deal with this, including methods to
retrieve the data stored in the BO object based on field (ie: column) name.

Before you ask more questions about what Torque methods get generated, go
download Scarab, build it and take a look at the generated code. It gets
generated into:


Lastly, Torque's generated Java code is based on the execution of Velocity
templates to output Java code. You can modify these yourself and add
whatever helpful methods you need to the Base objects.



View raw message