Merged V2.2 to HEAD

7629: QName Refactor Merge 6 of 9
   7630: QName Refactor Merge 7 of 9
   7631: QName Refactor Merge 8 of 9
   7632: QName Refactor Merge 9 of 9


git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@8438 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Derek Hulley
2008-03-06 19:11:36 +00:00
parent 00e81c0d66
commit d389ff1936
30 changed files with 805 additions and 746 deletions

View File

@@ -654,7 +654,7 @@ public class SchemaBootstrap extends AbstractLifecycleBean
}
InputStream scriptInputStream = new FileInputStream(scriptFile);
BufferedReader reader = new BufferedReader(new InputStreamReader(scriptInputStream, "UTF8"));
BufferedReader reader = new BufferedReader(new InputStreamReader(scriptInputStream, "UTF-8"));
try
{
int line = 0;
@@ -695,11 +695,21 @@ public class SchemaBootstrap extends AbstractLifecycleBean
execute = true;
optional = false;
}
else if (sql.endsWith(";(optional)"))
else if (sql.endsWith("(optional)") || sql.endsWith("(OPTIONAL)"))
{
sql = sql.substring(0, sql.length() - 11);
execute = true;
optional = true;
// Get the end of statement
int endIndex = sql.lastIndexOf(';');
if (endIndex > 0)
{
sql = sql.substring(0, endIndex);
execute = true;
optional = true;
}
else
{
// Ends with "(optional)" but there is no semi-colon.
// Just take it at face value and probably fail.
}
}
// append to the statement being built up
sb.append(" ").append(sql);