public QualifiedDBIdentifier getQualifiedPath() { if (_fullPath == null) { _fullPath = QualifiedDBIdentifier.newPath(_schemaName, _name ); } return _fullPath; }
/** * Creates a clone of this identifier. */ public QualifiedDBIdentifier clone() { QualifiedDBIdentifier sPath = new QualifiedDBIdentifier(); sPath.setObjectTableName(getObjectTableName().clone()); sPath.setSchemaName(getSchemaName().clone()); sPath.setBaseName(super.getName()); sPath.setType(getType()); sPath.setIgnoreCase(getIgnoreCase()); return sPath; }
/** * Returns a new unqualified name based on this instance. */ @Override public DBIdentifier getUnqualifiedName() { QualifiedDBIdentifier newName = (QualifiedDBIdentifier)clone(); newName.setObjectTableName(DBIdentifier.NULL); newName.setSchemaName(DBIdentifier.NULL); return newName; }
/** * Returns true if this object is not qualified by a table or schema * component. * @return */ public boolean isUnqualifiedColumn() { return DBIdentifier.isNull(getObjectTableName()) && DBIdentifier.isNull(getSchemaName()); }
/** * Equality operator. */ public boolean equals(Object obj) { if (obj == null) { return false; } if (obj instanceof QualifiedDBIdentifier) { QualifiedDBIdentifier sPath = (QualifiedDBIdentifier)obj; return DBIdentifier.equal(sPath.getSchemaName(), getSchemaName()) && DBIdentifier.equal(sPath.getObjectTableName(), getObjectTableName()) && DBIdentifier.equal(sPath, this); } else if (obj instanceof DBIdentifier) { DBIdentifier sName = (DBIdentifier)obj; return DBIdentifier.equal(sName, this); } else if (obj instanceof String) { return obj.equals(this.getName()); } throw new IllegalArgumentException("Cannot compare to type: " + obj.getClass().getName()); }
/** * Returns the fully qualified name as a string */ public String getName() { // If no schema or object or table qualifier, return the base name if (DBIdentifier.isEmpty(_schemaName) && DBIdentifier.isEmpty(_objectTableName)) { return getBaseName(); } DBIdentifier[] names = QualifiedDBIdentifier.splitPath(this); return DBIdentifier.join(names); }
/** * Return whether the given column exists in the array. */ private static boolean hasColumn(Column[] cols, Column col) { for (int i = 0; i < cols.length; i++) if (cols[i].getQualifiedPath().equals(col.getQualifiedPath())) return true; return false; }
public Table findTable(DBIdentifier name) { if (name == null) return null; QualifiedDBIdentifier path = QualifiedDBIdentifier.getPath(name); return findTable(path); }
public DBIdentifier getFullDBIdentifier() { return getQualifiedPath().getIdentifier(); }
/** * Returns a fully qualified name as a string. */ public String toString() { return getName(); }
/** * Creates a qualified identifier based upon an array of DBIdentifiers. Identifiers * must be specified in order. * @param names * @return */ public static QualifiedDBIdentifier newPath(DBIdentifier...names) { return new QualifiedDBIdentifier(names); }
/** * Equality operator. */ public boolean equals(Object obj) { if (obj == null) { return false; } if (obj instanceof QualifiedDBIdentifier) { QualifiedDBIdentifier sPath = (QualifiedDBIdentifier)obj; return DBIdentifier.equal(sPath.getSchemaName(), getSchemaName()) && DBIdentifier.equal(sPath.getObjectTableName(), getObjectTableName()) && DBIdentifier.equal(sPath, this); } else if (obj instanceof DBIdentifier) { DBIdentifier sName = (DBIdentifier)obj; return DBIdentifier.equal(sName, this); } else if (obj instanceof String) { return obj.equals(this.getName()); } throw new IllegalArgumentException("Cannot compare to type: " + obj.getClass().getName()); }
/** * Returns true if this object is not qualified by a table or schema * component. */ public boolean isUnqualifiedColumn() { return DBIdentifier.isNull(getObjectTableName()) && DBIdentifier.isNull(getSchemaName()); }
/** * Returns the fully qualified name as a string */ public String getName() { // If no schema or object or table qualifier, return the base name if (DBIdentifier.isEmpty(_schemaName) && DBIdentifier.isEmpty(_objectTableName)) { return getBaseName(); } DBIdentifier[] names = QualifiedDBIdentifier.splitPath(this); return DBIdentifier.join(names); }
/** * Return whether the given column exists in the array. */ private static boolean hasColumn(Column[] cols, Column col) { for (int i = 0; i < cols.length; i++) if (cols[i].getQualifiedPath().equals(col.getQualifiedPath())) return true; return false; }
public Table findTable(DBIdentifier name) { if (name == null) return null; QualifiedDBIdentifier path = QualifiedDBIdentifier.getPath(name); return findTable(path); }
public DBIdentifier getFullIdentifier() { return getQualifiedPath().getIdentifier(); }
/** * Returns a fully qualified name as a string. */ public String toString() { return getName(); }
/** * Creates a qualified identifier based upon an array of DBIdentifiers. Identifiers * must be specified in order. * @param names */ public static QualifiedDBIdentifier newPath(DBIdentifier...names) { return new QualifiedDBIdentifier(names); }
/** * Creates a clone of this identifier. */ public QualifiedDBIdentifier clone() { QualifiedDBIdentifier sPath = new QualifiedDBIdentifier(); sPath.setObjectTableName(getObjectTableName().clone()); sPath.setSchemaName(getSchemaName().clone()); sPath.setBaseName(super.getName()); sPath.setType(getType()); sPath.setIgnoreCase(getIgnoreCase()); return sPath; }