|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.triactive.jdo.store.sql.QualifiedName
An SQL qualified name.
A QualifiedName is a name of an SQL object which can be schema-qualified. Table names, constraint names, etc. are kinds of qualified names. Qualified names have the general form:
[ [ catalog ] . schema ] . name
The [catalog].schema part is represented by a SchemaName
object, and
the name part is a plain SqlIdentifier
.
The term qualified name comes from the SQL standard.
Field Summary | |
protected SqlIdentifier |
identifier
The identifier part of the qualified name. |
protected SchemaName |
schemaName
The schema name part of the qualified name. |
Constructor Summary | |
protected |
QualifiedName(DatabaseAdapter dba,
SchemaName schemaName,
java.lang.String identifier,
int maxLength)
Constructs a qualified name. |
Method Summary | |
java.lang.String |
effectiveCatalogName(StoreManager storeMgr)
Returns the effective catalog name for this object. |
java.lang.String |
effectiveSchemaName(StoreManager storeMgr)
Returns the effective schema name for this object. |
boolean |
equals(java.lang.Object obj)
Tests this object for equality with another object. |
QualifiedName |
fullyQualified(StoreManager storeMgr)
Returns a new qualified name object representing this name fully-qualified (if possible) with catalog and schema. |
SqlIdentifier |
getIdentifier()
Returns the identifier part of this qualified name. |
SchemaName |
getSchemaName()
Returns the (catalog and) schema name part of this qualified name. |
int |
hashCode()
Returns a hash code value for this object. |
QualifiedName |
intern()
Returns a canonical representation for the name object. |
java.lang.String |
toString()
Returns the SQL string representation of this qualified name. |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
protected final SchemaName schemaName
protected final SqlIdentifier identifier
Constructor Detail |
protected QualifiedName(DatabaseAdapter dba, SchemaName schemaName, java.lang.String identifier, int maxLength)
dba
- a database adapter for the relevant databaseschemaName
- the schema name part of the qualified name, or null
if the name is not schema-qualifiedidentifier
- the SQL identifier value as a stringmaxLength
- the maximum allowed length for identifier.Method Detail |
public SchemaName getSchemaName()
null
if this name is not schema-qualified.public SqlIdentifier getIdentifier()
public QualifiedName fullyQualified(StoreManager storeMgr)
The returned object is of the same type as this object, even in subclasses of QualifiedName.
storeMgr
- the store manager to use to determine the default catalog and
schema.
public java.lang.String effectiveCatalogName(StoreManager storeMgr)
storeMgr
- the store manager to use to determine the default catalog
null
if the
database doesn't support catalogs.public java.lang.String effectiveSchemaName(StoreManager storeMgr)
storeMgr
- the store manager to use to determine the default schema
null
if the
database doesn't support schemas.public QualifiedName intern()
This method behaves much like String.intern()
.
A pool of names, initially empty, is maintained privately.
When the intern method is invoked, if the pool already contains an object
equal to this QualifiedName
object as determined by the
equals(Object)
method, then the name from the pool is
returned.
Otherwise, this QualifiedName
object is added to the pool
and a reference to this QualifiedName
object is returned.
It follows that for any two names n1
and n2
,
n1.intern() == n2.intern()
is true
if
and only if n1.equals(n2)
is true
.
public final int hashCode()
public final boolean equals(java.lang.Object obj)
obj
- the object to compare with
true
if the objects are equal,
false
otherwise.public final java.lang.String toString()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |