Module org.eclipse.persistence.core
Class DatabaseTable
java.lang.Object
org.eclipse.persistence.internal.helper.DatabaseTable
- All Implemented Interfaces:
Serializable
,Cloneable
,CoreTable
- Direct Known Subclasses:
DecoratedDatabaseTable
,HistoricalDatabaseTable
,NestedTable
,SubSelectDatabaseTable
INTERNAL:
Purpose: Define a fully qualified table name.
Responsibilities:
- Allow specification of a qualifier to the table, i.e. creator or database.
- See Also:
-
Field Summary
Modifier and TypeFieldDescriptionprotected String
protected Map
<String, ForeignKeyConstraint> JPA 2.1 Foreign key specification dataprotected List
<IndexDefinition> Store the set of indexes defined through meta-data for the table.protected String
protected String
protected String
Contains the user specified unique constraints.protected boolean
-
Constructor Summary
ConstructorDescriptionInitialize the newly allocated instance of this class.DatabaseTable
(String possiblyQualifiedName) DatabaseTable
(String tableName, String qualifier) DatabaseTable
(String tableName, String qualifier, boolean useDelimiters, String startDelimiter, String endDelimiter) DatabaseTable
(String possiblyQualifiedName, String startDelimiter, String endDelimiter) -
Method Summary
Modifier and TypeMethodDescriptionvoid
addForeignKeyConstraint
(ForeignKeyConstraint foreignKeyConstraint) void
addIndex
(IndexDefinition index) Add an index definition to this table.void
addUniqueConstraints
(String name, List<String> columnNames) Add the unique constraint for the columns names.clone()
Return a shallow copy of the receiver.boolean
Two tables are equal if their names and tables are equal, or their names are equal and one does not have a qualifier assigned.boolean
equals
(DatabaseTable table) Two tables are equal if their names and tables are equal, or their names are equal and one does not have a qualifier assigned.returns the suffix applied to the CREATE table statement on this field for DDL generation.Return a list of index definitions.getName()
Get method for table name.getNameDelimited
(DatasourcePlatform platform) Get method for table name.getQualifiedNameDelimited
(DatasourcePlatform platform) getTableQualifierDelimited
(DatasourcePlatform platform) Return a list of the unique constraints for this table.boolean
int
hashCode()
Return the hashcode of the name, because it is fairly unique.boolean
boolean
hasName()
Determine whether the receiver has any identification information.boolean
boolean
INTERNAL: Is this decorated / has an AS OF (some past time) clause.void
printSQL
(ExpressionSQLPrinter printer) Print the table's SQL from clause.protected void
void
setCreationSuffix
(String creationSuffix) void
Set the table name.void
Set the table name.void
setPossiblyQualifiedName
(String possiblyQualifiedName) Used to map the project xml.void
setPossiblyQualifiedName
(String possiblyQualifiedName, String startDelimiter, String endDelimiter) void
setTableQualifier
(String qualifier) void
setTableQualifier
(String qualifier, String startDelimiter, String endDelimiter) void
setUseDelimiters
(boolean useDelimiters) boolean
toString()
-
Field Details
-
name
-
tableQualifier
-
qualifiedName
-
foreignKeyConstraints
JPA 2.1 Foreign key specification data -
uniqueConstraints
Contains the user specified unique constraints. JPA 2.0 introduced the name element, therefore, if specified we will use that name to create the constraint. Constraints with no name will be added to the map under the null key and generated with a default name. Therefore, when a name is given the list size should only ever be 1. We will validate. The null key could have multiples however they will have their names defaulted (as we did before). -
indexes
Store the set of indexes defined through meta-data for the table. -
useDelimiters
protected boolean useDelimiters -
creationSuffix
-
-
Constructor Details
-
DatabaseTable
public DatabaseTable()Initialize the newly allocated instance of this class. By default their is no qualifier. -
DatabaseTable
-
DatabaseTable
-
DatabaseTable
-
DatabaseTable
-
-
Method Details
-
addForeignKeyConstraint
-
addIndex
Add an index definition to this table. -
addUniqueConstraints
Add the unique constraint for the columns names. Used for DDL generation. For now we just add all the unique constraints as we would have before when we didn't have a name. -
clone
Return a shallow copy of the receiver. -
equals
Two tables are equal if their names and tables are equal, or their names are equal and one does not have a qualifier assigned. This allows an unqualified table to equal the same fully qualified one. -
equals
Two tables are equal if their names and tables are equal, or their names are equal and one does not have a qualifier assigned. This allows an unqualified table to equal the same fully qualified one. -
getCreationSuffix
returns the suffix applied to the CREATE table statement on this field for DDL generation. -
getForeignKeyConstraint
-
getForeignKeyConstraints
-
getIndexes
Return a list of index definitions. Used for DDL generation. -
getName
Get method for table name. -
getNameDelimited
Get method for table name. -
getQualifiedName
-
getQualifiedNameDelimited
-
printSQL
Print the table's SQL from clause.- Throws:
IOException
-
getTableQualifierDelimited
-
getTableQualifier
-
hasUniqueConstraints
public boolean hasUniqueConstraints() -
hasForeignKeyConstraints
public boolean hasForeignKeyConstraints() -
hashCode
public int hashCode()Return the hashcode of the name, because it is fairly unique. -
hasIndexes
public boolean hasIndexes() -
getUniqueConstraints
Return a list of the unique constraints for this table. Used for DDL generation. -
hasName
public boolean hasName()Determine whether the receiver has any identification information. Return true if the name or qualifier of the receiver are nonempty. -
isDecorated
public boolean isDecorated()INTERNAL: Is this decorated / has an AS OF (some past time) clause. Example: SELECT ... FROM EMPLOYEE AS OF TIMESTAMP (exp) t0 ... -
resetQualifiedName
protected void resetQualifiedName() -
setCreationSuffix
-
setName
Set the table name. Used when aliasing table names. -
setName
Set the table name. Used when aliasing table names. If the name contains database delimiters, they will be stripped and a flag will be set to have them added when the DatabaseTable is written to SQL -
setPossiblyQualifiedName
Used to map the project xml. Any time a string name is read from the project xml, we must check if it is fully qualified and split the actual name from the qualifier. -
setPossiblyQualifiedName
-
setTableQualifier
-
setTableQualifier
-
toString
-
setUseDelimiters
public void setUseDelimiters(boolean useDelimiters) -
shouldUseDelimiters
public boolean shouldUseDelimiters()
-