Class DocHelper

java.lang.Object
org.hibernate.tool.internal.export.doc.DocHelper

public final class DocHelper extends Object
This helper class is used expose hibernate mapping information to the templates.
Author:
Ricardo C. Moral, Amit Bhayani
  • Field Details

    • DEFAULT_NO_SCHEMA_NAME

      public static final String DEFAULT_NO_SCHEMA_NAME
      Name to use if the schema is not specified.
      See Also:
    • DEFAULT_NO_PACKAGE

      public static final String DEFAULT_NO_PACKAGE
      Name to use if there are no packages specified for any class
      See Also:
  • Constructor Details

    • DocHelper

      public DocHelper(org.hibernate.boot.Metadata metadata, Properties properties, Cfg2JavaTool cfg2JavaTool)
  • Method Details

    • getTablesBySchema

      public Map<String,List<org.hibernate.mapping.Table>> getTablesBySchema()
      Return a Map with the tables keyed by Schema. The keys are the schema names and the values are Lists of tables.
      Returns:
      a Map with the tables keyed by Schema Name.
    • getClassesByPackage

      public Map<String,List<POJOClass>> getClassesByPackage()
      return a Map which has List of POJOClass as value keyed by package name as String.
      Returns:
    • getSchemas

      public List<String> getSchemas()
      Returns a list with all the schemas.
      Returns:
      a list with all the schemas.
    • getPackages

      public List<String> getPackages()
      Return a sorted List of packages
      Returns:
    • getTables

      public List<org.hibernate.mapping.Table> getTables(String schema)
      Return the list of tables for a particular schema.
      Parameters:
      schema - the name of the schema.
      Returns:
      a list with all the tables.
    • getClasses

      public List<POJOClass> getClasses(String packageName)
      return a sorted List of POJOClass corresponding to packageName passed
      Parameters:
      packageName - packageName other than DEFAULT_NO_PACKAGE
      Returns:
      a sorted List of POJOClass
    • getTables

      public List<org.hibernate.mapping.Table> getTables()
      Return all the tables.
      Returns:
      all the tables.
    • getClasses

      public List<POJOClass> getClasses()
      Return a sorted List of all POJOClass
      Returns:
    • getQualifiedSchemaName

      public String getQualifiedSchemaName(org.hibernate.mapping.Table table)
      Returns the qualified schema name for a table. The qualified schema name will include the catalog name if one is specified.
      Parameters:
      table - the table.
      Returns:
      the qualified schema name for the table.
    • getQualifiedTableName

      public String getQualifiedTableName(org.hibernate.mapping.Table table)
      Returns the qualified name of a table.
      Parameters:
      table - the table.
      Returns:
      the qualified name of the table.
    • getPropertyType

      public String getPropertyType(org.hibernate.mapping.Property p)
    • getQualifiedColumnName

      public String getQualifiedColumnName(org.hibernate.mapping.Table table, org.hibernate.mapping.Column column)
      Returns the qualified name of a column.
      Parameters:
      table - the table.
      column - the column
      Returns:
      the FQN of the column.
    • getSQLTypeName

      public String getSQLTypeName(org.hibernate.mapping.Column column)
      Get the SQL type name for a column.
      Parameters:
      column - the column.
      Returns:
      a String with the SQL type name.
    • getLength

      public int getLength(org.hibernate.mapping.Column column)
    • getPrecision

      public int getPrecision(org.hibernate.mapping.Column column)
    • getScale

      public int getScale(org.hibernate.mapping.Column column)
    • getPrimaryKeyColumnIterator

      public Iterator<org.hibernate.mapping.Column> getPrimaryKeyColumnIterator(org.hibernate.mapping.Table table)
    • getValues

      public List<org.hibernate.mapping.Value> getValues(org.hibernate.mapping.Table table, org.hibernate.mapping.Column column)
      Returns the values that use the specified column.
      Parameters:
      table - the table.
      column - the column.
      Returns:
      a list with the values.
    • getProperties

      public List<org.hibernate.mapping.Property> getProperties(org.hibernate.mapping.Table table, org.hibernate.mapping.Column column)
      Returns the properties that map to a column.
      Parameters:
      table - the table.
      column - the column.
      Returns:
      a list of properties.
    • getComponentPOJO

      public POJOClass getComponentPOJO(org.hibernate.mapping.Property property)
      Method used in class.vm template to get the ComponentPOJO class corresponding to Property if its of Type Component.
      Parameters:
      property - Get ComponentPOJO corresponding to this Property
      Returns:
      POJOClass for Property
    • getInheritanceHierarchy

      public List<POJOClass> getInheritanceHierarchy(POJOClass pc)
    • getOrderedProperties

      public List<org.hibernate.mapping.Property> getOrderedProperties(POJOClass pojoClass)
    • getSimpleProperties

      public List<org.hibernate.mapping.Property> getSimpleProperties(POJOClass pojoClass)
    • getOrderedSimpleProperties

      public List<org.hibernate.mapping.Property> getOrderedSimpleProperties(POJOClass pojoClass)