提交 6e8730ae authored 作者: Thomas Mueller's avatar Thomas Mueller

boolean getX > isX

上级 d57c80c0
...@@ -433,7 +433,7 @@ public class Column { ...@@ -433,7 +433,7 @@ public class Column {
return buff.toString(); return buff.toString();
} }
public boolean getNullable() { public boolean isNullable() {
return nullable; return nullable;
} }
...@@ -449,7 +449,7 @@ public class Column { ...@@ -449,7 +449,7 @@ public class Column {
return defaultExpression; return defaultExpression;
} }
public boolean getAutoIncrement() { public boolean isAutoIncrement() {
return autoIncrement; return autoIncrement;
} }
...@@ -625,7 +625,7 @@ public class Column { ...@@ -625,7 +625,7 @@ public class Column {
return true; return true;
} }
public boolean getPrimaryKey() { public boolean isPrimaryKey() {
return primaryKey; return primaryKey;
} }
......
...@@ -623,8 +623,8 @@ public class MetaTable extends Table { ...@@ -623,8 +623,8 @@ public class MetaTable extends Table {
continue; continue;
} }
String storageType; String storageType;
if (table.getTemporary()) { if (table.isTemporary()) {
if (table.getGlobalTemporary()) { if (table.isGlobalTemporary()) {
storageType = "GLOBAL TEMPORARY"; storageType = "GLOBAL TEMPORARY";
} else { } else {
storageType = "LOCAL TEMPORARY"; storageType = "LOCAL TEMPORARY";
...@@ -680,7 +680,7 @@ public class MetaTable extends Table { ...@@ -680,7 +680,7 @@ public class MetaTable extends Table {
// COLUMN_DEFAULT // COLUMN_DEFAULT
c.getDefaultSQL(), c.getDefaultSQL(),
// IS_NULLABLE // IS_NULLABLE
c.getNullable() ? "YES" : "NO", c.isNullable() ? "YES" : "NO",
// DATA_TYPE // DATA_TYPE
"" + DataType.convertTypeToSQLType(c.getType()), "" + DataType.convertTypeToSQLType(c.getType()),
// CHARACTER_MAXIMUM_LENGTH // CHARACTER_MAXIMUM_LENGTH
...@@ -700,7 +700,7 @@ public class MetaTable extends Table { ...@@ -700,7 +700,7 @@ public class MetaTable extends Table {
// TYPE_NAME // TYPE_NAME
identifier(DataType.getDataType(c.getType()).name), identifier(DataType.getDataType(c.getType()).name),
// NULLABLE // NULLABLE
"" + (c.getNullable() ? DatabaseMetaData.columnNullable : DatabaseMetaData.columnNoNulls) , "" + (c.isNullable() ? DatabaseMetaData.columnNullable : DatabaseMetaData.columnNoNulls) ,
// IS_COMPUTED // IS_COMPUTED
"" + (c.getComputed() ? "TRUE" : "FALSE"), "" + (c.getComputed() ? "TRUE" : "FALSE"),
// SELECTIVITY // SELECTIVITY
...@@ -748,7 +748,7 @@ public class MetaTable extends Table { ...@@ -748,7 +748,7 @@ public class MetaTable extends Table {
// TABLE_NAME // TABLE_NAME
tableName, tableName,
// NON_UNIQUE // NON_UNIQUE
index.getIndexType().getUnique() ? "FALSE" : "TRUE", index.getIndexType().isUnique() ? "FALSE" : "TRUE",
// INDEX_NAME // INDEX_NAME
identifier(index.getName()), identifier(index.getName()),
// ORDINAL_POSITION // ORDINAL_POSITION
...@@ -758,7 +758,7 @@ public class MetaTable extends Table { ...@@ -758,7 +758,7 @@ public class MetaTable extends Table {
// CARDINALITY // CARDINALITY
"0", "0",
// PRIMARY_KEY // PRIMARY_KEY
index.getIndexType().getPrimaryKey() ? "TRUE" : "FALSE", index.getIndexType().isPrimaryKey() ? "TRUE" : "FALSE",
// INDEX_TYPE_NAME // INDEX_TYPE_NAME
index.getIndexType().getSQL(), index.getIndexType().getSQL(),
// IS_GENERATED // IS_GENERATED
...@@ -813,7 +813,7 @@ public class MetaTable extends Table { ...@@ -813,7 +813,7 @@ public class MetaTable extends Table {
add(rows, new String[]{"info.VERSION_MAJOR", "" + Constants.VERSION_MAJOR}); add(rows, new String[]{"info.VERSION_MAJOR", "" + Constants.VERSION_MAJOR});
add(rows, new String[]{"info.VERSION_MINOR", "" + Constants.VERSION_MINOR}); add(rows, new String[]{"info.VERSION_MINOR", "" + Constants.VERSION_MINOR});
add(rows, new String[]{"info.VERSION", "" + Constants.getFullVersion()}); add(rows, new String[]{"info.VERSION", "" + Constants.getFullVersion()});
if (session.getUser().getAdmin()) { if (session.getUser().isAdmin()) {
String[] settings = new String[]{ String[] settings = new String[]{
"java.runtime.version", "java.runtime.version",
"java.vm.name", "java.vendor", "java.vm.name", "java.vendor",
...@@ -864,7 +864,7 @@ public class MetaTable extends Table { ...@@ -864,7 +864,7 @@ public class MetaTable extends Table {
DiskFile dataFile = database.getDataFile(); DiskFile dataFile = database.getDataFile();
if (dataFile != null) { if (dataFile != null) {
add(rows, new String[] { "CACHE_TYPE", dataFile.getCache().getTypeName() }); add(rows, new String[] { "CACHE_TYPE", dataFile.getCache().getTypeName() });
if (session.getUser().getAdmin()) { if (session.getUser().isAdmin()) {
DiskFile indexFile = database.getIndexFile(); DiskFile indexFile = database.getIndexFile();
add(rows, new String[]{"info.FILE_DISK_WRITE", "" + dataFile.getWriteCount()}); add(rows, new String[]{"info.FILE_DISK_WRITE", "" + dataFile.getWriteCount()});
add(rows, new String[]{"info.FILE_DISK_READ", "" + dataFile.getReadCount()}); add(rows, new String[]{"info.FILE_DISK_READ", "" + dataFile.getReadCount()});
...@@ -973,7 +973,7 @@ public class MetaTable extends Table { ...@@ -973,7 +973,7 @@ public class MetaTable extends Table {
// NAME // NAME
identifier(u.getName()), identifier(u.getName()),
// ADMIN // ADMIN
String.valueOf(u.getAdmin()), String.valueOf(u.isAdmin()),
// REMARKS // REMARKS
replaceNullWithEmpty(u.getComment()), replaceNullWithEmpty(u.getComment()),
// ID // ID
...@@ -1239,7 +1239,7 @@ public class MetaTable extends Table { ...@@ -1239,7 +1239,7 @@ public class MetaTable extends Table {
// IS_UPDATABLE // IS_UPDATABLE
"NO", "NO",
// STATUS // STATUS
view.getInvalid() ? "INVALID" : "VALID", view.isInvalid() ? "INVALID" : "VALID",
// REMARKS // REMARKS
replaceNullWithEmpty(view.getComment()), replaceNullWithEmpty(view.getComment()),
// ID // ID
...@@ -1412,7 +1412,7 @@ public class MetaTable extends Table { ...@@ -1412,7 +1412,7 @@ public class MetaTable extends Table {
// COLUMN_DEFAULT // COLUMN_DEFAULT
col.getDefaultSQL(), col.getDefaultSQL(),
// IS_NULLABLE // IS_NULLABLE
col.getNullable() ? "YES" : "NO", col.isNullable() ? "YES" : "NO",
// DATA_TYPE // DATA_TYPE
"" + col.getDataType().sqlType, "" + col.getDataType().sqlType,
// PRECISION INT // PRECISION INT
...@@ -1455,13 +1455,13 @@ public class MetaTable extends Table { ...@@ -1455,13 +1455,13 @@ public class MetaTable extends Table {
// TABLE_NAME // TABLE_NAME
identifier(table.getName()), identifier(table.getName()),
// BEFORE BIT // BEFORE BIT
"" + trigger.getBefore(), "" + trigger.isBefore(),
// JAVA_CLASS // JAVA_CLASS
trigger.getTriggerClassName(), trigger.getTriggerClassName(),
// QUEUE_SIZE INT // QUEUE_SIZE INT
"" + trigger.getQueueSize(), "" + trigger.getQueueSize(),
// NO_WAIT BIT // NO_WAIT BIT
"" + trigger.getNoWait(), "" + trigger.isNoWait(),
// REMARKS // REMARKS
replaceNullWithEmpty(trigger.getComment()), replaceNullWithEmpty(trigger.getComment()),
// SQL // SQL
...@@ -1473,7 +1473,7 @@ public class MetaTable extends Table { ...@@ -1473,7 +1473,7 @@ public class MetaTable extends Table {
break; break;
} }
case SESSIONS: { case SESSIONS: {
boolean admin = session.getUser().getAdmin(); boolean admin = session.getUser().isAdmin();
for (Session s : database.getSessions(false)) { for (Session s : database.getSessions(false)) {
if (admin || s == session) { if (admin || s == session) {
Command command = s.getCurrentCommand(); Command command = s.getCurrentCommand();
...@@ -1494,7 +1494,7 @@ public class MetaTable extends Table { ...@@ -1494,7 +1494,7 @@ public class MetaTable extends Table {
break; break;
} }
case LOCKS: { case LOCKS: {
boolean admin = session.getUser().getAdmin(); boolean admin = session.getUser().isAdmin();
for (Session s : database.getSessions(false)) { for (Session s : database.getSessions(false)) {
if (admin || s == session) { if (admin || s == session) {
for (Table table : s.getLocks()) { for (Table table : s.getLocks()) {
...@@ -1618,7 +1618,7 @@ public class MetaTable extends Table { ...@@ -1618,7 +1618,7 @@ public class MetaTable extends Table {
String isGrantable = "NO"; String isGrantable = "NO";
if (grantee.getType() == DbObject.USER) { if (grantee.getType() == DbObject.USER) {
User user = (User) grantee; User user = (User) grantee;
if (user.getAdmin()) { if (user.isAdmin()) {
// the right is grantable if the grantee is an admin // the right is grantable if the grantee is an admin
isGrantable = "YES"; isGrantable = "YES";
} }
......
...@@ -417,7 +417,7 @@ public abstract class Table extends SchemaObjectBase { ...@@ -417,7 +417,7 @@ public abstract class Table extends SchemaObjectBase {
while (sequences != null && sequences.size() > 0) { while (sequences != null && sequences.size() > 0) {
Sequence sequence = sequences.get(0); Sequence sequence = sequences.get(0);
sequences.remove(0); sequences.remove(0);
if (!getTemporary()) { if (!isTemporary()) {
// only remove if no other table depends on this sequence // only remove if no other table depends on this sequence
// this is possible when calling ALTER TABLE ALTER COLUMN // this is possible when calling ALTER TABLE ALTER COLUMN
if (database.getDependentTable(sequence, this) == null) { if (database.getDependentTable(sequence, this) == null) {
...@@ -550,7 +550,7 @@ public abstract class Table extends SchemaObjectBase { ...@@ -550,7 +550,7 @@ public abstract class Table extends SchemaObjectBase {
ObjectArray<Index> indexes = getIndexes(); ObjectArray<Index> indexes = getIndexes();
for (int i = 0; indexes != null && i < indexes.size(); i++) { for (int i = 0; indexes != null && i < indexes.size(); i++) {
Index idx = indexes.get(i); Index idx = indexes.get(i);
if (idx.getIndexType().getPrimaryKey()) { if (idx.getIndexType().isPrimaryKey()) {
return idx; return idx;
} }
} }
...@@ -608,7 +608,7 @@ public abstract class Table extends SchemaObjectBase { ...@@ -608,7 +608,7 @@ public abstract class Table extends SchemaObjectBase {
ObjectArray<Index> indexes = getIndexes(); ObjectArray<Index> indexes = getIndexes();
if (indexes != null) { if (indexes != null) {
remove(indexes, index); remove(indexes, index);
if (index.getIndexType().getPrimaryKey()) { if (index.getIndexType().isPrimaryKey()) {
for (Column col : index.getColumns()) { for (Column col : index.getColumns()) {
col.setPrimaryKey(false); col.setPrimaryKey(false);
} }
...@@ -784,7 +784,7 @@ public abstract class Table extends SchemaObjectBase { ...@@ -784,7 +784,7 @@ public abstract class Table extends SchemaObjectBase {
} }
} }
public boolean getGlobalTemporary() { public boolean isGlobalTemporary() {
return false; return false;
} }
......
...@@ -583,7 +583,7 @@ public class TableFilter implements ColumnResolver { ...@@ -583,7 +583,7 @@ public class TableFilter implements ColumnResolver {
this.used = used; this.used = used;
} }
public boolean getUsed() { public boolean isUsed() {
return used; return used;
} }
......
...@@ -297,7 +297,7 @@ public class TableLink extends Table { ...@@ -297,7 +297,7 @@ public class TableLink extends Table {
public String getCreateSQL() { public String getCreateSQL() {
StringBuilder buff = new StringBuilder("CREATE FORCE "); StringBuilder buff = new StringBuilder("CREATE FORCE ");
if (getTemporary()) { if (isTemporary()) {
if (globalTemporary) { if (globalTemporary) {
buff.append("GLOBAL "); buff.append("GLOBAL ");
} }
...@@ -480,7 +480,7 @@ public class TableLink extends Table { ...@@ -480,7 +480,7 @@ public class TableLink extends Table {
public Index getUniqueIndex() { public Index getUniqueIndex() {
for (Index idx : indexes) { for (Index idx : indexes) {
if (idx.getIndexType().getUnique()) { if (idx.getIndexType().isUnique()) {
return idx; return idx;
} }
} }
......
...@@ -133,7 +133,7 @@ public class TableView extends Table { ...@@ -133,7 +133,7 @@ public class TableView extends Table {
* *
* @return true if it is * @return true if it is
*/ */
public boolean getInvalid() { public boolean isInvalid() {
return createException != null; return createException != null;
} }
...@@ -246,7 +246,7 @@ public class TableView extends Table { ...@@ -246,7 +246,7 @@ public class TableView extends Table {
} }
public String getSQL() { public String getSQL() {
if (getTemporary()) { if (isTemporary()) {
return "(" + querySQL + ")"; return "(" + querySQL + ")";
} }
return super.getSQL(); return super.getSQL();
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论