You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@camel.apache.org by "Claus Ibsen (JIRA)" <ji...@apache.org> on 2017/11/15 10:29:00 UTC

[jira] [Resolved] (CAMEL-12009) Bindy - Missing Headers from OneToMany Field

     [ https://issues.apache.org/jira/browse/CAMEL-12009?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Claus Ibsen resolved CAMEL-12009.
---------------------------------
       Resolution: Fixed
         Assignee: Claus Ibsen
    Fix Version/s: 2.21.0
                   2.20.2
                   2.19.5

Thanks for the PR

> Bindy - Missing Headers from OneToMany Field
> --------------------------------------------
>
>                 Key: CAMEL-12009
>                 URL: https://issues.apache.org/jira/browse/CAMEL-12009
>             Project: Camel
>          Issue Type: Bug
>          Components: camel-bindy
>            Reporter: Khaled AlTurkestani
>            Assignee: Claus Ibsen
>            Priority: Minor
>             Fix For: 2.19.5, 2.20.2, 2.21.0
>
>
> When generating a CSV header, the code doesn't follow the @OneToMany field and thus doesn't print its fields in the header. For example, when marshalling a list of Orders (List<Order>) where the classes are the ones below: 
> {code}
> @CsvRecord(separator = ",", generateHeaderColumns = true)
> public class Order {
>     @DataField(pos = 1)
>     private int orderNumber;
>     @DataField(pos = 2)
>     private String customerName;
>     @OneToMany
>     private List<OrderItem> items;
> }
> {code}
> {code}
> @CsvRecord(separator = ",", generateHeaderColumns = true)
> public class OrderItem {
>     @DataField(pos = 3)
>     private String sku;
>     @DataField(pos = 4)
>     private int quantity;
>     @DataField(pos = 5)
>     private int unitPrice;
> }
> {code}
> we get the following header:
> +orderNumber,customerName+
> when, instead, we should be getting the following header:
> +orderNumber,customerName,sku,quantity,unitPrice+



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)