Public Types | Public Member Functions | Protected Attributes

alma.acs.tmcdb.translator.AbstractTableInheritance Class Reference

List of all members.

Public Types

enum  CascadeType {
  NONE, AGGREGATION, AGGREGATION_INVERSE, COMPOSITION,
  COMPOSITION_INVERSE
}

Public Member Functions

String getSuperTable (String table)
String getKeynameLowercase (String table)
boolean isKeyPiece (String table, String column)
List< String > getPkFkCombinationColumns (String table)
boolean isSuperClass (String table)
CascadeType getCascadeTypeForForeigKey (String name)
boolean hasXmlClobType (String tableName)
boolean isXmlClobType (String tableName, String columnName)
String getSequenceForTable (String tableName)
boolean generateInverseCollection (String tableName, String columnName)
String getEnumTypeForColumn (String tableName, String columnName)
Map< String, String > getEnumTypesForTable (String tableName)

Protected Attributes

Map< String, String > map
Map< String, String > keymap
Map< String, List< String > > keyColumnsMap
Map< String, List< String > > keyPiecesMap
Map< String, CascadeTypecascadingTypes
Map< String, List< String > > xmlClobTableColumns
Map< String, String > sequences
Map< String, String > duplicatedForeignKeys
Map< String, Map< String,
String > > 
checkConstraints

Member Enumeration Documentation

Enumerator:
NONE 
AGGREGATION 
AGGREGATION_INVERSE 
COMPOSITION 
COMPOSITION_INVERSE 

Member Function Documentation

boolean alma.acs.tmcdb.translator.AbstractTableInheritance.generateInverseCollection ( String  tableName,
String  columnName 
)

Check if the given column in the given table should generate an inverse collection in the referenced table class or not. This is necessary for the case that we have A extends B, and C referencing A and B. This would lead to the generation of Set<C> in both A and B, which translates into an error when hibernate is starting

Parameters:
tableName The table
columnName The column
Returns:
Whether the generator should generate the inverse collection for the table

References alma.acs.tmcdb.translator.AbstractTableInheritance.duplicatedForeignKeys.

CascadeType alma.acs.tmcdb.translator.AbstractTableInheritance.getCascadeTypeForForeigKey ( String  name  ) 

Checks which is the cascading options for the given foreign key

Parameters:
name The foreign key name
Returns:
The cascading type for the foreign key

References alma.acs.tmcdb.translator.AbstractTableInheritance.cascadingTypes.

Referenced by alma.acs.tmcdb.translator.AbstractReverseEngineeringStrategy.foreignKeyToAssociationInfo(), and alma.acs.tmcdb.translator.AbstractReverseEngineeringStrategy.foreignKeyToInverseAssociationInfo().

String alma.acs.tmcdb.translator.AbstractTableInheritance.getEnumTypeForColumn ( String  tableName,
String  columnName 
)

Returns all the columns, and their associated enum classes, that exist in a given table

Parameters:
tableName The table name
Returns:
A map with columns/enum classes.

References alma.acs.tmcdb.translator.AbstractTableInheritance.checkConstraints.

Referenced by alma.acs.tmcdb.translator.AbstractReverseEngineeringStrategy.columnToHibernateTypeName().

Map<String, String> alma.acs.tmcdb.translator.AbstractTableInheritance.getEnumTypesForTable ( String  tableName  ) 

Returns all the columns, and their associated enum classes, that exist in a given table

Parameters:
tableName The table name
Returns:
A map with columns/enum classes.

References alma.acs.tmcdb.translator.AbstractTableInheritance.checkConstraints.

Referenced by alma.acs.tmcdb.translator.AbstractReverseEngineeringStrategy.tableToMetaAttributes().

String alma.acs.tmcdb.translator.AbstractTableInheritance.getKeynameLowercase ( String  table  ) 

Returns the name for the key defined in the parent table for a given table.

Parameters:
table The name of the table
Returns:
The name (in lowercase) of the key column of the supertable, otherwise null

References alma.acs.tmcdb.translator.AbstractTableInheritance.keymap.

List<String> alma.acs.tmcdb.translator.AbstractTableInheritance.getPkFkCombinationColumns ( String  table  ) 

Returns a Map containing all the columns that are part of the PK/FK combination of a child table. Since they are defined in the parent class, the child class should not redefine them.

Parameters:
table The name of the table
Returns:
A java.util.List with the column names (lowercase) of the PK/FK

References alma.acs.tmcdb.translator.AbstractTableInheritance.keyColumnsMap.

Referenced by alma.acs.tmcdb.translator.AbstractReverseEngineeringStrategy.columnToMetaAttributes().

String alma.acs.tmcdb.translator.AbstractTableInheritance.getSequenceForTable ( String  tableName  ) 

Returns the name of the Oracle sequence for the given table

Parameters:
tableName The name of the table
Returns:
The name of the sequence, null if table doesn't have a generated ID

References alma.acs.tmcdb.translator.AbstractTableInheritance.sequences.

Referenced by alma.acs.tmcdb.translator.AbstractReverseEngineeringStrategy.tableToMetaAttributes().

String alma.acs.tmcdb.translator.AbstractTableInheritance.getSuperTable ( String  table  ) 

Returns the Java table name for the given sql-short table name

Parameters:
table The child table name, in the sql-short form
Returns:
The parent full original name, null if is has no parents.

References alma.acs.tmcdb.translator.AbstractTableInheritance.map.

Referenced by alma.acs.tmcdb.translator.AbstractReverseEngineeringStrategy.tableToMetaAttributes().

boolean alma.acs.tmcdb.translator.AbstractTableInheritance.hasXmlClobType ( String  tableName  ) 

Checks if a table contains at least one column of type XMLCLOB

Parameters:
tableName Name of the table
Returns:
Whether the table defines a column of type XMLCLOB in the model

References alma.acs.tmcdb.translator.AbstractTableInheritance.xmlClobTableColumns.

boolean alma.acs.tmcdb.translator.AbstractTableInheritance.isKeyPiece ( String  table,
String  column 
)

Checks whether the indicated column of the given table is part of the pieces that are supposed to generate the primary key. In the grammar, these are written after the GENERATED FROM statement of the key declaration, if any

Parameters:
table The table
column The columns
Returns:
Whether the given column participates in the creation of the PK of the mentioned table

References alma.acs.tmcdb.translator.AbstractTableInheritance.keyPiecesMap.

boolean alma.acs.tmcdb.translator.AbstractTableInheritance.isSuperClass ( String  table  ) 

Checks if a table is parent of another one or not

Parameters:
table The name of the table, lowercased
Returns:
If the table is super class of another one or not

References alma.acs.tmcdb.translator.AbstractTableInheritance.map.

boolean alma.acs.tmcdb.translator.AbstractTableInheritance.isXmlClobType ( String  tableName,
String  columnName 
)

Checks if a column of a given table is of type XMLCLOB

Parameters:
tableName Name of the table
columnName Name of the column
Returns:
Whether the column of the given table is of type XMLCLOB or not

References alma.acs.tmcdb.translator.AbstractTableInheritance.xmlClobTableColumns.


Member Data Documentation

Map<String, Map<String, String> > alma.acs.tmcdb.translator.AbstractTableInheritance.checkConstraints [protected]

The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Enumerations Properties