This is an automated email from the ASF dual-hosted git repository.

zregvart pushed a commit to branch camel-2.x
in repository https://gitbox.apache.org/repos/asf/camel.git


The following commit(s) were added to refs/heads/camel-2.x by this push:
     new a976a91  CAMEL-13638: Include attributes/type info in relationship 
lookups.
a976a91 is described below

commit a976a912459f9eca20d2990bb2f6aaf12f349f74
Author: Jeremy Ross <jer...@jeremyross.org>
AuthorDate: Wed Jun 12 09:48:55 2019 -0500

    CAMEL-13638: Include attributes/type info in relationship lookups.
    
    (cherry picked from commit 79e52a59cca3d27f794b64c856636a9d44950ebd)
---
 .../src/main/java/org/apache/camel/maven/GenerateMojo.java   |  1 +
 .../src/main/resources/sobject-lookup.vm                     | 12 ++++++++++++
 2 files changed, 13 insertions(+)

diff --git 
a/components/camel-salesforce/camel-salesforce-maven-plugin/src/main/java/org/apache/camel/maven/GenerateMojo.java
 
b/components/camel-salesforce/camel-salesforce-maven-plugin/src/main/java/org/apache/camel/maven/GenerateMojo.java
index de98ce4..24b8821 100644
--- 
a/components/camel-salesforce/camel-salesforce-maven-plugin/src/main/java/org/apache/camel/maven/GenerateMojo.java
+++ 
b/components/camel-salesforce/camel-salesforce-maven-plugin/src/main/java/org/apache/camel/maven/GenerateMojo.java
@@ -459,6 +459,7 @@ public class GenerateMojo extends AbstractSalesforceMojo {
                     context.put("lookupType", lookupClassName);
                     context.put("externalIdsList", externalIds);
                     context.put("lookupClassName", lookupClassName);
+                    context.put("type", reference);                    
 
                     try (final Writer writer = new OutputStreamWriter(new 
FileOutputStream(lookupClassFile),
                         StandardCharsets.UTF_8)) {
diff --git 
a/components/camel-salesforce/camel-salesforce-maven-plugin/src/main/resources/sobject-lookup.vm
 
b/components/camel-salesforce/camel-salesforce-maven-plugin/src/main/resources/sobject-lookup.vm
index e9d68d6..f9b4adc 100644
--- 
a/components/camel-salesforce/camel-salesforce-maven-plugin/src/main/resources/sobject-lookup.vm
+++ 
b/components/camel-salesforce/camel-salesforce-maven-plugin/src/main/resources/sobject-lookup.vm
@@ -35,6 +35,18 @@ import com.thoughtworks.xstream.annotations.XStreamAlias;
 @XStreamAlias("$lookupClassName")
 @JsonInclude(Include.NON_NULL)
 public class $lookupClassName {
+    class Attributes {
+        @JsonProperty("type")
+        public String getType() {
+            return "$type";
+        }
+    }
+
+    @JsonProperty("attributes")
+    public Attributes getAttributes() {
+        return new Attributes();
+    }
+
 #foreach ( $externalId in $externalIdsList)
     private String $externalId.Name;
 

Reply via email to