Menu

#24 Convert Tables and Structures

Release 1.2.0
closed
7
2014-12-19
2011-03-10
No

Hibersap converters are currently just working with primitive fields. If I want to convert a table or structure parameter, Hibersap has to know to which structure type the JCo structure has to be converted. The converter can then do user-defined mapping from this structure type to another type.

E.g.

@Table
@Parameter("CUSTOMER_DATA")
@Convert(converter = CustomerDataAggregator.class, structureType = CustomerDataLine.class)
private CustomerDataAggregated customerData;

In the example, the converter's responisbility is to aggregate data from the BAPI table and put it into a single object.

Discussion

  • Carsten Erker

    Carsten Erker - 2011-06-13
    • priority: 5 --> 7
     
  • Carsten Erker

    Carsten Erker - 2012-05-31

    Maybe it would be better to pass a Map (for a structure parameter) or a List of Maps (for a table parameter) to the convert methods, thus there is no need of an intermediate object like CustomerDataLine in the example.

    At least this could be the default when no structureType property is set on the annotation.

     
  • Carsten Erker

    Carsten Erker - 2012-09-11
    • milestone: --> Next Release
    • assigned_to: nobody --> cerker
    • status: open --> pending
     
  • Carsten Erker

    Carsten Erker - 2014-12-19
    • status: pending --> closed
     
  • Carsten Erker

    Carsten Erker - 2014-12-19

    moved to github tracker

     
MongoDB Logo MongoDB