Package com.im.commons.db.ddl
Class DBConstraintInfo
- java.lang.Object
-
- com.im.commons.db.ddl.DBConstraintInfo
-
- All Implemented Interfaces:
AbstractInfo
,java.io.Serializable
public class DBConstraintInfo extends java.lang.Object implements AbstractInfo, java.io.Serializable
Information about a constraint for a database table.- Author:
- Tim Dudgeon
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
DBConstraintInfo.Type
-
Constructor Summary
Constructors Constructor Description DBConstraintInfo()
DBConstraintInfo(java.lang.String constraintName, DBConstraintInfo.Type type, java.lang.String[] columns, java.lang.String indexName)
DBConstraintInfo(java.lang.String constraintName, java.lang.String[] columns)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addToModel(java.lang.String parentID, DBItemsCache dbItemsCache)
boolean
equals(java.lang.Object obj)
java.lang.String[]
getColumns()
java.lang.String
getConstraintName()
java.lang.String
getIndexName()
The index that backs this constraint.DBConstraintInfo.Type
getType()
The type of the constraint, as defiend by one of the Type enums.int
hashCode()
void
removeFromModel(java.lang.String parentID, DBItemsCache dbItemsCache)
void
setColumns(java.lang.String[] columns)
java.lang.String
toString()
-
-
-
Constructor Detail
-
DBConstraintInfo
public DBConstraintInfo()
-
DBConstraintInfo
public DBConstraintInfo(java.lang.String constraintName, java.lang.String[] columns)
-
DBConstraintInfo
public DBConstraintInfo(java.lang.String constraintName, DBConstraintInfo.Type type, java.lang.String[] columns, java.lang.String indexName)
-
-
Method Detail
-
getColumns
public java.lang.String[] getColumns()
-
setColumns
public void setColumns(java.lang.String[] columns)
-
getConstraintName
public java.lang.String getConstraintName()
-
getIndexName
public java.lang.String getIndexName()
The index that backs this constraint. Will only be defined for primary key and unique constraints. For other types of constrain it will be null- Returns:
- The name of the index, or null.
-
getType
public DBConstraintInfo.Type getType()
The type of the constraint, as defiend by one of the Type enums.- Returns:
- The type
-
addToModel
public void addToModel(java.lang.String parentID, DBItemsCache dbItemsCache)
- Specified by:
addToModel
in interfaceAbstractInfo
-
removeFromModel
public void removeFromModel(java.lang.String parentID, DBItemsCache dbItemsCache)
- Specified by:
removeFromModel
in interfaceAbstractInfo
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
-