You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Jothi <co...@gmail.com> on 2013/07/13 08:06:30 UTC

OneToMany in camel-bindy

Guys,

Is this OneToMany a true OneToMany? I guess it only applies when the entire
CSV file has some common elements? I have a file that has entries like
below:

1,abc,def,joe
1,abc,xyz,san
2,abc,mno,ram
3,abc,fgh,sam

When I tried with the above file which used the OneToMany annotation between
the Id and the rest of the fields, it threw an error saying that pos 2 must
be defined. I later took a look into the Camel documentation for bindy and
realized that the id's should all be the same throught the CSV file.

Can we model the OneToMany in such a way that it takes a parameter for the
position and uses this to identify which field will be the One side?
Something like:

OneToMany(pos=1)

Is it reasonable enough to raise a Jira and provide a fix. I would be happy
to provide a fix.

Regards,
Joe



--
View this message in context: http://camel.465427.n5.nabble.com/OneToMany-in-camel-bindy-tp5735591.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: OneToMany in camel-bindy

Posted by Christian Müller <ch...@gmail.com>.
Hi Joe!

As you know, we love contributions.
But I'm not sure whether I understood your proposed solution (I'm quite
sure I understood your requirement).

At present, the splitter EAI pattern + a content based router and multiple
Bindy models could solve your requirement.

Best,
Christian
-----------------

Software Integration Specialist

Apache Camel committer: https://camel.apache.org/team
V.P. Apache Camel: https://www.apache.org/foundation/
Apache Member: https://www.apache.org/foundation/members.html

https://www.linkedin.com/pub/christian-mueller/11/551/642


On Sat, Jul 13, 2013 at 8:06 AM, Jothi <co...@gmail.com> wrote:

> Guys,
>
> Is this OneToMany a true OneToMany? I guess it only applies when the entire
> CSV file has some common elements? I have a file that has entries like
> below:
>
> 1,abc,def,joe
> 1,abc,xyz,san
> 2,abc,mno,ram
> 3,abc,fgh,sam
>
> When I tried with the above file which used the OneToMany annotation
> between
> the Id and the rest of the fields, it threw an error saying that pos 2 must
> be defined. I later took a look into the Camel documentation for bindy and
> realized that the id's should all be the same throught the CSV file.
>
> Can we model the OneToMany in such a way that it takes a parameter for the
> position and uses this to identify which field will be the One side?
> Something like:
>
> OneToMany(pos=1)
>
> Is it reasonable enough to raise a Jira and provide a fix. I would be happy
> to provide a fix.
>
> Regards,
> Joe
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/OneToMany-in-camel-bindy-tp5735591.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>