Skip to content
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

Use @GenerateValue to automatically generate Id of Entities instead of UUID.randomUUID() #12708

Open
kevin9foong opened this issue Jan 27, 2024 · 4 comments
Labels
committers only Difficult; better left for committers or more senior developers enhancement New feature or request p.Low Very little impact; unlikely to do in the near future
Milestone

Comments

@kevin9foong
Copy link
Member

kevin9foong commented Jan 27, 2024

Environment:
v9-migration

Description of feature/enhancement
Use @GeneratedValue for entities instead of using UUID.randomUUID() for sql entities.

For example,
image
we should add a @GeneratedValue for the @id field.

Justification

While there is a low chance of collision using UUID.randomUUID(), there is still a small chance of failure if the random UUID generated in teammates/src/main/java/teammates/sqllogic/core/DataBundleLogic.java persistDataBundle method.
image

Instead, a better practice might be to use @GeneratedValue annotation to generate a safe UUID for the respective entities such as Section, Student etc.

This would prevent a collision bug from ever occurring.

@kevin9foong kevin9foong added enhancement New feature or request p.Low Very little impact; unlikely to do in the near future p.Medium Marginal impact; would like to do if time permits and removed p.Low Very little impact; unlikely to do in the near future p.Medium Marginal impact; would like to do if time permits labels Jan 27, 2024
@ArunErram
Copy link

is these issue still persist , can i work on it ?

@cedricongjh cedricongjh added the committers only Difficult; better left for committers or more senior developers label Jan 27, 2024
@cedricongjh
Copy link
Contributor

hi @ArunErram, this issue deals with our v9-migration, which is for committers only to contribute to

@kevin9foong
Copy link
Member Author

is these issue still persist , can i work on it ?

hi @ArunErram, we will try to release some new issues regularly, please have a look of some of the other open issues posted!

@quantavoid11
Copy link
Contributor

Hello @cedricongjh, can I work on this issue?

@cedricongjh cedricongjh added this to the V9.0.0-beta.0 milestone Feb 2, 2024
@ziqing26 ziqing26 modified the milestones: V9.0.0-beta.0, V9.0.0 Mar 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
committers only Difficult; better left for committers or more senior developers enhancement New feature or request p.Low Very little impact; unlikely to do in the near future
Projects
None yet
Development

No branches or pull requests

5 participants