0

I have 2 microservice, 1 registry, 1 gateway and 1 uaa that run made by JHipster. now in first contract with JHipster UAA, I can't understand how to handle more field on user registration?! where user data store?

I know it's on UAA but can't find any entity to add my field that gateway can detect. I guess that field must be added to User class in UAA and then in gateway add Its corresponding fields;

Do you work with Jhipster UAA? Can share your experiment with me? Is there any advance tutorial on it?

GLinBoy
  • 606
  • 1
  • 10
  • 20

1 Answers1

2

there is the straightforward and the recommended way of solving this:

the direct approach is

  1. add your field to User class
  2. add it also to UserDTO and ManagedUserVM, to make it available at UserResource and AccountResource
  3. apply changes to UserService
  4. add the field to liquibase (src/main/resources/config/liquibase)

This way is fast, but you break compatibility to upgrade to newer UAA from JHipster, as you overwrite default classes.

The better approach is, if you add a new entity, say UserAdditionalInfo or something like this, what is in a one-to-one relationship to the user. Here you can add as many fields you want using the entity sub-generator, and still be open to upgrades from JHipster.

David Steiman
  • 3,055
  • 2
  • 16
  • 22
  • I want to add UserAdditionalInfo, how I must to do? add like entity or by adding manually? – GLinBoy Oct 18 '17 at 14:43
  • I would just generate it with the entity generator, and force a nested creation. That means, every time when a user is created, it automatically has a UserAdditionalInfo bound to it... – David Steiman Oct 18 '17 at 22:53