db-torque-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Darrell B <wi...@rogers.com>
Subject I need clarification
Date Tue, 20 May 2003 21:10:29 GMT

This would be handy for my use since it is the forms data of my struts 
project that I want to forward to the torque data objects.

I took this from the Peers-Howto but I am not sure of the line 
Where is this ParameterParser object and RunData? It isn't located in 
the torque api.

I saved the best for last. Say that you want to create a new database 
entry from an html form. You can use the ParameterParser object (see the 
getParameters method of RunData in the api docs) to automatically fill 
in your fields. All that you need to do is to give your html form fields 
the same name as the corresponding property in the generated Data 
Object. For example a database field ITEM_ID will cause the generated 
Data Object to have getItemId and setItemId methods. Here the property 
name is ItemId, so that should be the form field name. Then you can have 
code like this:

Item itm =  new Item()
data.getParameters().setProperties(itm); ???
Object o = ItemPeer.doInsert(itm);

Darrell Bechtel,  B.G.S., MCSE

Systems Manager
Metokote Corporation of Canada
1011 HomerWatson Blvd.
Kitchener, Ontario
Ph: (519)669-0559

View raw message