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

boolean getX > isX

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