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 DBTableInfo
copy()
Creates a duplicate copy of thisDBTableInfo
instance.DBConstraintInfo
findUniqueConstraintNameForColumns(java.lang.String[] columns)
Retrieves constraint name for the named columns.DBColInfo
getColumn(java.lang.String name)
Finds aDBColInfo
by 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).DBTableInfoImpl
getImpl()
java.util.List<DBForeignKeyInfo>
getImportedFKInfo()
Get the foreign keys that this table defines.java.util.List<DBIndexInfo>
getIndexInfo()
java.lang.String
getName()
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.String
getSchema()
Gets the database schema name of the associated artefact.java.lang.String
getSQL()
Getter for SQL that defines this view if it is a view, otherwise null.java.util.List<DBTriggerInfo>
getTriggerInfo()
DBTableInfo.Type
getType()
Gets the type of thisDBTableInfo
instance.java.util.List<DBConstraintInfo>
getUniqueConstraints()
boolean
isLazy()
boolean
isReadOnly()
Determines whether this database artifact allows modifications.void
loadIfLazy()
java.lang.String
schemaPlusTable()
Gets the fully qualified name of the underlying database artifact.java.lang.String
toString()
DBTableInfo
updateColumns(java.util.List<DBColInfo> cols)
DBTableInfo
updateExportedForeignKeys(java.util.List<DBForeignKeyInfo> fkKeys)
DBTableInfo
updateImportedForeignKeys(java.util.List<DBForeignKeyInfo> pkKeys)
DBTableInfo
updateIndexInfos(java.util.List<DBIndexInfo> indexes)
DBTableInfo
updateUniqueConstraintInfos(java.util.List<DBConstraintInfo> constraints)
java.lang.Object
writeReplace()
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:DBTableInfo
Gets the type of thisDBTableInfo
instance.- Specified by:
getType
in interfaceDBTableInfo
- Returns:
- This
DBTableInfo
's type.
-
getName
public java.lang.String getName()
Description copied from interface:DBTableInfo
Gets the name of the database artefact represented by thisDBTableInfo
.- Specified by:
getName
in interfaceDBTableInfo
- Returns:
- The database artifact's name.
-
getSchema
public java.lang.String getSchema()
Description copied from interface:DBTableInfo
Gets the database schema name of the associated artefact.- Specified by:
getSchema
in interfaceDBTableInfo
- Returns:
- The schema this item belongs to.
-
schemaPlusTable
public java.lang.String schemaPlusTable()
Description copied from interface:DBTableInfo
Gets the fully qualified name of the underlying database artifact.- Specified by:
schemaPlusTable
in interfaceDBTableInfo
- Returns:
- The concatenated form of
DBTableInfo.getName()
andDBTableInfo.getSchema()
.
-
copy
public DBTableInfo copy()
Description copied from interface:DBTableInfo
Creates a duplicate copy of thisDBTableInfo
instance.- Specified by:
copy
in interfaceDBTableInfo
- Returns:
- A new
DBTableInfo
instance.
-
isReadOnly
public boolean isReadOnly()
Description copied from interface:DBTableInfo
Determines whether this database artifact allows modifications.- Specified by:
isReadOnly
in interfaceDBTableInfo
- Returns:
true
if 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:
getSQL
in interfaceDBTableInfo
- Returns:
- Value of property sql.
-
findUniqueConstraintNameForColumns
public DBConstraintInfo findUniqueConstraintNameForColumns(java.lang.String[] columns)
Description copied from interface:DBTableInfo
Retrieves 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:
findUniqueConstraintNameForColumns
in interfaceDBTableInfo
- Parameters:
columns
- DB columns- Returns:
- The constraint, or
null
if there's no unique constraint.
-
getColumn
public DBColInfo getColumn(java.lang.String name)
Description copied from interface:DBTableInfo
Finds aDBColInfo
by its name. This will search through the columns in thisDBTableInfo
for a column with the required name.- Specified by:
getColumn
in interfaceDBTableInfo
- Parameters:
name
- The name of the column to find.- Returns:
- The
DBColInfo
with the required name ornull
if no such column exists.
-
getColumns
public java.util.List<DBColInfo> getColumns()
Description copied from interface:DBTableInfo
Gets the columns in thisDBTableInfo
.- Specified by:
getColumns
in interfaceDBTableInfo
- Returns:
- The list of columns.
-
getExportedFKInfo
public java.util.List<DBForeignKeyInfo> getExportedFKInfo()
Description copied from interface:DBTableInfo
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). e.g. the keys in this table that are referred to in a foreign key constraint definition somewhere.- Specified by:
getExportedFKInfo
in interfaceDBTableInfo
- Returns:
- A list of foreign keys
-
getImportedFKInfo
public java.util.List<DBForeignKeyInfo> getImportedFKInfo()
Description copied from interface:DBTableInfo
Get 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:
getImportedFKInfo
in interfaceDBTableInfo
- Returns:
- A list of foreign keys
-
getIndexInfo
public java.util.List<DBIndexInfo> getIndexInfo()
- Specified by:
getIndexInfo
in interfaceDBTableInfo
-
getPrimaryKeyColumns
public java.util.List<java.lang.String> getPrimaryKeyColumns()
Description copied from interface:DBTableInfo
Gets the name of the primary key columns.- Specified by:
getPrimaryKeyColumns
in 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:
getTriggerInfo
in interfaceDBTableInfo
-
getUniqueConstraints
public java.util.List<DBConstraintInfo> getUniqueConstraints()
- Specified by:
getUniqueConstraints
in interfaceDBTableInfo
-
updateColumns
public DBTableInfo updateColumns(java.util.List<DBColInfo> cols)
- Specified by:
updateColumns
in interfaceDBTableInfo
-
updateImportedForeignKeys
public DBTableInfo updateImportedForeignKeys(java.util.List<DBForeignKeyInfo> pkKeys)
- Specified by:
updateImportedForeignKeys
in interfaceDBTableInfo
-
updateExportedForeignKeys
public DBTableInfo updateExportedForeignKeys(java.util.List<DBForeignKeyInfo> fkKeys)
- Specified by:
updateExportedForeignKeys
in interfaceDBTableInfo
-
updateIndexInfos
public DBTableInfo updateIndexInfos(java.util.List<DBIndexInfo> indexes)
- Specified by:
updateIndexInfos
in interfaceDBTableInfo
-
updateUniqueConstraintInfos
public DBTableInfo updateUniqueConstraintInfos(java.util.List<DBConstraintInfo> constraints)
- Specified by:
updateUniqueConstraintInfos
in 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:
toString
in classjava.lang.Object
-
-