简体   繁体   中英

creating a entity relationship with user (jhiUser) in Jhipster

I have two entities "user" which is already created by jhipster and "car" the car have Many-to-one(bidirectional) relation with user

my queries are :

1> when I type yo jhipster:entity user it is creating new user entity rather then updating existing one I have also tried yo jhipster:entity jhiUser

2> Where to use what ? either to use "user" or "jhiUser" and where?

This is normal you cannot create an entity which already exists especially User which is used for access control and basically this is what you tried by running yo jhipster:entity user .

You can't do bi-directional relations with user using entity sub generator, you could create many-to-one relation from car to user and then modify User manually.

Alternatively you could create a one-to-one relation between User and another entity CarOwner which would have a bi-directional one-to-many relationship with Car.

There are many questions about relations with User that you could search in stackoverflow.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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