public class SqlTableConstraint
extends org.apache.calcite.sql.SqlCall
Syntax from SQL-2011 IWD 9075-2:201?(E) 11.3 <table definition>:
<table constraint definition> ::=
[ <constraint name definition> ] <table constraint>
[ <constraint characteristics> ]
<table constraint> ::=
<unique constraint definition>
<unique constraint definition> ::=
<unique specification> <left paren> <unique column list> <right paren>
<unique specification> ::=
UNIQUE
| PRIMARY KEY
| Constructor and Description |
|---|
SqlTableConstraint(org.apache.calcite.sql.SqlIdentifier constraintName,
org.apache.calcite.sql.SqlLiteral uniqueSpec,
org.apache.calcite.sql.SqlNodeList columns,
org.apache.calcite.sql.SqlLiteral enforcement,
boolean isTableConstraint,
org.apache.calcite.sql.parser.SqlParserPos pos)
Creates a table constraint node.
|
| Modifier and Type | Method and Description |
|---|---|
String[] |
getColumnNames()
Returns the columns as a string array.
|
org.apache.calcite.sql.SqlNodeList |
getColumns() |
Optional<String> |
getConstraintName() |
Optional<org.apache.calcite.sql.SqlIdentifier> |
getConstraintNameIdentifier() |
List<org.apache.calcite.sql.SqlNode> |
getOperandList() |
org.apache.calcite.sql.SqlOperator |
getOperator() |
boolean |
isEnforced()
Returns whether the constraint is enforced.
|
boolean |
isPrimaryKey()
Returns whether the constraint is PRIMARY KEY.
|
boolean |
isTableConstraint() |
boolean |
isUnique()
Returns whether the constraint is UNIQUE.
|
void |
unparse(org.apache.calcite.sql.SqlWriter writer,
int leftPrec,
int rightPrec) |
accept, clone, equalsDeep, findValidOptions, getCallSignature, getFunctionQuantifier, getKind, getMonotonicity, isCountStar, isExpanded, operand, operandCount, setOperand, validatepublic SqlTableConstraint(@Nullable org.apache.calcite.sql.SqlIdentifier constraintName, org.apache.calcite.sql.SqlLiteral uniqueSpec, org.apache.calcite.sql.SqlNodeList columns, @Nullable org.apache.calcite.sql.SqlLiteral enforcement, boolean isTableConstraint, org.apache.calcite.sql.parser.SqlParserPos pos)
constraintName - Constraint nameuniqueSpec - Unique specificationcolumns - Column list on which the constraint enforces or null if this is a column
constraintenforcement - Whether the constraint is enforcedisTableConstraint - Whether this is a table constraintpos - Parser positionpublic org.apache.calcite.sql.SqlOperator getOperator()
getOperator in class org.apache.calcite.sql.SqlCallpublic boolean isUnique()
public boolean isPrimaryKey()
public boolean isEnforced()
public Optional<org.apache.calcite.sql.SqlIdentifier> getConstraintNameIdentifier()
public org.apache.calcite.sql.SqlNodeList getColumns()
public boolean isTableConstraint()
public String[] getColumnNames()
public List<org.apache.calcite.sql.SqlNode> getOperandList()
getOperandList in class org.apache.calcite.sql.SqlCallpublic void unparse(org.apache.calcite.sql.SqlWriter writer,
int leftPrec,
int rightPrec)
unparse in class org.apache.calcite.sql.SqlCallCopyright © 2014–2024 The Apache Software Foundation. All rights reserved.