Package org.antlr.stringtemplate

Examples of org.antlr.stringtemplate.StringTemplate


   */
  @Override
  public String getDropIndexSQL(String tableName, String indexName, boolean cascade,
    DatabaseObjectQualifier qualifier, SqlGenerationPreferences prefs)
  {
    StringTemplate st = new StringTemplate(ST_DROP_INDEX_STYLE_TWO);
    HashMap<String, String> valuesMap = new HashMap<String, String>();
    valuesMap.put(ST_INDEX_NAME_KEY, indexName);
    valuesMap.put(ST_TABLE_NAME_KEY, tableName);
    return DialectUtils.bindAttributes(this, st, valuesMap, qualifier, prefs);
  }
View Full Code Here


    // "ALTER TABLE $tableName$ " +
    // "ADD CONSTRAINT $constraintName$ UNIQUE ($columnName; separator=\",\"$)";

    final String templateStr = ST_ADD_UNIQUE_CONSTRAINT_STYLE_TWO;

    final StringTemplate st = new StringTemplate(templateStr);

    final String quotedConstraint = DialectUtils.shapeIdentifier(constraintName, prefs, this);

    final HashMap<String, String> valuesMap =
      DialectUtils.getValuesMap(ST_TABLE_NAME_KEY, tableName, ST_CONSTRAINT_NAME_KEY, quotedConstraint);
View Full Code Here

    // CREATE VIEW name [(view_col [, view_col …])]
    // AS <select> [WITH CHECK OPTION];

    // "CREATE VIEW $viewName$ " +
    // "AS $selectStatement$ $withCheckOption$";
    final StringTemplate st = new StringTemplate(ST_CREATE_VIEW_STYLE_TWO);

    final HashMap<String, String> valuesMap =
      DialectUtils.getValuesMap(ST_VIEW_NAME_KEY, viewName, ST_SELECT_STATEMENT_KEY, definition);

    if (checkOption != null)
View Full Code Here

   */
  @Override
  public String getDropIndexSQL(final String tableName, final String indexName, final boolean cascade,
    final DatabaseObjectQualifier qualifier, final SqlGenerationPreferences prefs)
  {
    final StringTemplate st = new StringTemplate(ST_DROP_INDEX_STYLE_TWO);
    st.setAttribute(ST_INDEX_NAME_KEY, indexName);
    st.setAttribute(ST_TABLE_NAME_KEY, tableName);
    return st.toString();
  }
View Full Code Here

  @Override
  public String getRenameTableSQL(final String oldTableName, final String newTableName,
    final DatabaseObjectQualifier qualifier, final SqlGenerationPreferences prefs)
  {
    // "ALTER TABLE $oldObjectName$ RENAME TO $newObjectName$";
    final StringTemplate st = new StringTemplate(ST_RENAME_OBJECT_STYLE_ONE);

    final HashMap<String, String> valuesMap =
      DialectUtils.getValuesMap(ST_OLD_OBJECT_NAME_KEY, oldTableName, ST_NEW_OBJECT_NAME_KEY, newTableName);

    return DialectUtils.bindTemplateAttributes(this, st, valuesMap, qualifier, prefs);
View Full Code Here

  @Test
  public void testOptionalSqlClauseStringTemplateStringString()
  {
    String staticPart = "A test template ";
    StringTemplate st = new StringTemplate(staticPart + "$subst$");
   
    String key = "subst";
    String value = "works!";
   
    classUnderTest = new OptionalSqlClause(st, key, value);
View Full Code Here

    // "ALTER TABLE $tableName$ " +
    // "ADD CONSTRAINT $constraintName$ UNIQUE ($columnName; separator=\",\"$)";

    final String templateStr = ST_ADD_UNIQUE_CONSTRAINT_STYLE_TWO;

    final StringTemplate st = new StringTemplate(templateStr);

    final HashMap<String, String> valuesMap =
      DialectUtils.getValuesMap(ST_TABLE_NAME_KEY, tableName, ST_CONSTRAINT_NAME_KEY, constraintName);

    return new String[] { DialectUtils.getAddUniqueConstraintSQL(st, valuesMap, columns, qualifier, prefs,
View Full Code Here

  @Override
  public String getDropSequenceSQL(final String sequenceName, final boolean cascade,
    final DatabaseObjectQualifier qualifier, final SqlGenerationPreferences prefs)
  {
    // "DROP SEQUENCE $sequenceName$ $cascade$";
    final StringTemplate st = new StringTemplate(ST_DROP_SEQUENCE_STYLE_ONE);

    final HashMap<String, String> valuesMap = DialectUtils.getValuesMap(ST_SEQUENCE_NAME_KEY, sequenceName);

    return DialectUtils.bindTemplateAttributes(this, st, valuesMap, qualifier, prefs);
  }
View Full Code Here

   *      java.lang.String, DatabaseObjectQualifier, SqlGenerationPreferences)
   */
  public String getColumnDropSQL(String tableName, String columnName, DatabaseObjectQualifier qualifier,
    SqlGenerationPreferences prefs) throws UnsupportedOperationException
  {
    StringTemplate st = new StringTemplate(DROP_COLUMN_SQL_TEMPLATE);

    HashMap<String, String> valuesMap =
      DialectUtils.getValuesMap(ST_TABLE_NAME_KEY, tableName, ST_COLUMN_NAME_KEY, columnName);

    String dropSql = DialectUtils.bindTemplateAttributes(this, st, valuesMap, qualifier, prefs);
View Full Code Here

   */
  public String getDropIndexSQL(String tableName, String indexName, boolean cascade,
    DatabaseObjectQualifier qualifier, SqlGenerationPreferences prefs)
  {
    // "DROP INDEX $indexName$";
    StringTemplate st = new StringTemplate(ST_DROP_INDEX_STYLE_THREE);

    HashMap<String, String> valuesMap = DialectUtils.getValuesMap(ST_INDEX_NAME_KEY, indexName);

    return DialectUtils.bindTemplateAttributes(this, st, valuesMap, qualifier, prefs);
  }
View Full Code Here

TOP

Related Classes of org.antlr.stringtemplate.StringTemplate

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.