...
Na obrázku je uvedená definícia štruktúry SD.Person, ktorá poslúži ako príklad. Nasleduje mapovanie definície štruktúry na triedu Person
.
Blok kódu | ||||
---|---|---|---|---|
| ||||
import sk.ipesoft.d2000.d2japi.annotations.UnivalAttributeType; import sk.ipesoft.d2000.d2japi.annotations.UnivalConvertor; import sk.ipesoft.d2000.d2japi.annotations.structureBinding.ColumnAttribute; import sk.ipesoft.d2000.d2japi.annotations.structureBinding.ColumnValue; import sk.ipesoft.d2000.d2japi.annotations.structureBinding.ConvertedColumnValue; import sk.ipesoft.d2000.d2japi.annotations.structureBinding.MulticonvertedColumnValue; import sk.ipesoft.d2000.d2japi.annotations.structureBinding.StructureDefinition; import sk.ipesoft.d2000.d2japi.sharedResources.ConversionResult; import sk.ipesoft.d2000.datatable.ColumnType; @StructureDefinition(name = "SD.Person") public class Person { private ConversionResult convertedName; private Integer id; private List<ConversionResult> multiConvertedName; private String name; private Long nameTime; public Person() { this.id = null; this.name = null; this.nameTime = 0L; this.convertedName = null; this.multiConvertedName = Collections.emptyList(); } public Person(Integer id, String name, Long nameTime) { this.setId(id); this.setName(name); this.setNameTime(nameTime); } public ConversionResult getConvertedName() { return convertedName; } @ConvertedColumnValue(name = "Name") public void setConvertedName(ConversionResult convertedName) { this.convertedName = convertedName; } @ColumnValue(name = "Id", columnType = ColumnType.integer) public Integer getId() { return id; } public final void setId(Integer id) { this.id = id; } public List<ConversionResult> getMultiConvertedName() { return multiConvertedName; } @MulticonvertedColumnValue(name = "Name") public void setMultiConvertedName(List<ConversionResult> multiConvertedName) { this.multiConvertedName = multiConvertedName; } @ColumnValue(name = "Name", columnType = ColumnType.text) public String getName() { return name; } |
...