Seit
Seit

Reputation: 51

“yo jhipster:entity” with one-to-one relationship does not create entity

I tried to add entity "blog" with relation one-to-one to fresh jhipster's project, but no results, jhipster generator did not add the entity "blog" to my project

$ 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...
$

no error message, nothing. I tried add same entity by JDL - same result.

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

file jhipster-jdl.jh:

entity Blog {
    name String
}

relationship OneToOne {
    Blog{User} to User
}

ver JHipster Generator v3.4.2

Workaround this problem - make 2 step :

  1. create entity without any relationship
  2. add desired relation one-to-one

Upvotes: 1

Views: 800

Answers (1)

Seit
Seit

Reputation: 51

this is a bug, see opened issue on GitHub

Upvotes: 1

Related Questions