Class Table
- java.lang.Object
-
- org.alfresco.util.schemacomp.model.AbstractDbObject
-
- org.alfresco.util.schemacomp.model.Table
-
- All Implemented Interfaces:
DbObject
public class Table extends AbstractDbObject
Instances of this class represent a database table.- Author:
- Matt Ward
-
-
Field Summary
-
Fields inherited from class org.alfresco.util.schemacomp.model.AbstractDbObject
comparisonUtils
-
-
Constructor Summary
Constructors Constructor Description Table(java.lang.String name)Table(java.lang.String name, java.util.Collection<Column> columns, PrimaryKey primaryKey, java.util.Collection<ForeignKey> foreignKeys, java.util.Collection<Index> indexes)Table(Schema parentSchema, java.lang.String name, java.util.Collection<Column> columns, PrimaryKey primaryKey, java.util.Collection<ForeignKey> foreignKeys, java.util.Collection<Index> indexes)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaccept(DbObjectVisitor visitor)Allows a visitor to be invoked against this DbObject.protected voiddoDiff(DbObject other, DiffContext ctx)Override this method to provide subclass specific diffing logic.booleanequals(java.lang.Object obj)java.util.List<Column>getColumns()java.util.List<ForeignKey>getForeignKeys()java.util.List<Index>getIndexes()PrimaryKeygetPrimaryKey()inthashCode()booleanhasPrimaryKey()voidsetColumns(java.util.Collection<Column> columns)voidsetForeignKeys(java.util.Collection<ForeignKey> foreignKeys)voidsetIndexes(java.util.Collection<Index> indexes)voidsetPrimaryKey(PrimaryKey primaryKey)-
Methods inherited from class org.alfresco.util.schemacomp.model.AbstractDbObject
diff, getName, getParent, getTypeName, getValidators, hasObjectLevelValidator, hasValidators, sameAs, setComparisonUtils, setName, setParent, setValidators, toString
-
-
-
-
Constructor Detail
-
Table
public Table(java.lang.String name)
-
Table
public Table(java.lang.String name, java.util.Collection<Column> columns, PrimaryKey primaryKey, java.util.Collection<ForeignKey> foreignKeys, java.util.Collection<Index> indexes)
-
Table
public Table(Schema parentSchema, java.lang.String name, java.util.Collection<Column> columns, PrimaryKey primaryKey, java.util.Collection<ForeignKey> foreignKeys, java.util.Collection<Index> indexes)
-
-
Method Detail
-
getColumns
public java.util.List<Column> getColumns()
- Returns:
- the columns
-
setColumns
public void setColumns(java.util.Collection<Column> columns)
- Parameters:
columns- the columns to set
-
getPrimaryKey
public PrimaryKey getPrimaryKey()
- Returns:
- the primaryKey
-
hasPrimaryKey
public boolean hasPrimaryKey()
- Returns:
- Whether there is a primary key on this table.
-
setPrimaryKey
public void setPrimaryKey(PrimaryKey primaryKey)
- Parameters:
primaryKey- the primaryKey to set
-
getForeignKeys
public java.util.List<ForeignKey> getForeignKeys()
- Returns:
- the foreignKeys
-
setForeignKeys
public void setForeignKeys(java.util.Collection<ForeignKey> foreignKeys)
- Parameters:
foreignKeys- the foreignKeys to set
-
getIndexes
public java.util.List<Index> getIndexes()
- Returns:
- the indexes
-
setIndexes
public void setIndexes(java.util.Collection<Index> indexes)
- Parameters:
indexes- the indexes to set
-
hashCode
public int hashCode()
- Overrides:
hashCodein classAbstractDbObject
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equalsin classAbstractDbObject
-
doDiff
protected void doDiff(DbObject other, DiffContext ctx)
Description copied from class:AbstractDbObjectOverride this method to provide subclass specific diffing logic.- Overrides:
doDiffin classAbstractDbObject- Parameters:
other- DbObjectctx- DiffContext
-
accept
public void accept(DbObjectVisitor visitor)
Description copied from interface:DbObjectAllows a visitor to be invoked against this DbObject. Implementations should ensure that child objects are visited first (by calling accept on them) before invoking the visitor on itself.- Parameters:
visitor- DbObjectVisitor
-
-