提交 4f34f37d authored 作者: Evgenij Ryazanov's avatar Evgenij Ryazanov

Add DbObject.getSQL(StringBuilder)

上级 3d3df51c
...@@ -101,6 +101,16 @@ public interface DbObject { ...@@ -101,6 +101,16 @@ public interface DbObject {
*/ */
String getSQL(); String getSQL();
/**
* Appends the SQL name of this object (may be quoted) to the specified
* builder.
*
* @param builder
* string builder
* @return the specified string builder
*/
StringBuilder getSQL(StringBuilder builder);
/** /**
* Get the list of dependent children (for tables, this includes indexes and * Get the list of dependent children (for tables, this includes indexes and
* so on). * so on).
......
...@@ -104,6 +104,11 @@ public abstract class DbObjectBase implements DbObject { ...@@ -104,6 +104,11 @@ public abstract class DbObjectBase implements DbObject {
return Parser.quoteIdentifier(objectName); return Parser.quoteIdentifier(objectName);
} }
@Override
public StringBuilder getSQL(StringBuilder builder) {
return Parser.quoteIdentifier(builder, objectName);
}
@Override @Override
public ArrayList<DbObject> getChildren() { public ArrayList<DbObject> getChildren() {
return null; return null;
......
...@@ -36,7 +36,13 @@ public abstract class SchemaObjectBase extends DbObjectBase implements ...@@ -36,7 +36,13 @@ public abstract class SchemaObjectBase extends DbObjectBase implements
@Override @Override
public String getSQL() { public String getSQL() {
return schema.getSQL() + "." + super.getSQL(); return getSQL(new StringBuilder()).toString();
}
@Override
public StringBuilder getSQL(StringBuilder builder) {
schema.getSQL(builder).append('.');
return super.getSQL(builder);
} }
@Override @Override
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论