Hi, It's strange that Salesforce itself doesn't generate/map it to a unique name for overloaded enums, and that we didn't run into this earlier.
The fix should be simple enough. I'll add a flag to prefix generated enum's with the referencing SObject's name, so that existing user code continues to work as is, and users facing this problem can just enable the flag to address it. Users could also use one configuration of the plugin with that flag for conflicting SOBject enums and another plugin config without it for the rest. Does that sound like a fair approach? BTW, off the top of my head, an alternative would be to generate the conflicting SOBjects in different Java packages using two salesforce-maven-plugin configurations. Regards, Dhiraj. On Fri, Jan 29, 2016 at 12:56 AM, Claus Ibsen <[email protected]> wrote: > Hi > > What version of Camel are you using? > > And can you tell more about how you are using that plugin? Maybe a bit > more about what salesforce API you generate "against". > > > Dhiraj wonder if you have time to help also? Wonder if there is > something that need to be improved in that maven plugin to avoid those > name clashes? And would there be a way to reproduce the issue with the > existing camel-salesforce component we have at Apache ? > > > > > > > > On Thu, Jan 28, 2016 at 2:44 PM, kag <[email protected]> wrote: > > Hello all, > > > > We are currently looking into using Camel for integrating with our > > salesforce org. > > To do this we plan to use the salesforce component and the > > camel-salesforce-maven-plugin which generates DTO classes based on the > > metadata fetched from salesforce. > > > > We have encountered a problem when handling Fields of the PickList type > with > > the same name. > > > > E.g. Customer class has a PickList Field called Type. This translates to > > TypeEnum.java. > > > > The problem occurs when we introduce the new Bicycle class, which also > has a > > PickList Field called Type. > > This also translates to TypeEnum.java. > > > > Result, the first TypeEnum.java is replaced/overwritten with the latter. > > > > In the Java Class the method: > > > > public String enumTypeName(String name) { > > name = name.endsWith("__c") ? name.substring(0, name.length() - > 3) : name; > > return name + "Enum"; > > } > > > > seems to be the source of this. > > Is there any way around this issue, is it possible to name the enums > > differently when generating? > > > > E.g. CustomerTypeEnum.java and BicycleTypeEnum.java > > > > > > > > > > > > -- > > View this message in context: > http://camel.465427.n5.nabble.com/camel-salesforce-maven-plugin-picklist-to-enum-generation-tp5776908.html > > Sent from the Camel - Users mailing list archive at Nabble.com. > > > > -- > Claus Ibsen > ----------------- > http://davsclaus.com @davsclaus > Camel in Action 2: https://www.manning.com/ibsen2 >
