Menu

map between different objects and variables

Help
2007-07-13
2013-04-25
  • Erik Romson

    Erik Romson - 2007-07-13

    Hi,
    Thank you for this superb tool. I'm probably blind but what I have found so far is the javadoc and the junit tests as documentation, and there aren't that many junit tests.

    I'm looking into using it as

    db <-> server w hibernate <-> GWT
                              <-> J2ME

    Especially with J2ME I'll need to convert lists to arrays. I need to have one set of classes for hibernate and another for J2ME. But I cannot understand how to map certain members in specific classes, when copying classes (with references). I get CustomTransformer to work OK but it triggers on class type and not member name.

    Regards
    Erik Romson

     
    • Hanson Char

      Hanson Char - 2007-07-13

      Sorry about the spare doc and junit tests.  They are long over due on my to do list.

      >I get CustomTransformer to work OK but it triggers on class type and not member name. 

      Interesting.  I will look into providing more contextual information for the CustomBeanTransformerSpi.

      >I'll need to convert lists to arrays

      Have you looked into the CollectionReplicatorSpi to see if it's applicable ?  If so, you can replace it with your own via the SPI BeanTransformerSpi.initCollectionReplicatable(...).  (Note BeanTransformer implements the BeanTransformerSpi.)

       
      • Hanson Char

        Hanson Char - 2007-07-13

        >I will look into providing more contextual information for the CustomBeanTransformerSpi.

        I've checked in the enhancement to SVN, now providing a PropertyInfo object which provides the custom transformer with access to the propertyName as well as the fromBean and toBean of the property being transformed.

        Will do a beta7 release hopefully sometimes before next week.

         
        • Joe D. Velopar

          Joe D. Velopar - 2007-07-14

          Beta7 has been released at Sourceforge.  Request has been made for maven upload:

            http://jira.codehaus.org/browse/MAVENUPLOAD-1642

          Cheers

           
        • Erik Romson

          Erik Romson - 2007-07-14

          Amazing!! you guys are responsive, I almost believe that also live in Norway (the rainiest summer for 128 years...).

           
    • Erik Romson

      Erik Romson - 2007-07-13

      Thank you for your fast reply!!

      About docs and junit tests: You get what you pay for... I was just wondering if I have missed some resource of information.

      CustomTransfer:
      It was just my gut feeling that I needed that kind of control, but perhaps not. Nevertheless if it is possible to send along the member name , I suppose that debugging will be more easy (conditional breakpoints etc)

      CollectionReplicatorSpi:
      Yes that will probably do and then the ArrayTransformerSpi to go back!?

       
      • Hanson Char

        Hanson Char - 2007-07-13

        >the ArrayTransformerSpi to go back!?

        Correct.  If you decided to plug in your own impl for these Collection and Array Transfermer SPI, in essense you would be taking over the implementation.  You can look into the existing (ie default) implementation as a reference.

         

Log in to post a comment.