/** * Could this FieldBuffer be referenced by the input name? Input Field.Name must already be all lowercase. Deals with * abbreviations, unqualified table/database, and db aliases. */ public boolean canMatch(Field.Name input) { // Assert that the input name is already lowercase. assert input.generateName().equalsIgnoreCase(input.generateName()); Field.Name self = new Field.Name(this.fullName().toLowerCase()); if (input.getDb() != null) { ISchema schema = getScope().getRootScope().getRefactorSession().getSchema(); if (this.buffer.getTable().getDatabase() != schema.lookupDatabase(input.getDb())) return false; } if (input.getTable() != null) { if (buffer.isDefaultSchema()) { if (!self.getTable().startsWith(input.getTable())) return false; } else { // Temp/work/buffer names can't be abbreviated. if (!self.getTable().equals(input.getTable())) return false; } } if (!self.getField().startsWith(input.getField())) return false; return true; }
if (!tableBuff.isDefaultSchema()) return result;
if (!tableBuff.isDefaultSchema()) return result;
/** * Could this FieldBuffer be referenced by the input name? Input Field.Name must already be all lowercase. Deals with * abbreviations, unqualified table/database, and db aliases. */ public boolean canMatch(Field.Name input) { // Assert that the input name is already lowercase. assert input.generateName().equalsIgnoreCase(input.generateName()); Field.Name self = new Field.Name(this.fullName().toLowerCase()); if (input.getDb() != null) { ISchema schema = getScope().getRootScope().getRefactorSession().getSchema(); if (this.buffer.getTable().getDatabase() != schema.lookupDatabase(input.getDb())) return false; } if (input.getTable() != null) { if (buffer.isDefaultSchema()) { if (!self.getTable().startsWith(input.getTable())) return false; } else { // Temp/work/buffer names can't be abbreviated. if (!self.getTable().equals(input.getTable())) return false; } } if (!self.getField().startsWith(input.getField())) return false; return true; }
result.isAbbreviated = true; if (tableBuff.isDefaultSchema()) { String[] parts = tablePart.split("\\."); String tblPart = parts[parts.length - 1];
result.setAbbreviated(); if (tableBuff.isDefaultSchema()) { String[] parts = tablePart.split("\\."); String tblPart = parts[parts.length - 1];