// "CREATE SEQUENCE $sequenceName$ " +
// "$increment$ $startWith$ $minimum$ $maximum$ $cache$ $cycle$";
final String templateStr = ST_CREATE_SEQUENCE_STYLE_TWO;
final StringTemplate startClauseTemplate = new StringTemplate("START WITH $startWith$ ,");
final OptionalSqlClause startClause =
new OptionalSqlClause(startClauseTemplate, ST_START_WITH_KEY, start);
final StringTemplate incrementByClauseTemplate = new StringTemplate("INCREMENT BY $incrementBy$ ,");
final OptionalSqlClause incrementClause =
new OptionalSqlClause(incrementByClauseTemplate, ST_INCREMENT_BY_KEY, increment);
final StringTemplate maxClauseTemplate = new StringTemplate("MAXVALUE $maximum$ ,");
final OptionalSqlClause maxClause = new OptionalSqlClause(maxClauseTemplate, ST_MAXIMUM_KEY, maximum);
final StringTemplate minClauseTemplate = new StringTemplate("MINVALUE $minimum$ ,");
final OptionalSqlClause minClause = new OptionalSqlClause(minClauseTemplate, ST_MINIMUM_KEY, minimum);
final StringTemplate st = new StringTemplate(templateStr);
st.setAttribute(ST_SEQUENCE_NAME_KEY, "PUB." + sequenceName);
st.setAttribute(ST_START_WITH_KEY, startClause.toString());
st.setAttribute(ST_INCREMENT_KEY, incrementClause.toString());
st.setAttribute(ST_MAXIMUM_KEY, maxClause.toString());
st.setAttribute(ST_MINIMUM_KEY, minClause.toString());
if (cycle)
{
st.setAttribute(ST_CYCLE_KEY, "CYCLE");
}
else
{
st.setAttribute(ST_CYCLE_KEY, "NOCYCLE");
}
return st.toString();
}