DataTransferObject ExampleDTO {
Map<String, @AnotherDTO> keyToValue;
}
leads to error markers in editor as well as generation error: mismatched input 'Map' expecting '}'
I have seen https://fornax.itemis.de/jira/browse/CSC-250 but a DTO is not stored in DB, so there is no reason to not support Maps inside DataTransferObjects.
Patrik Nordwall added a comment - 11/Feb/11 11:30 AM Good suggestion. Might be tricky with JAXB annotations though. Might work but must be investigated. Found this: http://jaxb.java.net/guide/Mapping_your_favorite_class.html
Meanwhile, you might be able to do something by defining your own type in sculptor-generator.propertes
javaType.MyMap=java.util.Map<String, Integer>
which then can be used in model.btdesign
DataTransferObject MyDto {
String foo
MyMap map
}
I define gap in the DTO definition to be able to implement the Map operation manually but using the javaType map definition in the generator.properties is a great alternative.
Jörg Reichert added a comment - 11/Feb/11 11:38 AM I define gap in the DTO definition to be able to implement the Map operation manually but using the javaType map definition in the generator.properties is a great alternative.
Meanwhile, you might be able to do something by defining your own type in sculptor-generator.propertes
javaType.MyMap=java.util.Map<String, Integer>
which then can be used in model.btdesign
DataTransferObject MyDto {
String foo
MyMap map
}