#33 set/get method for last field in deep-chain



A bug has been opened (number 1441312) and recently
deleted on this subject.

The problem can be explained with the following mapping :

<B theSetMethod="addAddress"

In this example, the custom set method is supposed to
be defined for the "addresses" attribute (this is the
way we interpreted it) and no custom methods can be
defined for the society attribute.

As Franz said in the bug 1441312 comments, there is no
way to detect if a custom set or get method has been
defined for the intermediate attributes of the
deep-mapping (only "society" here). So for those, only
standard javabean accessors can be accepted.

Currently, mixed deep-mapping and custom set methods is
not allowed (it does not works).

Is it possible to accept set/get methods on a
deep-mapping field and use these methods only for the
last attribute of the deep-field chain of attributes
(all intermediate attributes must then respect javabean
rules for get/set methods) instead of prevent the mix ?

Such a rule would be sufficient for us.




  • seb

    seb - 2006-05-02

    Logged In: YES


    i'm currently testing the 2.2 release of Dozer. There's so
    much features : i really can't use them all in one project :)
    But in fact, i'm really waiting for the feature above ...
    Because of our home-made framework, we're really going to a
    dead-end without it ! :'(

    Seb, waiting for the next release ;)

  • Franz Garsombke

    Franz Garsombke - 2006-05-02

    Logged In: YES

    For you Seb...anything. How about I add this feature in the
    next day or so and I can get you an unofficial release...?


  • Franz Garsombke

    Franz Garsombke - 2006-05-02
    • assigned_to: nobody --> fgarsombke
  • Franz Garsombke

    Franz Garsombke - 2006-05-03

    Logged In: YES

    Will this fix work. We use the property descriptors in the
    deep hiearchy. In this example if you have a setMethod
    called setCustom() and a get method called getCustom() you
    will be ok. The actual attribute can be named anything.


    Let me know if this will help. If not...it might be pretty
    painful to implement since we deal in property descriptors
    and not attributes at the deep level.

  • seb

    seb - 2006-05-03

    Logged In: YES

    Hi Franz,

    i'm already ok for an unofficial release ;)
    Your last fix doesn't work for me, because i'm using a
    custom setMethod (called addXXX), which is also iterative !
    You can take a look at the example provided by Richard.
    Do you want a class diagram ?

    See you

  • Franz Garsombke

    Franz Garsombke - 2006-05-03

    Logged In: YES

    So...I got this working with a custom set method/iterate. I
    did not have time to get a custom get method working.

    Here is what the mapping looks like:

    <b set-method="setCustom"

    I have attached the jar. Let me know how it works.

  • seb

    seb - 2006-05-04

    Logged In: YES

    Well...I tried with the attached jar and here are my
    conclusions :
    * it seems to be ok that with one level (like in your example)
    * it crashes if there's two levels (in your example, replace
    description.customSetGetMethod with
    * there's maybe something else to lookout in our framework
    ... we're not using standard JavaBeans, and I think there's
    something wrong with this ...

    I can send you a little Java project (under Eclipse) with my
    tests if you want.

    Thx for all

  • Franz Garsombke

    Franz Garsombke - 2006-05-05

    Logged In: YES

    Send your eclise project along and I will try to get to the
    bottom of this. Do I need to know French? :)

  • Matt Tierney

    Matt Tierney - 2006-11-13
    • assigned_to: fgarsombke --> mhtierney
  • Matt Tierney

    Matt Tierney - 2007-04-01

    Logged In: YES
    Originator: NO

    This has been fixed. It resulted as a side effect of some recent property descriptor cleanup.

  • Matt Tierney

    Matt Tierney - 2007-04-01
    • status: open --> pending
  • Matt Tierney

    Matt Tierney - 2007-04-04
    • status: pending --> closed

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

No, thanks