commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Charles Hudak" <charles.hu...@cardionet.com>
Subject RE: MutableDynaClass question
Date Thu, 29 Apr 2004 20:54:53 GMT
Curiously, I created a dynamic binding framework to handle exactly this
type of situation. In my case, I need to be able to map between Xdoclet
generated DTO's and jaxb generated domain classes that represent the
same abstract domain object. In this case, the method names are usually
the same but the underlying bean properties aren't so copyProperties(..)
doesn't work.

This framework also deals with datatype issues (e.g. mapping a Timestamp
to a Calendar field and vice versa between two beans). There are some
more features that it could support, such as muxing one field in one
bean to multiple fields in another or demuxing multiple fields in one
bean to on in another. An example of where this would come in handy is
if bean A has fields for areacode, phone and extension whereas another
has a single field for the concatenated phone number. We actually have
this issue but decided to work around it at this point rather than
extend the framework.

I'd be happy to send you some code to get you started. It's saved us A
LOT of hardcoded mapping between objects.

-----Original Message-----
From: Daniel Huang [mailto:danihuan@cisco.com] 
Sent: Thursday, April 29, 2004 1:41 PM
To: Jakarta Commons Users List
Subject: RE: MutableDynaClass question


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


---------------------------------------------------------------------
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