Examples of StringTemplate


Examples of org.antlr.stringtemplate.StringTemplate

  public String[] getAddForeignKeyConstraintSQL(String localTableName, String refTableName,
    String constraintName, Boolean deferrable, Boolean initiallyDeferred, Boolean matchFull,
    boolean autoFKIndex, String fkIndexName, Collection<String[]> localRefColumns, String onUpdateAction,
    String onDeleteAction, DatabaseObjectQualifier qualifier, SqlGenerationPreferences prefs)
  {
    StringTemplate st = new StringTemplate(ST_ADD_FOREIGN_KEY_CONSTRAINT_STYLE_ONE);

    HashMap<String, String> fkValuesMap = new HashMap<String, String>();
    fkValuesMap.put("childTableName", localTableName);
    fkValuesMap.put("constraint", "CONSTRAINT");
    fkValuesMap.put("constraintName", constraintName);
    fkValuesMap.put("parentTableName", refTableName);

    // TODO: create the child index ST
    StringTemplate childIndexST = null;
    HashMap<String, String> ckIndexValuesMap = null;

    return DialectUtils.getAddForeignKeyConstraintSQL(st,
      fkValuesMap,
      childIndexST,
View Full Code Here

Examples of org.antlr.stringtemplate.StringTemplate

   */
  @Override
  public String[] getAddUniqueConstraintSQL(String tableName, String constraintName,
    TableColumnInfo[] columns, DatabaseObjectQualifier qualifier, SqlGenerationPreferences prefs)
  {
    StringTemplate st = new StringTemplate(ST_ADD_UNIQUE_CONSTRAINT_STYLE_TWO);

    HashMap<String, String> valuesMap = new HashMap<String, String>();

    valuesMap.put(ST_TABLE_NAME_KEY, tableName);
    valuesMap.put(ST_CONSTRAINT_NAME_KEY, constraintName);
View Full Code Here

Examples of org.antlr.stringtemplate.StringTemplate

  @Override
  public String getCreateIndexSQL(String indexName, String tableName, String accessMethod, String[] columns,
    boolean unique, String tablespace, String constraints, DatabaseObjectQualifier qualifier,
    SqlGenerationPreferences prefs)
  {
    StringTemplate st = new StringTemplate(ST_CREATE_INDEX_STYLE_TWO);

    HashMap<String, String> valuesMap = new HashMap<String, String>();
    if (unique)
    {
      valuesMap.put(ST_UNIQUE_KEY, "UNIQUE");
View Full Code Here

Examples of org.antlr.stringtemplate.StringTemplate

   */
  @Override
  public String getCreateViewSQL(String viewName, String definition, String checkOption,
    DatabaseObjectQualifier qualifier, SqlGenerationPreferences prefs)
  {
    StringTemplate st = new StringTemplate(ST_CREATE_VIEW_STYLE_ONE);

    HashMap<String, String> valuesMap = new HashMap<String, String>();
    valuesMap.put("viewName", viewName);
    valuesMap.put("selectStatement", definition);
    if (checkOption != null && !"".equals(checkOption))
View Full Code Here

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);
    st.setAttribute(ST_INDEX_NAME_KEY, indexName);
    st.setAttribute(ST_TABLE_NAME_KEY, tableName);
    return st.toString();
  }
View Full Code Here

Examples of org.antlr.stringtemplate.StringTemplate

   */
  @Override
  public String getRenameTableSQL(String oldTableName, String newTableName,
    DatabaseObjectQualifier qualifier, SqlGenerationPreferences prefs)
  {
    StringTemplate st = new StringTemplate(ST_SP_RENAME_STYLE_ONE);
    HashMap<String, String> valuesMap = new HashMap<String, String>();

    valuesMap.put(ST_OLD_OBJECT_NAME_KEY, oldTableName);
    valuesMap.put(ST_NEW_OBJECT_NAME_KEY, newTableName);

View Full Code Here

Examples of org.antlr.stringtemplate.StringTemplate

   */
  @Override
  public String[] getRenameViewSQL(String oldViewName, String newViewName,
    DatabaseObjectQualifier qualifier, SqlGenerationPreferences prefs)
  {
    StringTemplate st = new StringTemplate(ST_SP_RENAME_STYLE_ONE);
    HashMap<String, String> valuesMap = new HashMap<String, String>();

    valuesMap.put(ST_OLD_OBJECT_NAME_KEY, oldViewName);
    valuesMap.put(ST_NEW_OBJECT_NAME_KEY, newViewName);

View Full Code Here

Examples of org.antlr.stringtemplate.StringTemplate

      templateStr = ST_UPDATE_CORRELATED_QUERY_STYLE_TWO;
    } else {
      templateStr = ST_UPDATE_STYLE_ONE;
    }
     
    StringTemplate st = new StringTemplate(templateStr);
   
    return DialectUtils.getUpdateSQL(st,
      tableName,
      setColumns,
      setValues,
View Full Code Here

Examples of org.antlr.stringtemplate.StringTemplate

    String sql =
      "select text from sysobjects inner join syscomments on syscomments.id = sysobjects.id "
        + "where (loginame = '$catalogName$' or loginame is null) " +
            "and name = '$viewName$' and text not like '%--%'";   

    StringTemplate st = new StringTemplate(sql);
    st.setAttribute(ST_CATALOG_NAME_KEY, qualifier.getCatalog());
    st.setAttribute(ST_VIEW_NAME_KEY, viewName);

    return st.toString();
  }
View Full Code Here

Examples of org.antlr.stringtemplate.StringTemplate

   
    String trigTemplate =
      "CREATE TRIGGER $triggerName$ FOR $tableName$ BEFORE INSERT POSITION 0 AS "
        + "BEGIN NEW.$columnName$ = GEN_ID($sequenceName$, 1); END";

    StringTemplate st = new StringTemplate(trigTemplate);

    HashMap<String, String> valuesMap =
      DialectUtils.getValuesMap(ST_COLUMN_NAME_KEY, column.getColumnName());

    valuesMap.put(ST_TABLE_NAME_KEY, column.getTableName());
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.