Examples of StringTemplate


Examples of com.gentics.cr.template.StringTemplate

      // we use the source attribute as template ...
    } else {
      if (template != null) {
        logger.debug("Using template configured using var: " + TRANSFORMER_TEMPLATE_KEY + ".");
        try {
          tpl = new StringTemplate(template);
        } catch (CRException e) {
          e.printStackTrace();
        }
      } else if (templatePath != null) {
        logger.debug("Using template: " + templatePath);
View Full Code Here

Examples of org.antlr.stringtemplate.StringTemplate

        qualifier,
        prefs);

    result.add(sql);

    StringTemplate st = new StringTemplate(ST_MODIFY_TABLE_TO_RECONSTRUCT);

    result.add(DialectUtils.bindTemplateAttributes(this, st, DialectUtils.getValuesMap(ST_TABLE_NAME_KEY,
      column.getTableName()), qualifier, prefs));

    // Ingres requires that columns that are to become not null must have a
View Full Code Here

Examples of org.antlr.stringtemplate.StringTemplate

    // "ALTER TABLE $childTableName$ " +
    // "ADD $constraint$ $constraintName$ FOREIGN KEY ( $childColumn; separator=\",\"$ ) " +
    // "REFERENCES $parentTableName$ ( $parentColumn; separator=\",\"$ )";

    StringTemplate fkST = new StringTemplate(ST_ADD_FOREIGN_KEY_CONSTRAINT_STYLE_ONE);
    HashMap<String, String> fkValuesMap = DialectUtils.getValuesMap(ST_CHILD_TABLE_KEY, localTableName);
    fkValuesMap.put(ST_CONSTRAINT_KEY, "CONSTRAINT");
    fkValuesMap.put(ST_CONSTRAINT_NAME_KEY, constraintName);
    fkValuesMap.put(ST_PARENT_TABLE_KEY, refTableName);

    StringTemplate childIndexST = null;
    HashMap<String, String> ckIndexValuesMap = null;

    if (autoFKIndex)
    {
      // "CREATE $unique$ $storageOption$ INDEX $indexName$ " +
      // "ON $tableName$ ( $columnName; separator=\",\"$ )";

      childIndexST = new StringTemplate(ST_CREATE_INDEX_STYLE_TWO);
      ckIndexValuesMap = new HashMap<String, String>();
      ckIndexValuesMap.put(ST_INDEX_NAME_KEY, "fk_child_idx");
    }

    return DialectUtils.getAddForeignKeyConstraintSQL(fkST,
View Full Code Here

Examples of org.antlr.stringtemplate.StringTemplate

    // alter table foo add constraint foocon UNIQUE (myid)

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

    StringTemplate st = new StringTemplate(ST_ADD_UNIQUE_CONSTRAINT_STYLE_TWO);

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

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

Examples of org.antlr.stringtemplate.StringTemplate

    String restart, String cache, boolean cycle, DatabaseObjectQualifier qualifier,
    SqlGenerationPreferences prefs)
  {
    // "ALTER SEQUENCE $sequenceName$ $startWith$ $increment$ $minimum$ $maximum$ $cache$ $cycle$";

    StringTemplate st = new StringTemplate(ST_ALTER_SEQUENCE_STYLE_TWO);

    OptionalSqlClause incClause = new OptionalSqlClause(DialectUtils.INCREMENT_BY_CLAUSE, increment);
    OptionalSqlClause minClause = new OptionalSqlClause(DialectUtils.MINVALUE_CLAUSE, minimum);
    OptionalSqlClause maxClause = new OptionalSqlClause(DialectUtils.MAXVALUE_CLAUSE, maximum);
    OptionalSqlClause cacheClause = new OptionalSqlClause(DialectUtils.CACHE_CLAUSE, cache);
View Full Code Here

Examples of org.antlr.stringtemplate.StringTemplate

    String start, String cache, boolean cycle, DatabaseObjectQualifier qualifier,
    SqlGenerationPreferences prefs)
  {
    // "CREATE SEQUENCE $sequenceName$ $startWith$ $increment$ $minimum$ $maximum$ $cache$ $cycle$";

    StringTemplate st = new StringTemplate(ST_CREATE_SEQUENCE_STYLE_TWO);

    OptionalSqlClause incClause = new OptionalSqlClause(DialectUtils.INCREMENT_BY_CLAUSE, increment);
    OptionalSqlClause minClause = new OptionalSqlClause(DialectUtils.MINVALUE_CLAUSE, minimum);
    OptionalSqlClause maxClause = new OptionalSqlClause(DialectUtils.MAXVALUE_CLAUSE, maximum);
    OptionalSqlClause cacheClause = new OptionalSqlClause(DialectUtils.CACHE_CLAUSE, cache);
View Full Code Here

Examples of org.antlr.stringtemplate.StringTemplate

    // [WITH CHECK OPTION]

    // "CREATE VIEW $viewName$ " +
    // "AS $selectStatement$ $with$ $checkOptionType$ $checkOption$";

    StringTemplate st = new StringTemplate(ST_CREATE_VIEW_STYLE_ONE);

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

    if (checkOption != null)
View Full Code Here

Examples of org.antlr.stringtemplate.StringTemplate

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

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

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

Examples of org.antlr.stringtemplate.StringTemplate

   */
  public String getDropViewSQL(String viewName, boolean cascade, DatabaseObjectQualifier qualifier,
    SqlGenerationPreferences prefs)
  {
    // "DROP VIEW $viewName$";
    StringTemplate st = new StringTemplate(ST_DROP_VIEW_STYLE_ONE);

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

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

Examples of org.antlr.stringtemplate.StringTemplate

   */
  public String[] getUpdateSQL(String tableName, String[] setColumns, String[] setValues,
    String[] fromTables, String[] whereColumns, String[] whereValues, DatabaseObjectQualifier qualifier,
    SqlGenerationPreferences prefs)
  {
    StringTemplate st = new StringTemplate(ST_UPDATE_CORRELATED_QUERY_STYLE_TWO);

    return DialectUtils.getUpdateSQL(st,
      tableName,
      setColumns,
      setValues,
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.