|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectca.sqlpower.architect.SQLObject
ca.sqlpower.architect.SQLIndex
public class SQLIndex
The SQLIndex class represents an index on a table in a relational database.
| Nested Class Summary | |
|---|---|
static class |
SQLIndex.AscendDescend
An enumeration to define if a column in an index should be ordered in ascending order, descending order, or it should be left undefined. |
class |
SQLIndex.Column
A simple placeholder for a column. |
| Field Summary | |
|---|---|
static java.lang.String |
INDEX_TYPE_DESCRIPTOR
This is the property name in the PL.ini file that will indicate what Index types are supported for any specific database. |
static java.lang.String |
RS_INDEX_TYPE_COL
This is the name of the column that will be augmented by the custom JDBC wrappers to represent index type; |
java.lang.String |
type
This is the index type |
| Fields inherited from class ca.sqlpower.architect.SQLObject |
|---|
children, magicDisableCount, populated, undoEventListeners |
| Constructor Summary | |
|---|---|
SQLIndex()
|
|
SQLIndex(SQLIndex oldIndex)
Copy constructor for a sql index |
|
SQLIndex(java.lang.String name,
boolean unique,
java.lang.String qualifier,
java.lang.String type,
java.lang.String filter)
|
|
| Method Summary | |
|---|---|
protected void |
addChildImpl(int index,
SQLObject newChild)
All other addChild() methods call this one. |
void |
addIndexColumn(SQLColumn col1,
SQLIndex.AscendDescend aOrD)
|
boolean |
allowsChildren()
Indices are associated with one or more table columns. |
void |
cleanUp()
This method is used to clean up the index when it no longer has any children. |
SQLIndex.Column |
getChild(int index)
Overriden to narrow return type. |
java.util.List<SQLIndex.Column> |
getChildren()
Overriden to narrow return type. |
java.lang.Class<? extends SQLObject> |
getChildType()
|
static SQLIndex |
getDerivedInstance(SQLIndex source,
SQLTable parentTable)
Returns a copy of a SQLIndex from a given SQLIndex in a parent SQLTable. |
java.lang.String |
getFilterCondition()
|
SQLTable.Folder<SQLIndex> |
getParent()
Returns the table folder that owns this index. |
SQLTable |
getParentTable()
Returns this index's parent table, or null if this index is not attached to a parent table. |
java.lang.String |
getQualifier()
|
java.lang.String |
getShortDisplayName()
Returns a short string that should be displayed to the user for representing this SQLObject as a label. |
java.lang.String |
getType()
|
boolean |
isClustered()
|
boolean |
isPopulated()
Tells if this object has already been filled with children, or if that operation is still pending. |
boolean |
isPrimaryKeyIndex()
|
boolean |
isUnique()
|
void |
makeColumnsLike(SQLIndex index)
Make this index's columns look like the columns in index |
protected void |
populate()
Indices are populated when first created, so populate is a no-op. |
protected SQLObject |
removeImpl(int index)
The implementation that all remove methods delegate to. |
void |
setClustered(boolean value)
|
void |
setFilterCondition(java.lang.String filterCondition)
|
protected void |
setParent(SQLObject parent)
Updates this index's parent reference, and attaches a listener to the columns folder of the new parent's parent table. |
void |
setParent(SQLTable.Folder<SQLIndex> parent)
|
void |
setPrimaryKeyIndex(boolean isPrimaryKey)
Updates whether this index is a primary key set this index as primary key index and remove any old primary key if isPrimaryKey is true. |
void |
setQualifier(java.lang.String qualifier)
|
void |
setType(java.lang.String type)
|
void |
setUnique(boolean unique)
|
java.lang.String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static java.lang.String INDEX_TYPE_DESCRIPTOR
public java.lang.String type
public static java.lang.String RS_INDEX_TYPE_COL
| Constructor Detail |
|---|
public SQLIndex(java.lang.String name,
boolean unique,
java.lang.String qualifier,
java.lang.String type,
java.lang.String filter)
public SQLIndex()
public SQLIndex(SQLIndex oldIndex)
throws ArchitectException
oldIndex -
ArchitectException| Method Detail |
|---|
public boolean allowsChildren()
allowsChildren in class SQLObjectpublic java.lang.Class<? extends SQLObject> getChildType()
getChildType in class SQLObject
public SQLIndex.Column getChild(int index)
throws ArchitectException
getChild in class SQLObjectArchitectException
public java.util.List<SQLIndex.Column> getChildren()
throws ArchitectException
getChildren in class SQLObjectArchitectExceptionpublic SQLTable.Folder<SQLIndex> getParent()
getParent in class SQLObjectpublic SQLTable getParentTable()
public java.lang.String getShortDisplayName()
SQLObject
getShortDisplayName in class SQLObject
protected void populate()
throws ArchitectException
populate in class SQLObjectArchitectExceptionpublic boolean isPopulated()
SQLObject
isPopulated in class SQLObjectprotected void setParent(SQLObject parent)
setParent in class SQLObjectparent - The new parent. Must be null or a SQLTable.Folder instance. If
it's a folder, it must already have a parent table.
java.lang.IllegalStateException - if the given parent is non-null and does not itself have a
parent table.public void cleanUp()
protected SQLObject removeImpl(int index)
SQLObject
removeImpl in class SQLObject
protected void addChildImpl(int index,
SQLObject newChild)
throws ArchitectException
SQLObject
addChildImpl in class SQLObjectindex - The index that the new child will havenewChild - The new child to add (must be same type as all other children)
ArchitectException - If you try to add a child of a different type than the existing children.public java.lang.String getFilterCondition()
public void setFilterCondition(java.lang.String filterCondition)
public java.lang.String getQualifier()
public void setQualifier(java.lang.String qualifier)
public java.lang.String getType()
public void setType(java.lang.String type)
public boolean isUnique()
public boolean isClustered()
public void setUnique(boolean unique)
public void setClustered(boolean value)
public void setParent(SQLTable.Folder<SQLIndex> parent)
public boolean isPrimaryKeyIndex()
public void setPrimaryKeyIndex(boolean isPrimaryKey)
throws ArchitectException
isPrimaryKey -
ArchitectExceptionpublic java.lang.String toString()
toString in class java.lang.Object
public void addIndexColumn(SQLColumn col1,
SQLIndex.AscendDescend aOrD)
throws ArchitectException
ArchitectException
public static SQLIndex getDerivedInstance(SQLIndex source,
SQLTable parentTable)
throws ArchitectException
source - The source SQLIndex to copyparentTable - The parent SQLTable of the source SQLIndex
ArchitectException
public void makeColumnsLike(SQLIndex index)
throws ArchitectException
index - The index who's columns are what we want in this index
ArchitectException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||