【问题标题】:“yo jhipster:entity” with one-to-one relationship does not create entity具有一对一关系的“yo jhipster:entity”不会创建实体
【发布时间】:2016-07-21 03:12:24
【问题描述】:

我尝试将具有一对一关系的实体“博客”添加到新 jhipster 的项目中,但没有结果,jhipster 生成器没有将实体“博客”添加到我的项目中

$ yo jhipster:entity blog

The entity blog is being created.


  Generating field #1

? Do you want to add a field to your entity? Yes
? What is the name of your field? name
? What is the type of your field? String
? Do you want to add validation rules to your field? No

================= Blog =================
Fields
name (String)


Generating field #2

? Do you want to add a field to your entity? No

================= Blog =================
Fields
name (String)


Generating relationships to other entities

? Do you want to add a relationship to another entity? Yes
? What is the name of the other entity? user
? What is the name of the relationship? user
? What is the type of the relationship? one-to-one
? Is this entity the owner of the relationship? Yes
? When you display this relationship with AngularJS, which field from 'user' do you want to use? id
? Do you want to add any validation rules to this relationship? No

================= Blog =================
Fields
name (String)

Relationships
user (User) one-to-one


Generating relationships to other entities

? Do you want to add a relationship to another entity? No

================= Blog =================
Fields
name (String)

Relationships
user (User) one-to-one



? Do you want to use a Data Transfer Object (DTO)? No, use the entity directly
? Do you want to use separate service class for your business logic? No, the REST controller should use the repository directly
? Do you want pagination on your entity? No

Everything is configured, generating the entity...
$

没有错误信息,什么都没有。 我尝试通过 JDL 添加相同的实体 - 结果相同。

$ yo jhipster:import-jdl jhipster-jdl.jh
The jdl is being imported.
$

文件 jhipster-jdl.jh:

entity Blog {
    name String
}

relationship OneToOne {
    Blog{User} to User
}

ver JHipster Generator v3.4.2

解决这个问题 - 分两步:

  1. 创建没有任何关系的实体
  2. 一对一添加所需的关系

【问题讨论】:

  • 你期待什么结果?
  • 我希望 jhipster 生成器将我的实体“博客”添加到项目中,但它没有。
  • 我已经转载了,好像回归了,请在github上发issue。

标签: jhipster


【解决方案1】:

这是一个错误, see opened issue on GitHub

【讨论】:

    猜你喜欢
    • 2018-06-12
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-09-29
    • 1970-01-01
    相关资源
    最近更新 更多