Jhipster extented user entity and account creation

我是研究僧i 提交于 2019-12-25 07:50:01

问题


I'm building a job finding website using Jhipster. Two of our main entities are 'candidate' and 'headHunter' They're both users of the app, so they both have account on the app.

We decided to make each entities have a "one to one" relationship with User entity.

On top of that, we created a 'userCustom' entity to manage commons fields. This entity also have a "one to one" relationship with User.

So when either a headHunter or a candidate create a new account on the website, i have to call a "save" on 3 services : user, userCustom and candidate/headHunter

My main problem is : To create the userCustom and the candidate/headHunter, i need the userId.

What is the cleanest way to do this ?

Should I call the save on user, then call a get to retrieve the userId and then make the save on the two other entity ?

Another more general question : With this kind of configuration, is it a good idea to create custom DTO/services for each configuration (user,userCustom,candidate // user,userCustom,headHunter) ? Or do i just need to customize my candidate and headHunter classes ?

来源:https://stackoverflow.com/questions/41984367/jhipster-extented-user-entity-and-account-creation

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!