You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by zr...@apache.org on 2019/06/13 07:15:29 UTC
[camel] branch master updated: CAMEL-13638: Include attributes/type
info in relationship lookups.
This is an automated email from the ASF dual-hosted git repository.
zregvart pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel.git
The following commit(s) were added to refs/heads/master by this push:
new 79e52a59 CAMEL-13638: Include attributes/type info in relationship lookups.
79e52a59 is described below
commit 79e52a59cca3d27f794b64c856636a9d44950ebd
Author: Jeremy Ross <je...@jeremyross.org>
AuthorDate: Wed Jun 12 09:48:55 2019 -0500
CAMEL-13638: Include attributes/type info in relationship lookups.
---
.../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 3019ea6..0e77139 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
@@ -458,6 +458,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 4eaef1f..8e53e28 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
@@ -34,6 +34,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;