public class Table extends ModelElement implements java.lang.Comparable<Table>
Modifier and Type | Field and Description |
---|---|
java.util.List<Association> |
associations
Associations to other tables.
|
boolean |
defaultExcludeFromDeletion
Data Model default for Exclude from Deletion.
|
boolean |
defaultUpsert
Data model default for export mode.
|
java.lang.Boolean |
excludeFromDeletion
Exclude from Deletion?
|
PrimaryKey |
primaryKey
The primary-key of the table.
|
java.lang.Boolean |
upsert
Use upsert (merge) or insert-statement for entities of this table in export-script.
|
Constructor and Description |
---|
Table(java.lang.String name,
PrimaryKey primaryKey,
boolean defaultUpsert,
boolean defaultExcludeFromDeletion)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
static void |
clearSessionProperties(Session session) |
java.util.Set<Table> |
closure()
Gets the closure of the table.
|
java.util.Set<Table> |
closure(java.util.Set<Table> tablesToIgnore)
Gets the closure of the table.
|
java.util.Set<Table> |
closure(java.util.Set<Table> tablesToIgnore,
java.util.Map<Table,java.lang.Integer> distances)
Gets the closure of the table.
|
int |
compareTo(Table o) |
boolean |
equals(java.lang.Object other)
Compares tables.
|
java.util.List<Column> |
getColumns()
Gets columns.
|
org.w3c.dom.Document |
getDefaultXmlTemplate(Quoting quoting)
Gets default template for XML exports as DOM.
|
java.lang.String |
getName()
Gets the table name.
|
java.util.List<Column> |
getNonVirtualPKColumns(Session session)
Gets non-virtual and non-filtered primary-key columns.
|
int |
getOrdinal()
Gets unique number of this table to be used as type discriminator in JAILER_ENTITY table.
|
java.lang.String |
getOriginalName()
Gets the original table-name.
|
java.lang.String |
getOriginalSchema(java.lang.String defaultSchema)
Gets un-mapped schema name of table.
|
java.lang.String |
getSchema(java.lang.String defaultSchema)
Gets mapped schema name of table.
|
java.util.List<Column> |
getSelectionClause()
Gets all non-virtual columns of the table in the order in which they are selected.
|
java.lang.String |
getUnqualifiedName()
Gets unqualified name of table.
|
java.lang.Boolean |
getUpsert()
Gets export modus.
|
java.lang.String |
getXmlTemplate()
Gets template for XML exports.
|
org.w3c.dom.Document |
getXmlTemplateAsDocument(Quoting quoting)
Gets template for XML exports as DOM.
|
org.w3c.dom.Document |
getXmlTemplateAsDocument(java.lang.String xmlTemplate,
Quoting quoting)
Gets template for XML exports as DOM.
|
int |
hashCode()
The hash-code.
|
boolean |
isArtifical()
Gets whether this table is artificial (i.e. does not represent a table in a database).
|
boolean |
isDistinct()
Gets whether this table is a distinct join over several tables (needed for counting of column values).
|
boolean |
isExcludedFromDeletion() |
void |
setColumns(java.util.List<Column> columns)
Sets columns.
|
void |
setIsArtifical(boolean isArtifical)
Sets whether this table is artificial (i.e. does not represent a table in a database).
|
void |
setIsDistinct(boolean isDistinct)
Sets whether this table is a distinct join over several tables (needed for counting of column values).
|
void |
setOriginalName(java.lang.String originalName)
Sets the original table-name.
|
void |
setXmlTemplate(java.lang.String xmlTemplate)
Sets template for XML exports.
|
void |
setXmlTemplateInternal(java.lang.String xmlTemplate)
Sets template for XML exports (for internal uses/GUI only).
|
java.lang.String |
toString()
Stringifies the table.
|
java.util.Set<Table> |
unrestrictedClosure()
Gets the closure of the table, ignoring restrictions.
|
getAuthor, setAuthor
public final PrimaryKey primaryKey
public final java.util.List<Association> associations
public java.lang.Boolean upsert
public final boolean defaultUpsert
public java.lang.Boolean excludeFromDeletion
public final boolean defaultExcludeFromDeletion
public Table(java.lang.String name, PrimaryKey primaryKey, boolean defaultUpsert, boolean defaultExcludeFromDeletion)
name
- the table-nameprimaryKey
- the names of the primary-key columnsdefaultUpsert
- data model default for export modepublic java.lang.String getName()
public java.lang.Boolean getUpsert()
public void setColumns(java.util.List<Column> columns)
columns
- list of table columnspublic java.util.List<Column> getColumns()
public boolean equals(java.lang.Object other)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object
public int compareTo(Table o)
compareTo
in interface java.lang.Comparable<Table>
public java.util.Set<Table> closure()
public java.util.Set<Table> closure(java.util.Set<Table> tablesToIgnore)
tablesToIgnore
- ignore this tablespublic java.util.Set<Table> closure(java.util.Set<Table> tablesToIgnore, java.util.Map<Table,java.lang.Integer> distances)
tablesToIgnore
- ignore this tablesdistances
- put distances into itpublic java.util.Set<Table> unrestrictedClosure()
public void setXmlTemplateInternal(java.lang.String xmlTemplate)
public void setXmlTemplate(java.lang.String xmlTemplate)
public java.lang.String getXmlTemplate()
public org.w3c.dom.Document getXmlTemplateAsDocument(Quoting quoting) throws javax.xml.parsers.ParserConfigurationException, org.xml.sax.SAXException, java.io.IOException
javax.xml.parsers.ParserConfigurationException
org.xml.sax.SAXException
java.io.IOException
public org.w3c.dom.Document getDefaultXmlTemplate(Quoting quoting) throws javax.xml.parsers.ParserConfigurationException, org.xml.sax.SAXException, java.io.IOException
javax.xml.parsers.ParserConfigurationException
org.xml.sax.SAXException
java.io.IOException
public org.w3c.dom.Document getXmlTemplateAsDocument(java.lang.String xmlTemplate, Quoting quoting) throws javax.xml.parsers.ParserConfigurationException, org.xml.sax.SAXException, java.io.IOException
javax.xml.parsers.ParserConfigurationException
org.xml.sax.SAXException
java.io.IOException
public java.lang.String getOriginalSchema(java.lang.String defaultSchema)
defaultSchema
- the default schema to return if table name is unqualifiedpublic java.lang.String getSchema(java.lang.String defaultSchema)
defaultSchema
- the default schema to return if table name is unqualifiedpublic java.lang.String getUnqualifiedName()
public void setOriginalName(java.lang.String originalName)
originalName
- the original namepublic java.lang.String getOriginalName()
public int getOrdinal()
public java.util.List<Column> getSelectionClause()
public boolean isExcludedFromDeletion()
public static void clearSessionProperties(Session session)
public java.util.List<Column> getNonVirtualPKColumns(Session session)
session
- the sessionpublic void setIsArtifical(boolean isArtifical)
isArtifical
- value to setpublic boolean isArtifical()
public void setIsDistinct(boolean isDistinct)
isDistinct
- value to setpublic boolean isDistinct()