验证' [对象]'不支持类型' String'

时间:2016-08-26 15:53:44

标签: data-warehouse jhipster

当我尝试使用jHipster重新生成模型时,出现以下错误:

  

验证' [object Object]'不支持类型'字符串'。

对我做错了什么的想法?

我使用的jHipster版本是3.6.1。

{

    /**
     * Hierarchy entity.
     * @author Shane Hayes.
     */
    entity HierarchyServiceCenter  {
        hrchyNode1IPId Integer required,
        hrchyNode1IPNm String maxlength(40),
        hrchyNode1Dsgntn String,
        hrchyNode2IPId Integer ,
        hrchyNode2IPNm String maxlength(40),
        hrchyNode2Dsgntn String,
        hrchyNode3IPId Integer ,
        hrchyNode3IPNm String maxlength(40),
        hrchyNode3Dsgntn String,
        hrchyLeafCode Integer required,
        hrchyLeafIPNm String maxlength(40) required,
        hrchyLeafDsgntn String ,
        hrchyLeafLctnGNm String,
        hrchySource String,
        hrchyTimeStampCreate ZonedDateTime required,
        hrchyTimeStampUpdate ZonedDateTime ,
    }
    /**
     * TimeDimention entity.
     * @author Shane Hayes.
     */
    entity TimeDimension {
        createDate ZonedDateTime required,
        updateDate ZonedDateTime
    }
    /**
     * MetricDimention entity.
     * @author Shane Hayes.
     */
    entity MetricDimension {
        metricDimKey String required max(10),
        metricName String max(35),
        asOfDate ZonedDateTime,
        metricFrequency String max(1),
        srcSystemID Integer,
        createTmStamp ZonedDateTime,
        updateTmStamp ZonedDateTime
    }
    /**
     * MetricTarget entity.
     * @author Shane Hayes.
     */
    entity MetricTarget {
        goalAmt BigDecimal required,
        autoComputed Integer,
        asOfDate ZonedDateTime required,
        goalEffDate ZonedDateTime required,
        endDate ZonedDateTime required,
        srcSystemID Integer,
        createDate ZonedDateTime,
        updateDate ZonedDateTime
    }
    relationship ManyToOne {
        MetricTarget{metricDimension} to MetricDimension,
        MetricTarget{hierarchyLeafCode} to HierarchyServiceCenter{hrchyLeafCode},
        MetricTarget{hierarchyNode1IPId} to HierarchyServiceCenter{hrchyNode1IPId},
        MetricTarget{hierarchyNode2IPId} to HierarchyServiceCenter{hrchyNode2IPId},
        MetricTarget{hierarchyNode3IPId} to HierarchyServiceCenter{hrchyNode3IPId},
        MetricTarget{hierarchyNode4IPId} to HierarchyServiceCenter{hrchyNode4IPId},
        MetricTarget{timeDimensionId} to TimeDimension
    }
    entity MetricActual {
        actualAmt BigDecimal required,
        autoComputed Integer,
        asOfDate ZonedDateTime required,
        goalEffDate ZonedDateTime required,
        endDate ZonedDateTime required,
        srcSystemID Integer,
        createDate ZonedDateTime,
        updateDate ZonedDateTime
    }
    relationship ManyToOne {
        MetricActual{metricDimension} to MetricDimension,
        MetricActual{hierarchyLeafCode} to HierarchyServiceCenter{hrchyLeafCode},
        MetricActual{hierarchyNode1IPId} to HierarchyServiceCenter{hrchyNode1IPId},
        MetricActual{hierarchyNode2IPId} to HierarchyServiceCenter{hrchyNode2IPId},
        MetricActual{hierarchyNode3IPId} to HierarchyServiceCenter{hrchyNode3IPId},
        MetricActual{hierarchyNode4IPId} to HierarchyServiceCenter{hrchyNode4IPId},
        MetricActual{timeDimensionId} to TimeDimension
    }

}

2 个答案:

答案 0 :(得分:1)

  • 第一个错误是JDL开头和结尾处的花括号。

  • 第二个错误是max(35)个元素。你应该写maxlength(35)

  • 第三个错误是MetricTarget和MetricDimension之间以及MetricActual和MetricDimension之间的关系。这些是单向关系(ManyToOne)所以你应该写例如MetricTarget{hierarchyLeafCode} to HierarchyServiceCenter代替MetricTarget{hierarchyLeafCode} to HierarchyServiceCenter{hrchyLeafCode}

答案 1 :(得分:0)

首先删除所有包围的花括号。他们不应该在那里。第二步将整个事物粘贴到JDL studio并确保它通过语法检查。如果有的话,它会在红色的顶部告诉你哪个行存在问题。