Interface RevengStrategy

All Known Implementing Classes:
AbstractStrategy, DefaultStrategy, DelegatingStrategy, TableSelectorStrategy

public interface RevengStrategy
  • Method Details

    • setSettings

      void setSettings(RevengSettings settings)
      Generic method used to initialize the reverse engineering strategy.
      Parameters:
      settings - used for this
    • close

      void close()
      Close any resources this strategy might have used. Called after reverse engineering has been completed.
    • tableToClassName

      String tableToClassName(TableIdentifier tableIdentifier)
      Returns:
      a fully-qualified class name
    • columnToPropertyName

      String columnToPropertyName(TableIdentifier table, String column)
      Return a property name for a Column.
      Parameters:
      column - a columnname
      Returns:
      a property name
    • excludeTable

      boolean excludeTable(TableIdentifier ti)
    • excludeColumn

      boolean excludeColumn(TableIdentifier identifier, String columnName)
    • columnToHibernateTypeName

      String columnToHibernateTypeName(TableIdentifier table, String columnName, int sqlType, int length, int precision, int scale, boolean nullable, boolean generatedIdentifier)
      Gets the preferred Hibernate type for an SQL type.
      Parameters:
      table - name of the table, can be null
      columnName - name of the column, can be null
      sqlType - The sql type.
      length - The length of the column.
      precision - The number of decimal digits, if applicable.
      scale - The scale, if applicable.
      nullable - The nullability of the column
      generatedIdentifier - true if for a column used in an identifier that is not "assigned", false otherwise.
      Returns:
      The Preferred hibernate type name.
    • getForeignKeys

      List<org.hibernate.mapping.ForeignKey> getForeignKeys(TableIdentifier referencedTable)
      Gets the user defined foreign keys.
      Parameters:
      referencedTable - the table to get the foreign keys for
      Returns:
      a list of ForeignKey's
    • getTableIdentifierStrategyName

      String getTableIdentifierStrategyName(TableIdentifier identifier)
      Parameters:
      identifier - the table to look up for
      Returns:
      the identifier strategy name wanted for a specific table, null if use what the database metadata can tell.
    • getTableIdentifierProperties

      Properties getTableIdentifierProperties(TableIdentifier identifier)
    • getPrimaryKeyColumnNames

      List<String> getPrimaryKeyColumnNames(TableIdentifier identifier)
      If a table does not have any primarykey columns reported, this method is called.
      Returns:
      list of strings for each column name that is part of the primary key
    • classNameToCompositeIdName

      String classNameToCompositeIdName(String className)
      Given a class name return the name for its composite id if it will have one.
      Parameters:
      className -
      Returns:
    • getOptimisticLockColumnName

      String getOptimisticLockColumnName(TableIdentifier identifier)
      Return explicit which column name should be used for optimistic lock
    • useColumnForOptimisticLock

      boolean useColumnForOptimisticLock(TableIdentifier identifier, String column)
    • getSchemaSelections

      List<RevengStrategy.SchemaSelection> getSchemaSelections()
      Return list of SchemaSelctors to be used when asking RevengDialect for metadata.
      Returns:
      list of RevengStrategy.SchemaSelection instances
    • tableToIdentifierPropertyName

      String tableToIdentifierPropertyName(TableIdentifier tableIdentifier)
      Given a table name, return the wanted name for the identifier.
      Parameters:
      tableIdentifier -
      Returns:
      name to be used for identification
    • tableToCompositeIdName

      String tableToCompositeIdName(TableIdentifier identifier)
      Given a table name, return the wanted name for a composite identifier.
      Parameters:
      identifier -
      Returns:
    • tableToMetaAttributes

      Map<String,org.hibernate.mapping.MetaAttribute> tableToMetaAttributes(TableIdentifier tableIdentifier)
      Return the list of metaattributes to assign to classes created based on the given table
      Parameters:
      tableIdentifier -
      Returns:
      a Map from String to MetaAttribute
    • columnToMetaAttributes

      Map<String,org.hibernate.mapping.MetaAttribute> columnToMetaAttributes(TableIdentifier identifier, String column)
      Return the list of metaattributes to assign to properties created based on the given column
      Parameters:
      column -
      tableIdentifier -
      Returns:
      a Map from String to MetaAttribute
    • excludeForeignKeyAsCollection

      boolean excludeForeignKeyAsCollection(String keyname, TableIdentifier fromTable, List<?> fromColumns, TableIdentifier referencedTable, List<?> referencedColumns)
      Should this foreignkey be excluded as a oneToMany
    • excludeForeignKeyAsManytoOne

      boolean excludeForeignKeyAsManytoOne(String keyname, TableIdentifier fromTable, List<?> fromColumns, TableIdentifier referencedTable, List<?> referencedColumns)
      Should this foreignkey be excluded as a many-to-one
    • isForeignKeyCollectionLazy

      boolean isForeignKeyCollectionLazy(String name, TableIdentifier foreignKeyTable, List<?> columns, TableIdentifier foreignKeyReferencedTable, List<?> referencedColumns)
      is the collection lazy or not ?
    • foreignKeyToCollectionName

      String foreignKeyToCollectionName(String keyname, TableIdentifier fromTable, List<?> fromColumns, TableIdentifier referencedTable, List<?> referencedColumns, boolean uniqueReference)
      Return a collection role name for a Collection based on the foreignkey.
      Parameters:
      fromColumns - list of Column instances on the fromTable. Only col.getName() should be assumed to be correct
      referencedColumns - list of Column instances on the referenced Table. Only col.getName() should be assumed to be correct
      uniqueReference - true if there is no other references to the same table
      Returns:
    • foreignKeyToEntityName

      String foreignKeyToEntityName(String keyname, TableIdentifier fromTable, List<?> fromColumns, TableIdentifier referencedTable, List<?> referencedColumns, boolean uniqueReference)
      Parameters:
      fromColumns - list of Column instances on the fromTable. Only col.getName() should be assumed to be correct
      referencedColumns - list of Column instances on the referenced Table. Only col.getName() should be assumed to be correct
      uniqueReference - true if there is no other references to the same table
      Returns:
    • foreignKeyToInverseEntityName

      String foreignKeyToInverseEntityName(String keyname, TableIdentifier fromTable, List<?> fromColumns, TableIdentifier referencedTable, List<?> referencedColumns, boolean uniqueReference)
      Used to rename the inverse one-to-one properties.
      Parameters:
      fromColumns - list of Column instances on the fromTable. Only col.getName() should be assumed to be correct
      referencedColumns - list of Column instances on the referenced Table. Only col.getName() should be assumed to be correct
      uniqueReference - true if there is no other references to the same table
      Returns:
      null if use defaults or non-empty String with a specific name
    • isManyToManyTable

      boolean isManyToManyTable(org.hibernate.mapping.Table table)
      Parameters:
      table -
      Returns:
      true if this table is considered to be a many-to-many table.
    • foreignKeyToManyToManyName

      String foreignKeyToManyToManyName(org.hibernate.mapping.ForeignKey fromKey, TableIdentifier middleTable, org.hibernate.mapping.ForeignKey toKey, boolean uniqueReference)
      Parameters:
      middleTable -
      uniqueReference - true if there is no other references to the same table
      fromColumns - list of Column instances on the fromTable. Only col.getName() should be assumed to be correct
      referencedColumns - list of Column instances on the referenced Table. Only col.getName() should be assumed to be correct
      Returns:
    • isOneToOne

      boolean isOneToOne(org.hibernate.mapping.ForeignKey foreignKey)
    • isForeignKeyCollectionInverse

      boolean isForeignKeyCollectionInverse(String name, org.hibernate.mapping.Table foreignKeyTable, List<?> columns, org.hibernate.mapping.Table foreignKeyReferencedTable, List<?> referencedColumns)
    • foreignKeyToAssociationInfo

      AssociationInfo foreignKeyToAssociationInfo(org.hibernate.mapping.ForeignKey foreignKey)
    • foreignKeyToInverseAssociationInfo

      AssociationInfo foreignKeyToInverseAssociationInfo(org.hibernate.mapping.ForeignKey foreignKey)