You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@skywalking.apache.org by wu...@apache.org on 2018/09/12 13:11:04 UTC

[incubator-skywalking-oal-tool] branch master updated: Support new annotation.

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

wusheng pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-skywalking-oal-tool.git


The following commit(s) were added to refs/heads/master by this push:
     new ea32757  Support new annotation.
ea32757 is described below

commit ea327573a6fab5809a4416b8264f4e04704f7a66
Author: Wu Sheng <wu...@foxmail.com>
AuthorDate: Wed Sep 12 21:10:56 2018 +0800

    Support new annotation.
---
 oal-parser/src/main/resources/code-templates/IndicatorImplementor.ftl   | 2 +-
 .../src/test/resources/expectedFiles/IndicatorImplementorExpected.java  | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/oal-parser/src/main/resources/code-templates/IndicatorImplementor.ftl b/oal-parser/src/main/resources/code-templates/IndicatorImplementor.ftl
index 2b2d841..288de69 100644
--- a/oal-parser/src/main/resources/code-templates/IndicatorImplementor.ftl
+++ b/oal-parser/src/main/resources/code-templates/IndicatorImplementor.ftl
@@ -49,7 +49,7 @@ import org.apache.skywalking.oap.server.core.source.Scope;
 public class ${metricName}Indicator extends ${indicatorClassName} implements AlarmSupported {
 
 <#list fieldsFromSource as sourceField>
-    @Setter @Getter @Column(columnName = "${sourceField.columnName}") private ${sourceField.typeName} ${sourceField.fieldName};
+    @Setter @Getter @Column(columnName = "${sourceField.columnName}") <#if sourceField.isID()>@IDColumn</#if> private ${sourceField.typeName} ${sourceField.fieldName};
 </#list>
 
     @Override public String id() {
diff --git a/oal-parser/src/test/resources/expectedFiles/IndicatorImplementorExpected.java b/oal-parser/src/test/resources/expectedFiles/IndicatorImplementorExpected.java
index be6ec2c..7564eb4 100644
--- a/oal-parser/src/test/resources/expectedFiles/IndicatorImplementorExpected.java
+++ b/oal-parser/src/test/resources/expectedFiles/IndicatorImplementorExpected.java
@@ -41,7 +41,7 @@ import org.apache.skywalking.oap.server.core.source.Scope;
 @StorageEntity(name = "service_avg", builder = ServiceAvgIndicator.Builder.class)
 public class ServiceAvgIndicator extends LongAvgIndicator implements AlarmSupported {
 
-    @Setter @Getter @Column(columnName = "id") private int id;
+    @Setter @Getter @Column(columnName = "id") @IDColumn private int id;
 
     @Override public String id() {
         String splitJointId = String.valueOf(getTimeBucket());