No. I'm using it correctly. Maybe I said it wrong but I don't think so :-) I want the properties in UserEntity that correspond to the properties in User (a UserEntity subclass) copied onto the User. User *is* my intended destination. UserEntity is my source.
What's happening is a Map that part of User (but not UserEntity) IS IN FACT getting overwritten in the call to copyProperties(). It's getting blown away in the same fashion it would be if the User() constructor was called. Making sense now? > -----Original Message----- > From: Joe Germuska [mailto:[EMAIL PROTECTED] > Sent: Sunday, March 13, 2005 3:03 PM > To: Joe Hertz; 'Struts Users Mailing List' > Subject: RE: BeanUtils hates me... > > At 2:33 PM -0500 3/13/05, Joe Hertz wrote: > >That's the behavior I'd expect too. This did work at one point. No, it's > not > >unintuitive. Least not for C programmers :-) > > > >But I've got smoking gun evidence though that's not what's happening. I'm > >now wondering what's happening in these setters... > > > >Tx for making sure I wasn't spacing. > > um. maybe you are? ;-) > > You wrote: > > > >I call PropertyUtils.copyProperties(user, userEntity) and I'm > watching a > >> map > >> >that was an element of the user object (and not of the userEntity) > >> getting > >> >blown away (almost as if the User Object itself was getting > > > reconstructed). > > I wrote: > > > So, by your example, user should be having all its properties set > > > according to their equivalent values in userEntity. > > user is having its properties set -- it is getting reconstructed -- > because you have it in the first position, the "destination" position. > > If you want to populate the UserEntity, you should use > > PropertyUtils.copyProperties(userEntity, user) > > which is the opposite of what you're saying that you are using. > > Joe > > -- > Joe Germuska > [EMAIL PROTECTED] > http://blog.germuska.com > "Narrow minds are weapons made for mass destruction" -The Ex > > --------------------------------------------------------------------- > 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]