提交 4263bc30 authored 作者: sainsbury.kerry's avatar sainsbury.kerry

Added missing javadoc

上级 a20ec938
...@@ -155,6 +155,13 @@ public class TableView extends Table { ...@@ -155,6 +155,13 @@ public class TableView extends Table {
return getDropSQL(false); return getDropSQL(false);
} }
/**
* Build a SQL statement to drop this object.
*
* @param cascade if true, then include the CASCADE clause in the DROP VIEW statement
*
* @return the SQL statement
*/
public String getDropSQL(boolean cascade) { public String getDropSQL(boolean cascade) {
StatementBuilder buff = new StatementBuilder("DROP VIEW IF EXISTS "); StatementBuilder buff = new StatementBuilder("DROP VIEW IF EXISTS ");
buff.append(getSQL()); buff.append(getSQL());
...@@ -168,6 +175,13 @@ public class TableView extends Table { ...@@ -168,6 +175,13 @@ public class TableView extends Table {
return getCreateSQL(false, true); return getCreateSQL(false, true);
} }
/**
* Generate "CREATE" SQL for the view
*
* @param orReplace if true, then include the OR REPLACE clause in the SQL
* @param force if true, then include the FORCE clause in the SQL
* @return the SQL
*/
public String getCreateSQL(boolean orReplace, boolean force) { public String getCreateSQL(boolean orReplace, boolean force) {
StatementBuilder buff = new StatementBuilder("CREATE "); StatementBuilder buff = new StatementBuilder("CREATE ");
if (orReplace) { if (orReplace) {
...@@ -388,4 +402,20 @@ public class TableView extends Table { ...@@ -388,4 +402,20 @@ public class TableView extends Table {
return viewQuery.isEverything(ExpressionVisitor.DETERMINISTIC); return viewQuery.isEverything(ExpressionVisitor.DETERMINISTIC);
} }
/**
* Indicate if this view makes use of the given schema
*
* @param schema the name to check for
* @return true of the view uses the given schema.
*/
public boolean usesSchema(Schema schema) {
boolean result = false;
for (Table table : tables) {
if (table.getSchema().equals(schema)) {
result = true;
break;
}
}
return result;
}
} }
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论