简体   繁体   English

JHipster-import-jdl-在字段中添加了jhi_

[英]JHipster - import-jdl - Field has jhi_ added to name

I've created a new JHipster project, used JDL Studio to create a .jh schema file, and added it to the project. 我创建了一个新的JHipster项目,使用JDL Studio创建了一个.jh模式文件,并将其添加到该项目中。 After doing the import-jdl and project rebuild, one of my fields has had 'jhi_' added to the name. 完成import-jdl和项目重建后,我的一个字段中已经在名称中添加了“ jhi_”。

Can anyone shed light on this? 谁能阐明这一点? I'm guessing maybe I've used a reserved word. 我猜可能我已经使用了保留字。 But I can't find a list of JHipster's reserved words, if there are any. 但是,如果有的话,我找不到JHipster保留字的列表。

Thanks in advance. 提前致谢。

Full details: 详细信息:

JHipster generation options: monolithic, not using Registry, JWT authentication, MySQL database, Hazelcast cache implementation, 2nd level cache enabled, Gradle, WebSockets, Angular, SASS, no internationalisation, Protractor, no other generators. JHipster生成选项:整体式,不使用注册表,JWT身份验证,MySQL数据库,Hazelcast缓存实现,启用第二级缓存,Gradle,WebSockets,Angular,SASS,没有国际化,量角器,没有其他生成器。

The field affected is the cost field in this JDL definition: 受影响的字段是此JDL定义中的cost字段:

entity Product {
    description String required maxlength(100)
    price BigDecimal required min(0)
    cost BigDecimal required min(0)
    weight Integer min(0)
    barcode String required maxlength(13)
    shelfLife Integer min(0)
    isActive Boolean required
    lastModified Instant required
}

And its relationships: 及其关系:

relationship OneToMany {
   Product to Shelf{product (description) required},
   Product to TransactionItem{product (description) required}

} }

It appears in the MySQL database, and in all generated code, as jhi_cost 它以jhi_cost的形式出现在MySQL数据库和所有生成的代码中

All other fields are appearing exactly as I expect. 所有其他字段都完全按照我的预期显示。

COST is listed as a reserved word for Oracle in the generator (see oracle.js ) so it gets prefixed when you select Oracle as target database. COST在生成器中被列为Oracle的保留字(请参阅oracle.js ),因此,当您选择Oracle作为目标数据库时,它将被加上前缀。 The prefix is globally configurable using --jhi-prefix command line option. 该前缀可以使用--jhi-prefix命令行选项进行全局配置。 You say you use MySQL so it's a bit surprising as COST is not included in mysql.js so maybe there's a bug you should report on github with your project setup. 您说您使用的是MySQL,因此令人惊讶,因为mysql.js中不包含COST,因此您可能在项目安装时应在github上报告一个错误。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM