Conversation
Replace five nested public enums with statement.CascadeBehavior, including AlterType attribute changes. Preserve omitted clauses and existing render/parser behavior, and document the breaking API migration. Signed-off-by: minleejae <mmj9808@gmail.com>
This branch has not been deployed
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.
Five statement-specific enums currently represent the same CASCADE/RESTRICT syntax, requiring callers to translate between types. Replace them with net.sf.jsqlparser.statement.CascadeBehavior and update grammar, consumers and tests.
Breaking API changes: remove AlterDomain.Behavior, AlterType.Behavior, DropPolicy.Behavior, Truncate.DropBehavior and Revoke.Behavior. Existing accessor names now accept/return CascadeBehavior; AlterType.AttributeChange is included. Callers must update imports and recompile. There are no compatibility aliases or overloaded setters. usage.rst includes the migration.
Null still means the clause is omitted, explicit RESTRICT remains distinct, and Truncate.setCascade(false) retains its previous behavior. SQL grammar alternatives, dialect handling and rendered SQL are unchanged. Foreign-key referential actions keep their separate enum.
Validation: Java 17 Gradle check passes: 9,419 tests, 9,394 passed, 25 skipped, zero failures/errors. This includes formatting, grammar conflicts, Checkstyle, PMD and SpotBugs. Focused regression coverage exercises option changes/removal across all affected statement forms, generic/PostgreSQL parsing, toString, deparser and reparsing.
Combined validation of these three refactoring branches: Gradle check passes (9,465 tests, 9,440 passed, 25 skipped, zero failures). All 882 original DDL fixtures execute on MySQL 8.4.11/PostgreSQL 18.6. The 875 supported cases also produce toString and deparser SQL that executes successfully. Seven parse failures already exist on base bb55bb9, including two foreign-option identifier cases using SAMPLE. Final parsing results and SQL outputs match the base and the DB-replayed outputs exactly; there are no new parsing/rendering regressions.