In reference to Huy's question, and John's earlier answer,  I think there
are some issues between my standalone Torque setup, and the torque setup
that comes bundled with the TDK...  I ended up massaging my copy of Torque
to better create the XML schema.xml files from schema.sql files that are
generated from MS SQL Server.  So, when I use that copy of Torque's
Object.vm file to generate my OM .java classes, all the package statements
are wrong to make it compile under the torque in the TDK.

I think I need to download the source of the TDK to get the source of the
torque code that works best with the TDK, versus the standalone Torque! ;-)

When looking through the Object.vm file that I got by downloading torque by
itself, I noticed that for every object, it has a private static final peer
called peer, and a method getPeer()...  So hopefully that might help solve
your problem...  If you need the exact .vm code, I can send it to you, email
me directly.

In answer to John's response...  I looked through the Object.vm code, and
saw the addGetByNameMethod setting...  It was marked as false, so I changed
to it true...  I also found the code in Object.vm.  Of course, this was
after I hacked in a crummier version of the same thing..  Ah well, live and
learn...

Thanks for the help!
ERic

-----Original Message-----
From: Huy Do [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, October 09, 2001 10:59 PM
To: [EMAIL PROTECTED]
Subject: RE: BaseObject getByName question...


Hi,

Can someone tell me the easiest way i can get the
name of a peer object which corresponds to a given table name.

Many Thanks

Huy

> -----Original Message-----
> From: Pugh, Eric [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, 10 October 2001 2:31 AM
> To: '[EMAIL PROTECTED]'
> Subject: BaseObject getByName question...
>
>
> Hi,
>
> I am trying to create a .vm file where based on a Vector of
> columnMaps, and
> my original OM Object, I display a table cell with a form
> element, and pull
> out of my OM object the corresponding data...
>
> I am basing my work on just tweaking the newapp application, and the
> velocimacro I am using is fromCell TableDescription TableName Data.
>
> My actual code looks like this:
>
> #foreach($column in $columns)
>       <TR>
>               #formCell($column.columnName $column.columnName
> $entry.getByName("$column.columnName"))
>       <TR>
> #end
>
> And all of this works great once I wrote my own getByName()
> method for my OM
> object.  How come this method is declared by BaseObject, but is not
> implemented by the default Torque OM building system?  It seems
> that if the
> BaseObject declares it (and throws an exception if you call it), then the
> default Torque OM building system should provide the method?
>
> Or is there another way of doing what I want?  I tried doing this:
> $entry.({$column.columnName}) but that doesn't seem to be proper velocity
> syntax.
>
> Before I go and tweak my Torque code to create the method getByName in all
> the BaseOm objects, I wanted to make sure this was something that isn't
> already in there.  How do I contribute back this code if anyone wants it?
>
> Eric
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to