Use @GenerateValue to automatically generate Id of Entities instead of UUID.randomUUID() #12708
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
Environment:
v9-migration
Description of feature/enhancement
Use @GeneratedValue for entities instead of using UUID.randomUUID() for sql entities.
For example,
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.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.
The text was updated successfully, but these errors were encountered: