In JHipster how to create entity with relationship with User?

前端 未结 4 1761
伪装坚强ぢ
伪装坚强ぢ 2020-12-31 01:10

I need to create my own entities using the JHipster using the command \"yo jhipster:entity myEntity\" that have many-to-one relationship with the User entity that comes by d

4条回答
  •  清歌不尽
    2020-12-31 01:55

    Just an update - jhipster 2.5.0 was released a few days ago adding support for this. Created this answer since the formatting in comments make i pretty hard to read.

    When creating a relation for your entity simply answer the questions like this

    ? 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? owner
    ? What is the type of the relationship? many-to-one
    ? When you display this relationship with AngularJS, which field from 'user' do you want to use? login
    

    Possible values on how to display the relation could be: id, login, first_name, last_name, email

    See https://jhipster.github.io/2015/03/01/jhipster-release-2.5.0.html for moreinformation

提交回复
热议问题