commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Marco Mistroni" <mmistr...@waersystems.com>
Subject RE: BeanUtils copProperties with Struts and Torque?
Date Tue, 17 Aug 2004 13:06:02 GMT
Not everything is string...

I am using tecnhnique that you r describing.. (though with hibernate on
backside..)

And I don't have all string fields..

-----Original Message-----
From: Robert Bowen [mailto:syg6@yahoo.com] 
Sent: 17 August 2004 13:28
To: commons-user@jakarta.apache.org
Subject: BeanUtils copProperties with Struts and Torque?

Hello. I am using Torque to generate the persistent
classes for my web application. Torque generates these
classes based on an xml file, in which you specify the
table name, column name and column type.

What I would like to do is use copyProperties() to
copy from an ActionForm directly to my
Torque-generated beans but of course, everything is a
String in the ActionForm world, whereas in my
persistence classes my date fields, for example, are
Dates, not Strings, so copyProperties fails.

I have been looking all over the jakarta web site, the
archives of this mailing list, etc. People seem to be
talking about creating a bean that acts as a
go-between, a DTO I suppose, that has the same fields,
getters and setters as the ActionForm, and that you
first copy the properties to the DTO. 

But ... won't I have the same problem when trying to
use copyProperties? Do I have to somehow use the
ConvertUtils instead?

Any help much appreciated. I am using a single servlet
to instantiate a bean of type 'x', copy the values
from a form and save it in the database, so having to
type 'gets' and 'sets' for every possible case ... is
a waste of time, bad design, etc.

Many thanks!
syg


		
__________________________________
Do you Yahoo!?
Yahoo! Mail is new and improved - Check it out!
http://promotions.yahoo.com/new_mail

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org


Mime
View raw message