Menu

#20 Extend Converter methods to pass field meta data

Release 1.2.0
closed
nobody
5
2014-12-19
2010-10-09
No

Extend the methods of Hibersap converters to pass field meta data (extracted from JCoField) as additional parameters.

Thus, the Converter could do conversions according to the SAP field's characteristics, e.g. the length of a field:

public Object convertToSap( FieldMetaData metaData, Object javaValue )
{
int fieldLength = metaData.getLength();
String value = (String) sapValue;
return addLeadingZeroes(value, fieldLength);
}

This would convert a number from a representation without leading 0's to the SAP representation with
leading 0's when passing the value Java to SAP: 40000345 -> 00040000345

Discussion

  • Carsten Erker

    Carsten Erker - 2011-06-14
    • labels: --> Hibersap-Core
     
  • Carsten Erker

    Carsten Erker - 2012-05-06

    To keep the interface clean, it would be better to inject a meta data object into the converter. Injection point could be a field with a special annotation.

     
  • Carsten Erker

    Carsten Erker - 2014-12-19
    • status: open --> closed
    • Group: --> Release 1.2.0
     
  • Carsten Erker

    Carsten Erker - 2014-12-19

    move to github tracker

     
MongoDB Logo MongoDB