-
-
Notifications
You must be signed in to change notification settings - Fork 4.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow to specify in id if we want it autoGenerated #14108
Comments
Auto generating the id is the default behavior in the Spring Data entity. to add Ids manually just remove the annotation
Because changing this is simple (could be done manually or with refactoring) and seeing this in the generator will cause confusion,; I don't think this option should be added. Regards, |
@king-il this does not look as simple to me. For instance, this has impacts on client code too. @yelhouti how would you want to implement it in client? Should the id value be entered by user? If it's a UUID, should a random value be generated? |
thanks @gmarziou and indeed, changes needs to be added in liquibase frontend e2e tests... but than fully, we already have a variable field.autoGenerate that is used for String ids... (not working correctly in current version by the way) and would use that same variable to make the UUID generation. I would generate the UUID in the client to allow for easier coding of offline mode... |
I don't think we should generate UUID's in the client because then every client implementation needs to worry about it. |
@mraible this is totally optional and could be left to blueprints, for the frontend. Without this, an offline mode is much harder to implement because of relationships... |
@yelhouti @gmarziou if the id is of type Long no other changes are needed except for making the id field visible (by default hidden) in the frontend then you could use any third party generators or enter it manually. and i think that jhipster don't allow UUID or String as pk in the JDL. =========================================================== |
@king-il the not yet release v7 allows it, I implemented the |
@yelhouti i didn't know the beta version allows it. I'm only using the current stable version and i thought you were talking about it. |
This issue is stale because it has been open 30 days with no activity. |
I am willing to make a PR if more people are interested, for now I might just do it manually. |
This issue is stale because it has been open 30 days with no activity. |
Close by #17837 |
Overview of the feature request
The generator infers if an
@Id
should be autoGenerated bases on the field type.Motivation for or Use Case
This prevents from having the ability of adding a UUID generated in the frontend or a Long added manually based on a manual process (from other software...)
The text was updated successfully, but these errors were encountered: