All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.modeshape.sequencer.ddl.StandardDdl.cnd Maven / Gradle / Ivy

The newest version!
/*
 * ModeShape (http://www.modeshape.org)
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *       http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
 
 //------------------------------------------------------------------------------
// N A M E S P A C E S
//------------------------------------------------------------------------------






//------------------------------------------------------------------------------
// N O D E T Y P E S
//------------------------------------------------------------------------------

[ddl:operation] mixin abstract

[ddl:operand] mixin abstract

// =============================================================================
// STATEMENT
// =============================================================================
[ddl:statement] mixin abstract
  - ddl:expression (string) mandatory                       // The string fragment encompassing the statement expression.
  - ddl:originalExpression (string)               // The string fragment encompassing the original statement expression.
  - ddl:startLineNumber (long) mandatory                    // The starting line number for the statement
  - ddl:startColumnNumber (long) mandatory                  // The starting column number for the statement
  - ddl:startCharIndex (long) mandatory                     // The starting content character index for the statement
  - ddl:length (long)  mandatory                           // The string length
  + ddl:problem (ddl:ddlProblem) = ddl:ddlProblem sns       // Problems encountered during parsing.

// =============================================================================
// CREATE, ALTER, DROP, INSERT, SET, GRANT, REVOKE
// =============================================================================
[ddl:creatable] > ddl:operation mixin abstract
[ddl:alterable] > ddl:operation mixin abstract
[ddl:droppable] > ddl:operation mixin abstract
  - ddl:dropBehavior (STRING)
  + ddl:dropOption (ddl:statementOption) = ddl:statementOption sns
[ddl:insertable] > ddl:operation mixin abstract
[ddl:settable]  > ddl:operation mixin abstract
[ddl:grantable] > ddl:operation mixin abstract
[ddl:revokable] > ddl:operation mixin abstract
[ddl:renamable] > ddl:operation mixin abstract
  - ddl:newName (STRING)

// =============================================================================
// OPERANDS:  SCHEMA, TABLE, DOMAIN, VIEW, ASSERTION, CHARACTER SET, COLLATION, TRANSLATION
// =============================================================================
[ddl:schemaOperand]             > ddl:operand mixin abstract
[ddl:tableOperand]              > ddl:operand mixin abstract
[ddl:domainOperand]             > ddl:operand mixin abstract
[ddl:viewOperand]               > ddl:operand mixin abstract
[ddl:assertionOperand]          > ddl:operand mixin abstract
[ddl:characterSetOperand]       > ddl:operand mixin abstract
[ddl:collationOperand]          > ddl:operand mixin abstract
[ddl:translationOperand]        > ddl:operand mixin abstract
[ddl:columnOperand]             > ddl:operand mixin abstract
[ddl:tableConstraintOperand]    > ddl:operand mixin abstract
[ddl:referenceOperand]          > ddl:operand mixin abstract


// =============================================================================
// SIMPLE STRING PROPERTY
// =============================================================================
[ddl:simpleProperty] mixin
  - ddl:propValue (STRING) mandatory

[ddl:constraintAttribute]       > ddl:simpleProperty mixin

// =============================================================================
// STATEMENT OPTION
// =============================================================================
[ddl:statementOption] mixin
  - ddl:value (STRING) mandatory

// =============================================================================
// UNKNOWN STATEMENT
// =============================================================================
[ddl:unknownStatement] mixin

// =============================================================================
// DDL PROBLEM
// =============================================================================
[ddl:ddlProblem] mixin
  - ddl:problemLevel (LONG) mandatory
  - ddl:message (STRING) mandatory

// =============================================================================
// COLUMN
// =============================================================================
[ddl:columnDefinition] > ddl:creatable, ddl:columnOperand mixin
  - ddl:datatypeName (STRING)
  - ddl:datatypeLength (LONG)
  - ddl:datatypePrecision (LONG)
  - ddl:datatypeScale (LONG)
  - ddl:nullable (STRING)
  - ddl:defaultOption (STRING) 
      < 'LITERAL', 'DATETIME', 'USER', 'CURRENT_USER', 'SESSION_USER', 'SYSTEM_USER', 'NULL'
  - ddl:defaultValue (STRING)
  - ddl:defaultPrecision (LONG)
  - ddl:collationName (STRING)
  + ddl:dropBehavior (ddl:simpleProperty) = ddl:simpleProperty
  + ddl:columnAttribute (ddl:simpleProperty) = ddl:simpleProperty sns

// =============================================================================
// TABLE CONSTRAINT
// =============================================================================
[ddl:tableConstraint] > ddl:creatable, ddl:tableConstraintOperand mixin
  - ddl:constraintType (STRING)
      < 'UNIQUE', 'PRIMARY KEY', 'FOREIGN KEY', 'CHECK'
  - ddl:deferrable (STRING)
      < 'DEFERRABLE', 'NOT DEFERRABLE'
  - ddl:checkSearchCondition (STRING)
      < 'INITIALLY DEFERRED', 'INITIALLY IMMEDIATE'
  + * (ddl:columnReference) = ddl:columnReference sns
  + * (ddl:tableReference) = ddl:tableReference
  + * (ddl:fkColumnReference) = ddl:fkColumnReference sns
  + ddl:constAttribute (ddl:constraintAttribute) = ddl:constraintAttribute sns
  
// =============================================================================
// REFERENCE
// =============================================================================
[ddl:columnReference]       > ddl:referenceOperand mixin
[ddl:tableReference]        > ddl:referenceOperand mixin
[ddl:fkColumnReference]     > ddl:referenceOperand mixin
[ddl:grantee]               > ddl:referenceOperand mixin

// =============================================================================
// CREATE SCHEMA
// =============================================================================
[ddl:createSchemaStatement] > ddl:statement, ddl:creatable, ddl:schemaOperand  mixin
  - ddl:defaultCharacterSetName (STRING)
  + * (ddl:statement) = ddl:statement sns

// =============================================================================
// CREATE TABLE
// =============================================================================
[ddl:createTableStatement] > ddl:statement, ddl:creatable, ddl:tableOperand mixin
  - ddl:temporary (STRING)
    < 'GLOBAL', 'LOCAL'
  - ddl:onCommitValue (STRING)
    < 'DELETE ROWS', 'PRESERVE ROWS'
  + * (ddl:columnDefinition) = ddl:columnDefinition sns
  + * (ddl:tableConstraint) = ddl:tableConstraint sns
  + * (ddl:statementOption) = ddl:statementOption sns 

// =============================================================================
// CREATE VIEW
// =============================================================================
[ddl:createViewStatement] > ddl:statement, ddl:creatable, ddl:viewOperand mixin
  - ddl:checkOption (STRING)
  + * (ddl:columnReference) = ddl:columnReference sns
  
// =============================================================================
// CREATE DOMAIN
// =============================================================================
[ddl:createDomainStatement] > ddl:statement, ddl:creatable, ddl:domainOperand mixin 
  - ddl:datatypeName (STRING) mandatory
  - ddl:datatypeLength (LONG)
  - ddl:datatypePrecision (LONG)
  - ddl:datatypeScale (LONG)
  - ddl:defaultOption (STRING)
      <  'LITERAL', 'DATETIME', 'USER', 'CURRENT_USER', 'SESSION_USER', 'SYSTEM_USER', 'NULL'
  - ddl:defaultValue (STRING)
  - ddl:defaultPrecision (LONG)
  - ddl:collationName (STRING)

// =============================================================================
// CREATE ASSERTION
// =============================================================================
[ddl:createAssertionStatement] > ddl:statement, ddl:creatable, ddl:tableConstraintOperand mixin
  - ddl:searchCondition (STRING) mandatory
  + ddl:constAttribute (ddl:constraintAttribute) = ddl:constraintAttribute sns

// =============================================================================
// CREATE CHARACTER SET
// =============================================================================
[ddl:createCharacterSetStatement] > ddl:statement, ddl:creatable, ddl:characterSetOperand mixin
  - ddl:existingName (STRING) mandatory
  - ddl:collateClause (STRING)                      // TODO: THIS IS COMPLEX, NEED TO BREAK DOWN
  - ddl:limitedCollationDefinition (STRING)         // TODO: THIS IS COMPLEX, NEED TO BREAK DOWN
  
// =============================================================================
// CREATE COLLATION
// =============================================================================
[ddl:createCollationStatement] > ddl:statement, ddl:creatable, ddl:collationOperand mixin
  - ddl:characterSetName (STRING) mandatory
  - ddl:collationSource (STRING)                    // TODO: THIS IS COMPLEX, NEED TO BREAK DOWN
  - ddl:padAttribute (STRING)
    < 'NO PAD', 'PAD SPACE'
    
// =============================================================================
// CREATE TRANSLATION
// =============================================================================
[ddl:createTranslationStatement] > ddl:statement, ddl:creatable, ddl:translationOperand mixin
  - ddl:sourceCharacterSetName (STRING) mandatory
  - ddl:targetCharacterSetName (STRING) mandatory
  - ddl:translationSource (STRING)                  // TODO: THIS IS COMPLEX, NEED TO BREAK DOWN
  
// =============================================================================
// ALTER TABLE
// =============================================================================
[ddl:alterTableStatement] > ddl:statement, ddl:alterable, ddl:tableOperand mixin
  + * (ddl:addColumnDefinition)             = ddl:addColumnDefinition sns
  + * (ddl:dropColumnDefinition)            = ddl:dropColumnDefinition sns
  + * (ddl:alterColumnDefinition)           = ddl:alterColumnDefinition sns
  + * (ddl:addTableConstraintDefinition)    = ddl:addTableConstraintDefinition sns
  + * (ddl:dropTableConstraintDefinition)   = ddl:dropTableConstraintDefinition sns
  + * (ddl:statementOption) = ddl:statementOption sns

// =============================================================================
// ALTER DOMAIN
// =============================================================================
[ddl:alterDomainStatement] > ddl:statement, ddl:alterable, ddl:domainOperand mixin
  - ddl:alterDomainAction (STRING)                  // TODO: THIS IS COMPLEX, NEED TO BREAK DOWN

// =============================================================================
// DROP STATEMENTS
// =============================================================================
[ddl:dropSchemaStatement]           > ddl:statement, ddl:droppable, ddl:schemaOperand mixin
[ddl:dropTableStatement]            > ddl:statement, ddl:droppable, ddl:tableOperand mixin
[ddl:dropViewStatement]             > ddl:statement, ddl:droppable, ddl:viewOperand mixin
[ddl:dropDomainStatement]           > ddl:statement, ddl:droppable, ddl:domainOperand mixin
[ddl:dropCharacterSetStatement]     > ddl:statement, ddl:droppable, ddl:characterSetOperand mixin
[ddl:dropCollationStatement]        > ddl:statement, ddl:droppable, ddl:collationOperand mixin
[ddl:dropTranslationStatement]      > ddl:statement, ddl:droppable, ddl:translationOperand mixin
[ddl:dropAssertionStatement]        > ddl:statement, ddl:droppable, ddl:assertionOperand mixin

[ddl:alterColumnDefinition]         > ddl:columnDefinition, ddl:alterable mixin
[ddl:addColumnDefinition]           > ddl:columnDefinition, ddl:creatable mixin
[ddl:dropColumnDefinition]          > ddl:columnDefinition, ddl:droppable mixin
[ddl:addTableConstraintDefinition]  > ddl:tableConstraint, ddl:creatable mixin
[ddl:dropTableConstraintDefinition] > ddl:tableConstraint, ddl:droppable mixin

// =============================================================================
// MISC STATEMENTS
// =============================================================================
[ddl:setStatement] > ddl:statement, ddl:settable mixin
   // TODO: THIS IS COMPLEX, NEED TO BREAK DOWN
   
[ddl:insertStatement] > ddl:statement, ddl:insertable mixin
   // TODO: THIS IS COMPLEX, NEED TO BREAK DOWN

// =============================================================================
// GRANT STATEMENTS
// =============================================================================

[ddl:grantPrivilege] mixin
  - ddl:type (STRING) mandatory
  + * (ddl:columnReference) = ddl:columnReference sns

[ddl:grantStatement] > ddl:statement, ddl:grantable mixin
  - ddl:allPrivileges (boolean)
  + * (ddl:grantPrivilege) = ddl:grantPrivilege sns
  + * (ddl:grantee) = ddl:grantee sns

[ddl:grantOnTableStatement]         > ddl:grantStatement, ddl:tableOperand mixin
[ddl:grantOnDomainStatement]        > ddl:grantStatement, ddl:domainOperand mixin
[ddl:grantOnCollationStatement]     > ddl:grantStatement, ddl:collationOperand mixin
[ddl:grantOnCharacterSetStatement]  > ddl:grantStatement, ddl:characterSetOperand mixin
[ddl:grantOnTranslationStatement]   > ddl:grantStatement, ddl:translationOperand mixin

// =============================================================================
// REVOKE STATEMENTS
// =============================================================================

[ddl:revokeStatement] > ddl:statement, ddl:revokable, ddl:droppable mixin
  - ddl:allPrivileges (boolean)
  + * (ddl:grantPrivilege) = ddl:grantPrivilege sns
  + * (ddl:grantee) = ddl:grantee sns

[ddl:revokeOnTableStatement]         > ddl:revokeStatement, ddl:tableOperand mixin
[ddl:revokeOnDomainStatement]        > ddl:revokeStatement, ddl:domainOperand mixin
[ddl:revokeOnCollationStatement]     > ddl:revokeStatement, ddl:collationOperand mixin
[ddl:revokeOnCharacterSetStatement]  > ddl:revokeStatement, ddl:characterSetOperand mixin
[ddl:revokeOnTranslationStatement]   > ddl:revokeStatement, ddl:translationOperand mixin




© 2015 - 2025 Weber Informatics LLC | Privacy Policy