Commit 8c735be
authored
Validation visitor framework (#1045)
* * add with prefix for fluent setters.
#1004
* add getters
* * add with prefix for fluent setters. (revert to chaining setters, do
not break current api)
#1004
* * add with prefix for fluent setters. (revert to chaining setters, do
not break current api)
#1004
* use new methods within testcases
* use new methods within testcases
* use new methods within testcases
* use new methods within testcases
* use new methods within testcases
* use new methods within testcases
* use new methods within testcases
* use new methods within testcases
* remove create() methods - they do not add enough value to be justified
* * use new methods within testcases
* add some constructors
* fix and add "with" / "add" methods
* * use new methods within testcases
* * use new methods within testcases
* add some constructors
* * renamed constant
* use new methods within testcases
* use new methods within testcases
* use new methods within testcases
* use new methods within testcases
* * use new methods within testcases
* add some with-methods
* add getter/setter named after the field without abbrivation
* * use new methods within testcases
* remove empty implicit constructor
* return the deparsed Statement - object
* compare object tree
* compare object tree
* * fix ObjectTreeToStringStyle
* compare object tree
* remove casts not needed
* * use new methods within testcases
* add some "set" "with" "add" methods missing
* * use new methods within testcases
* add empty constructors and override with-/add-methods returning concrete
type
* * add ReflectionModelTest
* * use new methods within testcases
* fix checkstyle errors
* license header
* remove test-classes from ReflectionModelTest
* remove visitoradapter-classes from ReflectionModelTest
* * add SelectDeParser(StringBuilder)
* remove overriding setters/getters of buffer
#1007
* push to synbee-contrib
org.synbee.commons.contrib:jsqlparser:3.2-0.0.6-SNAPSHOT
* add ValidationUtil for simple validation of one or more statements
* remove overrides of
* getCause
* printStackTrace variants
why add an additional cause ?
set cause.getMessage() the message within constructor
JSQLParserException(Throwable cause), othewise cause.toString() will be
set as default.
* add ValidationVisitor showcase
#1005
* add ValidationUtil for simple validation of one or more statements
* remove overrides of
* getCause
* printStackTrace variants
why add an additional cause ?
set cause.getMessage() the message within constructor
JSQLParserException(Throwable cause), othewise cause.toString() will be
set as default.
* visit(ShowTablesStatement)
* copyright/license
* add stubs (use deparsers as template)
* Merge branch 'master.validate' of
https://github.com/gitmotte/JSqlParser.git into master.validate
* add ValidationVisitor showcase
#1005
* add ValidationUtil for simple validation of one or more statements
* remove overrides of
* getCause
* printStackTrace variants
why add an additional cause ?
set cause.getMessage() the message within constructor
JSQLParserException(Throwable cause), othewise cause.toString() will be
set as default.
* visit(ShowTablesStatement)
* add stubs (use deparsers as template)
* Merge branch 'master.validate' of
https://github.com/gitmotte/JSqlParser.git into master.validate
* add tests for ValidationUtil
* + implements OrderByVisitor
* split Expressionvalidator which implements both ItemsListVisitor and
Expressionvisitor into Expressionvalidator and ItemListValidator
* Merge branch 'github.validate'
* implement upsertvalidator
* add copyright
* validate through given ValidationCapability's
* * switch to new method forced by
ValidationCapability.validate(ValidationContext context,
Consumer<String> errorMessageConsumer);
* add AllowedTypesValidation
* add FeatureConfiguration
* use FeatureConfiguration within parser
* repair pom.xml
* repair pom.xml
* repair pom.xml
* repair pom.xml
* * make FeatureConfiguration not a singleton any more
* CCJSqlParser extends AbstractJSqlParser<CCJSqlParser>
* add FeaturesAllowed for testing against features allowed
* implement some Validators
* basic implementation of DatabaseMetaDataValidation /
JdbcDatabaseMetaDataCapability
* moving classes to sub-packages
* * moving classes to sub-packages
* fixing some bugs
* repair pom.xml
* add and fix validations
* add javadoc
* * force definition of ```public String getMessage(Feature feature)```
in FeatureSetValidation
* allow all objects as feature-value - this may be needed by the parser,
if a none-boolean configuration is needed
* impl.
* SelectValidator.visit(PlainSelect)
* OrderByValidator
* add Version-enums
* impl.
* InsertValidator
* multiple implementations of visit(SubSelect) -> forward to
SelectValidator
* add some known features to SqlServerVersion
* refactoring enum-name should be upper case
* add ansi sql enum
* refactoring enum-name should be upper case
* implement limitvalidator
* + validateOffset
* + validateFetch
* + validate Pivot, UnPivot, PivotXml
* + implement DropValidator
* change testcase to image a more probably usecase
* * add javadoc and
* predefined sets for EXECUTE, ALTER, DROP
* allow to combine FeatureSets
* * implement executevalidator
* implement ExpressionValidator
* implement GrantValidator
* javadoc and complete SELECT constant
* use utility methods from AbstractValidator
* more user friendly names
* javadoc
* add subtypes for ValidationException
* ValidationParseException
* DatabaseException
* UnexpectedValidationException
and change Set<String> errors to Set<ValidationException> for collect.
* javadoc & rename exception
* rename method
* extract parsing task into package - private class for {@link
ValidationUtil} to parse the statements
* within it's own {@link ValidationCapability}
* add null-check for parsedStatement
* bugfix - do not collect duplicates
* implement toString() for
* ValidationError
* ValidationException
* add simple caching
* + validateOptionalFromItem(s)
* * implement GroupByValidator
* implement merge-validator
* renaming ItemListValidator -> ItemsListValidator
* + validateOptionalItemsList
+ implement ReplaceValidator
+ use validateOptionalColumns, validateOptionalExpression where possible
* * remove validateOptionalColumns -> switch to
validateOptionalExpressions
* move validateOptionalOrderByElements to AbstractValidator
* add validateOptional in AbstractValidator
* add validateOptionalList in AbstractValidator
* + SetStatementValidator
* + ValuesStatementValidator
* + UseStatementValidator
* * implement UpdateValidator
* * implement ShowStatementValidator/ShowColumnsStatementValidator
* * implement UpdateValidator
* * add Feature.jdbcParameter, Feature.jdbcNamedParameter, to all
featuresets
* + Version.getFeaturesClone
* add javadoc to Version-enum-constructors
* + validateOptionalFeature
* * implement DeleteValidator
* ...
* fix typo
* small optimization
* * move method getFeaturesClone to FeatureSet
* implement join - validation
* add copy(), add(Collection), remove(*) methods to FeaturesAllowed
* * add join - features to sqlserver, h2
* implementations
* bugfix - merging the errors
* copyright
* #1022
* add more fine granular control for setOperations
* fix nullpointerexception
* add more fine granular control for comments
* add Features supported
* * add javadoc
* add features to *Version-files
* extract methods isNotEmpty
* check for isNotEmpty
* * add features to *Version-files
* always parse net.sf.jsqlparser.statement.Statements and validate the
list of included net.sf.jsqlparser.statement.Statement's
* add known mariadb features
* new names-set for FeaturesAllowed
* new names-set for FeaturesAllowed
* new names-set for FeaturesAllowed
* add ature.withItem, Feature.withItemRecursive to H2
* Feature.setOperation, Feature.setOperationUnion,
Feature.setOperationIntersect, Feature.setOperationExcept,
for MariaDb
* add features to SQLServer
* Merge branch 'master.orig' into github.validate
* @OverRide() -> @OverRide
* fix typing error "joinStaight" > joinStraight
* rename Feature "insertValues" -> "values" and use "insertValues" for
INSERT INTO ... VALUES
* add javadoc
* add Feature.selectGroupByGroupingSets to PostgresqlVersion
* implement basic OracleVersion
* add Feature.mySql* - also supported by mariadb
* add some more finegraned control over "drop" Feature.
* drop,
* dropTable,
* dropIndex,
* dropView,
* dropSchema,
* dropSequence,
* dropIfExists,
* complete FeaturesAllowed groups INSERT/UPDATE/DELETE/MERGE/DML
* add link to documentation
* fix - duplicate use of feature "function" - the use of functions in
statements and "createFunction" as a ddl statement
* TODO this feature seams very close to a jsqlparser-user usecase
* * implement MySqlVersion
* replace feature Feature.dropIfExists by features dropTableIfExists,
dropIndexIfExists, dropViewIfExists, dropSchemaIfExists,
dropSequenceIfExists
* add methods FeatureSet.getNotContained FeatureSet.retainAll
* remove HSQLDBVersion - do not support this variant
* remove HSQLDBVersion - do not support this variant
* add unit-test
* + add unittests for
* UpdateValidator
* DeleteValidator
add stubs for all other Validator-classes
+ ModifyableFeatureSet
* add some utility-methods in ValidationTestAsserts
* complete unit-tests for InsertValidator
* remote Feature.insertReturningExpressionList for Oracle -
returning_clause requires INTO clause (only PL/SQL)
* add some more select validation tests
* add DropValidatorTests
* add DropValidatorTests
* add CreateTableValidatorTests
* add CreateTableValidatorTests
* add ExpressionValidatorTests
* add OrderByValidatorTest
* use isNotEmpty
* implement GroupByValidatorTest
* implement CreateSequenceValidatorTest
* remove @ignore - test is ok
* implement CreateIndexValidatorTest
* implement CreateViewValidatorTest
* enable validation of Feature.commentOnView (#1024 is merged already)
* change format of #toString() for better readability
* * implement MergeValidatorTest
* implement ReplaceValidatorTest
* implement StatementValidatorTest
* rename
* ValidationUtil -> Validation
* ValidatorUtil -> ValidationUtil
add testcases for ValidationUtil
* add DatabaseMetaDataValidationTest
* checkstyle fix
* add copyright statement
* add unit-tests for show tables, show column, show statements
* * add ExecuteValidatorTest
* as there is a difference between execute <procedure> and execute
[immediate] <dynamic sql> with USING expr, ... remove support for
execute on MYSQL, MARIADB, ORACLE
* * add ExecuteValidatorTest for CALL fnName (mysql, mariadb, postgres)
* add upsertvalidatortest
* add GrantValidatorTest
* add AlterSequenceValidatorTest
* add AlterSequenceValidatorTest
* add AlterViewValidatorTest
* add AlterValidatorTest
* replace != null by isNotEmpty on collections
* fix formatting
* add validate commit
* add validate block
* add DeclareStatementValidatorTest
* let NamesLookup implement UnaryOperator<String>
* let NamesLookup implement UnaryOperator<String>
* add javadoc
* add more DatabaseMetaDataValidationTest's
* extract JdbcDatabaseMetaDataCapability.splitAndValidateMinMax
* add pivot/unpivot/pivotxml validation testcases
* add testcase for Feature.tableFunction
* add test for lateral joins and subjoins
* add testValidationRowMovementOption
* add values validator test
* move tests to LimitValidatorTest
* move tests to UseStatementValidatorTest
* add tests for SET - statements
* fix checkstyle error
* new serialVersionUID
* add validation for NamedObject not existing
* need table/view reference to validate column names
* fix typo
* fix errormessage (Arrays.toString(types))
* add trigger, alias
return null, instead of throwing exception, if not found
* extract NamesLookup to own file (jdk-bug enum inner classes)
* fix name-check AlterOperation.ALTER
* fix error message
* remove methods not needed (they only delegate to ValidationContext)
* add tests - validate metadata
* fix compile error
* fix columnExists check - depending on the statement the prefix is an
alias, a table/view or it has no prefix (need to lookup within all
related tables/views)
* fix javadoc warnings1 parent ac74622 commit 8c735be
File tree
110 files changed
+9189
-81
lines changed- src
- main
- java/net/sf/jsqlparser
- parser
- feature
- util/validation
- allowedtypes
- feature
- metadata
- validator
- jjtree/net/sf/jsqlparser/parser
- test/java/net/sf/jsqlparser
- parser/feature
- statement/create
- util/validation
- metadata
- validator
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
110 files changed
+9189
-81
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
55 | 55 | | |
56 | 56 | | |
57 | 57 | | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
58 | 65 | | |
59 | 66 | | |
60 | 67 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
14 | | - | |
15 | | - | |
| 14 | + | |
16 | 15 | | |
17 | 16 | | |
18 | 17 | | |
19 | 18 | | |
20 | 19 | | |
21 | | - | |
22 | | - | |
| 20 | + | |
| 21 | + | |
23 | 22 | | |
24 | 23 | | |
25 | | - | |
26 | | - | |
| 24 | + | |
| 25 | + | |
27 | 26 | | |
28 | 27 | | |
29 | | - | |
30 | | - | |
31 | | - | |
| 28 | + | |
| 29 | + | |
32 | 30 | | |
33 | 31 | | |
34 | | - | |
35 | | - | |
36 | | - | |
37 | | - | |
38 | | - | |
39 | | - | |
40 | | - | |
41 | | - | |
42 | | - | |
43 | | - | |
44 | | - | |
45 | | - | |
46 | | - | |
47 | | - | |
48 | | - | |
49 | | - | |
50 | | - | |
51 | | - | |
52 | | - | |
53 | | - | |
54 | | - | |
55 | | - | |
56 | | - | |
57 | | - | |
58 | | - | |
59 | | - | |
60 | | - | |
61 | 32 | | |
Lines changed: 49 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
Lines changed: 63 additions & 26 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
| 12 | + | |
12 | 13 | | |
13 | 14 | | |
14 | 15 | | |
| |||
29 | 30 | | |
30 | 31 | | |
31 | 32 | | |
32 | | - | |
33 | | - | |
34 | | - | |
35 | | - | |
36 | | - | |
| 33 | + | |
37 | 34 | | |
38 | 35 | | |
39 | 36 | | |
| |||
42 | 39 | | |
43 | 40 | | |
44 | 41 | | |
45 | | - | |
| 42 | + | |
46 | 43 | | |
47 | | - | |
48 | | - | |
| 44 | + | |
| 45 | + | |
49 | 46 | | |
50 | 47 | | |
51 | | - | |
| 48 | + | |
52 | 49 | | |
53 | 50 | | |
54 | 51 | | |
55 | | - | |
| 52 | + | |
56 | 53 | | |
57 | 54 | | |
58 | | - | |
| 55 | + | |
59 | 56 | | |
60 | 57 | | |
61 | 58 | | |
62 | | - | |
63 | | - | |
64 | | - | |
65 | | - | |
66 | | - | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
67 | 72 | | |
68 | 73 | | |
69 | 74 | | |
70 | | - | |
| 75 | + | |
71 | 76 | | |
72 | 77 | | |
73 | 78 | | |
| |||
78 | 83 | | |
79 | 84 | | |
80 | 85 | | |
81 | | - | |
| 86 | + | |
82 | 87 | | |
83 | 88 | | |
84 | 89 | | |
| |||
87 | 92 | | |
88 | 93 | | |
89 | 94 | | |
90 | | - | |
| 95 | + | |
91 | 96 | | |
92 | 97 | | |
93 | 98 | | |
| |||
99 | 104 | | |
100 | 105 | | |
101 | 106 | | |
102 | | - | |
| 107 | + | |
103 | 108 | | |
104 | 109 | | |
105 | 110 | | |
| |||
113 | 118 | | |
114 | 119 | | |
115 | 120 | | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
116 | 129 | | |
117 | 130 | | |
118 | 131 | | |
119 | 132 | | |
120 | 133 | | |
121 | | - | |
122 | | - | |
| 134 | + | |
123 | 135 | | |
124 | 136 | | |
125 | 137 | | |
126 | | - | |
| 138 | + | |
| 139 | + | |
127 | 140 | | |
128 | 141 | | |
129 | | - | |
| 142 | + | |
130 | 143 | | |
131 | 144 | | |
132 | 145 | | |
| |||
140 | 153 | | |
141 | 154 | | |
142 | 155 | | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
143 | 169 | | |
144 | 170 | | |
| 171 | + | |
| 172 | + | |
145 | 173 | | |
146 | 174 | | |
147 | | - | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
148 | 185 | | |
149 | 186 | | |
150 | 187 | | |
| |||
154 | 191 | | |
155 | 192 | | |
156 | 193 | | |
157 | | - | |
| 194 | + | |
158 | 195 | | |
159 | 196 | | |
160 | 197 | | |
| |||
0 commit comments