Repository navigation
COG-1151: W1 · Remaining 6 entities: GenerationType.AUTO → IDENTITY - #332
Open
patrickbradley-cog wants to merge 1 commit into
Open
patrickbradley-cog wants to merge 1 commit into
patrickbradley-cog wants to merge 1 commit into
Conversation
Co-Authored-By: patrick.bradley <patrick.bradley@cognition.ai>
|
I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Linear: COG-1151 — W1 · Remaining 6 entities: GenerationType.AUTO → IDENTITY
W1 forward-compatible refactor on Boot 1.5.4 (no Boot/Java bump). This PR changes one annotation in each of the six entities below:
PrimaryAccount,SavingsAccount,PrimaryTransaction,SavingsTransaction,Recipient,Appointment. Nothing else changes: no namespace swap, no Lombok, no formatting churn.User.javaandUserRole.javaare left alone because other tickets own them.Why: Boot 1.5.4 defaults to
use-new-id-generator-mappings=false, so on MySQLAUTOalready resolves to nativeAUTO_INCREMENT. Boot 2.0+ flips that default totrue, andAUTOthen becomes ahibernate_sequencetable generator whose ids would collide with existing primary keys on first start. SettingIDENTITYexplicitly does nothing on 1.5.4 and removes that risk before the pivot.Merge order: merge this behind the W0 smoke suite (#106, #108, #109 / COG-1141) once that is green. It isn't on master yet, so I verified with the existing test plus a manual run against MySQL (below).
Verification
Environment: Temurin 8 (1.8.0), Maven, docker
mysql:5.7.44. MySQL 8 won't work here because Boot 1.5.4's managed Connector/J 5.1.42 fails withUnknown system variable 'query_cache_size'. I pointed the app at the DB withSPRING_DATASOURCE_URL=jdbc:mysql://localhost:3306/onlinebanking?useSSL=false; Temurin 8u4xx disables TLSv1/1.1, which the old connector needs for SSL. That's an env override only and no repo config was changed.1.
mvn -B -f UserFront/pom.xml verify: BUILD SUCCESS on master and on this branch2. Hibernate generates the same schema before and after (proves no change on 1.5.4)
verifyonorigin/master(ddl-auto=update), and dumpedSHOW CREATE TABLEfor the 6 tables.verifyon this branch, and dumped again.diff ddl-master.txt ddl-branch.txt→ identical. Everyidisbigint(20) NOT NULL AUTO_INCREMENT, and neither run creates ahibernate_sequencetable.3. Manual flow: inserts take the next
AUTO_INCREMENTidI seeded
role, then moved each table'sAUTO_INCREMENTto a distinct offset (primary_transaction=1000, savings_transaction=2000, appointment=3000, recipient=4000, primary_account=5000, savings_account=6000). Then I ranjava -jar target/userFront-0.0.1-SNAPSHOT.jarand drove it with curl:Resulting rows. Every id is the seeded
AUTO_INCREMENTvalue, which confirms Hibernate lets MySQL assign ids viaIDENTITY:Hibernate SQL shows
insert into primary_transaction (amount, available_balance, date, ...)with noidcolumn, so the database assigns it. The app log has no ERROR lines or exceptions.The repo has no CI workflows. AdminPortal is untouched, so there's no Angular build.
Devin-Org: engineering
Link to Devin session: https://app.devin.ai/sessions/46d1b1c2d3af498db353c436f778ec05
Open in Devin Desktop: https://app.devin.ai/desktop/session/46d1b1c2d3af498db353c436f778ec05?variant=devin
Requested by: @patrickbradley-cog
Devin Review