Package com.im.commons.db.ddl
Class DBTableInfoProxy
- java.lang.Object
-
- com.im.commons.db.ddl.DBTableInfoProxy
-
- All Implemented Interfaces:
DBTableInfo,java.io.Serializable
public final class DBTableInfoProxy extends java.lang.Object implements DBTableInfo
- Author:
- Martin Adamek
- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface com.im.commons.db.ddl.DBTableInfo
DBTableInfo.Type
-
-
Constructor Summary
Constructors Constructor Description DBTableInfoProxy(DBTableInfoImpl impl, LazyLoader lazyLoader)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description DBTableInfocopy()Creates a duplicate copy of thisDBTableInfoinstance.DBConstraintInfofindUniqueConstraintNameForColumns(java.lang.String[] columns)Retrieves constraint name for the named columns.DBColInfogetColumn(java.lang.String name)Finds aDBColInfoby its name.java.util.List<DBColInfo>getColumns()Gets the columns in thisDBTableInfo.java.util.List<DBForeignKeyInfo>getExportedFKInfo()Get the foreign keys that involve this table but are defined in a foreign key constraint definition that is defined in another table (though possibly this table).DBTableInfoImplgetImpl()java.util.List<DBForeignKeyInfo>getImportedFKInfo()Get the foreign keys that this table defines.java.util.List<DBIndexInfo>getIndexInfo()java.lang.StringgetName()Gets the name of the database artefact represented by thisDBTableInfo.java.util.List<java.lang.String>getPrimaryKeyColumns()Gets the name of the primary key columns.java.lang.StringgetSchema()Gets the database schema name of the associated artefact.java.lang.StringgetSQL()Getter for SQL that defines this view if it is a view, otherwise null.java.util.List<DBTriggerInfo>getTriggerInfo()DBTableInfo.TypegetType()Gets the type of thisDBTableInfoinstance.java.util.List<DBConstraintInfo>getUniqueConstraints()booleanisLazy()booleanisReadOnly()Determines whether this database artifact allows modifications.voidloadIfLazy()java.lang.StringschemaPlusTable()Gets the fully qualified name of the underlying database artifact.java.lang.StringtoString()DBTableInfoupdateColumns(java.util.List<DBColInfo> cols)DBTableInfoupdateExportedForeignKeys(java.util.List<DBForeignKeyInfo> fkKeys)DBTableInfoupdateImportedForeignKeys(java.util.List<DBForeignKeyInfo> pkKeys)DBTableInfoupdateIndexInfos(java.util.List<DBIndexInfo> indexes)DBTableInfoupdateUniqueConstraintInfos(java.util.List<DBConstraintInfo> constraints)java.lang.ObjectwriteReplace()It doesn't make sense to persistDBTableInfoProxy.
-
-
-
Constructor Detail
-
DBTableInfoProxy
public DBTableInfoProxy(DBTableInfoImpl impl, LazyLoader lazyLoader)
-
-
Method Detail
-
getImpl
public DBTableInfoImpl getImpl()
-
isLazy
public boolean isLazy()
-
loadIfLazy
public void loadIfLazy()
-
getType
public DBTableInfo.Type getType()
Description copied from interface:DBTableInfoGets the type of thisDBTableInfoinstance.- Specified by:
getTypein interfaceDBTableInfo- Returns:
- This
DBTableInfo's type.
-
getName
public java.lang.String getName()
Description copied from interface:DBTableInfoGets the name of the database artefact represented by thisDBTableInfo.- Specified by:
getNamein interfaceDBTableInfo- Returns:
- The database artifact's name.
-
getSchema
public java.lang.String getSchema()
Description copied from interface:DBTableInfoGets the database schema name of the associated artefact.- Specified by:
getSchemain interfaceDBTableInfo- Returns:
- The schema this item belongs to.
-
schemaPlusTable
public java.lang.String schemaPlusTable()
Description copied from interface:DBTableInfoGets the fully qualified name of the underlying database artifact.- Specified by:
schemaPlusTablein interfaceDBTableInfo- Returns:
- The concatenated form of
DBTableInfo.getName()andDBTableInfo.getSchema().
-
copy
public DBTableInfo copy()
Description copied from interface:DBTableInfoCreates a duplicate copy of thisDBTableInfoinstance.- Specified by:
copyin interfaceDBTableInfo- Returns:
- A new
DBTableInfoinstance.
-
isReadOnly
public boolean isReadOnly()
Description copied from interface:DBTableInfoDetermines whether this database artifact allows modifications.- Specified by:
isReadOnlyin interfaceDBTableInfo- Returns:
trueif this database artifact is readonly and cannot be modified.
-
getSQL
public java.lang.String getSQL()
Getter for SQL that defines this view if it is a view, otherwise null.- Specified by:
getSQLin interfaceDBTableInfo- Returns:
- Value of property sql.
-
findUniqueConstraintNameForColumns
public DBConstraintInfo findUniqueConstraintNameForColumns(java.lang.String[] columns)
Description copied from interface:DBTableInfoRetrieves constraint name for the named columns. The method will return name of the unique constraint for the given set of columns. The constraint name may beDatabasePlatform.NAME_PRIMARY_KEY_CONSTRAINT, which may be handled differently in some databases - for drop, useDatabasePlatform.sqlDropPrimaryConstraint(String, String, String[]).- Specified by:
findUniqueConstraintNameForColumnsin interfaceDBTableInfo- Parameters:
columns- DB columns- Returns:
- The constraint, or
nullif there's no unique constraint.
-
getColumn
public DBColInfo getColumn(java.lang.String name)
Description copied from interface:DBTableInfoFinds aDBColInfoby its name. This will search through the columns in thisDBTableInfofor a column with the required name.- Specified by:
getColumnin interfaceDBTableInfo- Parameters:
name- The name of the column to find.- Returns:
- The
DBColInfowith the required name ornullif no such column exists.
-
getColumns
public java.util.List<DBColInfo> getColumns()
Description copied from interface:DBTableInfoGets the columns in thisDBTableInfo.- Specified by:
getColumnsin interfaceDBTableInfo- Returns:
- The list of columns.
-
getExportedFKInfo
public java.util.List<DBForeignKeyInfo> getExportedFKInfo()
Description copied from interface:DBTableInfoGet the foreign keys that involve this table but are defined in a foreign key constraint definition that is defined in another table (though possibly this table). e.g. the keys in this table that are referred to in a foreign key constraint definition somewhere.- Specified by:
getExportedFKInfoin interfaceDBTableInfo- Returns:
- A list of foreign keys
-
getImportedFKInfo
public java.util.List<DBForeignKeyInfo> getImportedFKInfo()
Description copied from interface:DBTableInfoGet the foreign keys that this table defines. e.g. the primary keys of other tables (or possibly this table) that are referred to in a foreign key constraint definition.- Specified by:
getImportedFKInfoin interfaceDBTableInfo- Returns:
- A list of foreign keys
-
getIndexInfo
public java.util.List<DBIndexInfo> getIndexInfo()
- Specified by:
getIndexInfoin interfaceDBTableInfo
-
getPrimaryKeyColumns
public java.util.List<java.lang.String> getPrimaryKeyColumns()
Description copied from interface:DBTableInfoGets the name of the primary key columns.- Specified by:
getPrimaryKeyColumnsin interfaceDBTableInfo- Returns:
- The primary key column names. It can return an empty list, but not
null.
-
getTriggerInfo
public java.util.List<DBTriggerInfo> getTriggerInfo()
- Specified by:
getTriggerInfoin interfaceDBTableInfo
-
getUniqueConstraints
public java.util.List<DBConstraintInfo> getUniqueConstraints()
- Specified by:
getUniqueConstraintsin interfaceDBTableInfo
-
updateColumns
public DBTableInfo updateColumns(java.util.List<DBColInfo> cols)
- Specified by:
updateColumnsin interfaceDBTableInfo
-
updateImportedForeignKeys
public DBTableInfo updateImportedForeignKeys(java.util.List<DBForeignKeyInfo> pkKeys)
- Specified by:
updateImportedForeignKeysin interfaceDBTableInfo
-
updateExportedForeignKeys
public DBTableInfo updateExportedForeignKeys(java.util.List<DBForeignKeyInfo> fkKeys)
- Specified by:
updateExportedForeignKeysin interfaceDBTableInfo
-
updateIndexInfos
public DBTableInfo updateIndexInfos(java.util.List<DBIndexInfo> indexes)
- Specified by:
updateIndexInfosin interfaceDBTableInfo
-
updateUniqueConstraintInfos
public DBTableInfo updateUniqueConstraintInfos(java.util.List<DBConstraintInfo> constraints)
- Specified by:
updateUniqueConstraintInfosin interfaceDBTableInfo
-
writeReplace
public java.lang.Object writeReplace()
It doesn't make sense to persistDBTableInfoProxy. It's only proxy forDBTableInfoImpl.- Returns:
- object used for serialization.
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-