You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@commons.apache.org by Marco Mistroni <mm...@waersystems.com> on 2004/04/28 13:39:28 UTC

MutableDynaClass question

 
Hi all,
            I am trying to use some of beanutils package classes for
getting]
Data from a database (I plan to use the ResultSetDynaClass as well as
MutableDynaClass . I have
Some DTOs to populate and some of the methods don't match exactly the
column name..)
 
But I read in the APIDOC following
 
WARNING - No guarantees that this will be in the final APIs ... it's
here primarily to preserve some concepts that were in the original
proposal for further discussion.
 
So, are there any news about that? If this interface is not going to be
in th final API, is there a way (other
Than hardcoding) that I can populate a DTO from a DynaBean obtained from
ResultSetdynaClass where
The column name is different from the DTO method (e.g.  setContactRef
for column contact_ref)?
 
Thanx in advance and regards
            marco

Re: MutableDynaClass question

Posted by Pedro Salgado <sa...@04web.com>.
  Have you looked at javax.servlet.jsp.jstl.sql.Result?

  This is what is used on the sql taglib and is easier to make what you
want.
  Carefull though, the names of the fields on the Result are equal of those
on the database => therefore there is some coupling between the presentation
layer (in your case the DTO fields may not be populated) and the database if
you change a database field.

  A better approach would be a persistence layer, don't you think?
  OJB, Torque are good and can save you precious time just by using them...
not to mention that it also helps ensure the overall quality of the
deliverables and you can also save money (you can use a MySQL database to
develop and deploy on a SQL Server - this must be done with care).

Regards,

Pedro Salgado
> 
> -----Original Message-----
> From: Marco Mistroni [mailto:mmistroni@waersystems.com]
> Sent: Wednesday, April 28, 2004 4:39 AM
> To: commons-user@jakarta.apache.org
> Subject: MutableDynaClass question
> 
> 
> Hi all,
>           I am trying to use some of beanutils package classes for
> getting]
> Data from a database (I plan to use the ResultSetDynaClass as well as
> MutableDynaClass . I have
> Some DTOs to populate and some of the methods don't match exactly the
> column name..)
> 
> But I read in the APIDOC following
> 
> WARNING - No guarantees that this will be in the final APIs ... it's
> here primarily to preserve some concepts that were in the original
> proposal for further discussion.
> 
> So, are there any news about that? If this interface is not going to be
> in th final API, is there a way (other
> Than hardcoding) that I can populate a DTO from a DynaBean obtained from
> ResultSetdynaClass where
> The column name is different from the DTO method (e.g.  setContactRef
> for column contact_ref)?
> 
> Thanx in advance and regards
>           marco
> 
> 
> ---------------------------------------------------------------------
> 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


RE: MutableDynaClass question

Posted by Daniel Huang <da...@cisco.com>.
I don't see how would a MutableDynaClass help you with the problem?
Can't you just change the getter/setter of your DTO?

Regards,
Daniel

-----Original Message-----
From: Marco Mistroni [mailto:mmistroni@waersystems.com]
Sent: Wednesday, April 28, 2004 4:39 AM
To: commons-user@jakarta.apache.org
Subject: MutableDynaClass question


Hi all,
            I am trying to use some of beanutils package classes for
getting]
Data from a database (I plan to use the ResultSetDynaClass as well as
MutableDynaClass . I have
Some DTOs to populate and some of the methods don't match exactly the
column name..)

But I read in the APIDOC following

WARNING - No guarantees that this will be in the final APIs ... it's
here primarily to preserve some concepts that were in the original
proposal for further discussion.

So, are there any news about that? If this interface is not going to be
in th final API, is there a way (other
Than hardcoding) that I can populate a DTO from a DynaBean obtained from
ResultSetdynaClass where
The column name is different from the DTO method (e.g.  setContactRef
for column contact_ref)?

Thanx in advance and regards
            marco


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