SQM 'insert select', 'insert values', and 'update' queries
This commit is contained in:
parent
02cd346d3f
commit
b3254a2fa6
|
@ -35,16 +35,16 @@ subQuery
|
|||
: querySpec
|
||||
;
|
||||
|
||||
rootEntity
|
||||
dmlTarget
|
||||
: entityName identificationVariableDef?
|
||||
;
|
||||
|
||||
deleteStatement
|
||||
: DELETE FROM? rootEntity whereClause?
|
||||
: DELETE FROM? dmlTarget whereClause?
|
||||
;
|
||||
|
||||
updateStatement
|
||||
: UPDATE rootEntity setClause whereClause?
|
||||
: UPDATE dmlTarget setClause whereClause?
|
||||
;
|
||||
|
||||
setClause
|
||||
|
@ -56,7 +56,7 @@ assignment
|
|||
;
|
||||
|
||||
insertStatement
|
||||
: INSERT INTO? rootEntity targetFieldsSpec (querySpec | valuesList)
|
||||
: INSERT INTO? dmlTarget targetFieldsSpec (querySpec | valuesList)
|
||||
;
|
||||
|
||||
targetFieldsSpec
|
||||
|
|
|
@ -309,8 +309,8 @@ public class SemanticQueryBuilder extends HqlParserBaseVisitor implements SqmCre
|
|||
public SqmInsertStatement visitInsertStatement(HqlParser.InsertStatementContext ctx) {
|
||||
|
||||
final SqmRoot<?> root = new SqmRoot<>(
|
||||
visitEntityName( ctx.rootEntity().entityName() ),
|
||||
visitIdentificationVariableDef( ctx.rootEntity().identificationVariableDef() ),
|
||||
visitEntityName( ctx.dmlTarget().entityName() ),
|
||||
visitIdentificationVariableDef( ctx.dmlTarget().identificationVariableDef() ),
|
||||
creationContext.getNodeBuilder()
|
||||
);
|
||||
|
||||
|
@ -379,8 +379,8 @@ public class SemanticQueryBuilder extends HqlParserBaseVisitor implements SqmCre
|
|||
@Override
|
||||
public SqmUpdateStatement visitUpdateStatement(HqlParser.UpdateStatementContext ctx) {
|
||||
final SqmRoot<?> root = new SqmRoot<>(
|
||||
visitEntityName( ctx.rootEntity().entityName() ),
|
||||
visitIdentificationVariableDef( ctx.rootEntity().identificationVariableDef() ),
|
||||
visitEntityName( ctx.dmlTarget().entityName() ),
|
||||
visitIdentificationVariableDef( ctx.dmlTarget().identificationVariableDef() ),
|
||||
creationContext.getNodeBuilder()
|
||||
);
|
||||
|
||||
|
@ -413,8 +413,8 @@ public class SemanticQueryBuilder extends HqlParserBaseVisitor implements SqmCre
|
|||
@Override
|
||||
public SqmDeleteStatement visitDeleteStatement(HqlParser.DeleteStatementContext ctx) {
|
||||
final SqmRoot<?> root = new SqmRoot<>(
|
||||
visitEntityName( ctx.rootEntity().entityName() ),
|
||||
visitIdentificationVariableDef( ctx.rootEntity().identificationVariableDef() ),
|
||||
visitEntityName( ctx.dmlTarget().entityName() ),
|
||||
visitIdentificationVariableDef( ctx.dmlTarget().identificationVariableDef() ),
|
||||
creationContext.getNodeBuilder()
|
||||
);
|
||||
|
||||
|
|
Loading…
Reference in New Issue