Class DocHelper
java.lang.Object
org.hibernate.tool.internal.export.doc.DocHelper
This helper class is used expose hibernate mapping information to the
templates.
- Author:
- Ricardo C. Moral, Amit Bhayani
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionDocHelper(org.hibernate.boot.Metadata metadata, Properties properties, Cfg2JavaTool cfg2JavaTool) -
Method Summary
Modifier and TypeMethodDescriptionReturn a sorted List of all POJOClassgetClasses(String packageName) return a sorted List of POJOClass corresponding to packageName passedreturn a Map which has List of POJOClass as value keyed by package name as String.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.intgetLength(org.hibernate.mapping.Column column) List<org.hibernate.mapping.Property> getOrderedProperties(POJOClass pojoClass) List<org.hibernate.mapping.Property> getOrderedSimpleProperties(POJOClass pojoClass) Return a sorted List of packagesintgetPrecision(org.hibernate.mapping.Column column) Iterator<org.hibernate.mapping.Column> getPrimaryKeyColumnIterator(org.hibernate.mapping.Table table) List<org.hibernate.mapping.Property> getProperties(org.hibernate.mapping.Table table, org.hibernate.mapping.Column column) Returns the properties that map to a column.getPropertyType(org.hibernate.mapping.Property p) getQualifiedColumnName(org.hibernate.mapping.Table table, org.hibernate.mapping.Column column) Returns the qualified name of a column.getQualifiedSchemaName(org.hibernate.mapping.Table table) Returns the qualified schema name for a table.getQualifiedTableName(org.hibernate.mapping.Table table) Returns the qualified name of a table.intgetScale(org.hibernate.mapping.Column column) Returns a list with all the schemas.List<org.hibernate.mapping.Property> getSimpleProperties(POJOClass pojoClass) getSQLTypeName(org.hibernate.mapping.Column column) Get the SQL type name for a column.List<org.hibernate.mapping.Table> Return all the tables.List<org.hibernate.mapping.Table> Return the list of tables for a particular schema.Return a Map with the tables keyed by Schema.List<org.hibernate.mapping.Value> getValues(org.hibernate.mapping.Table table, org.hibernate.mapping.Column column) Returns the values that use the specified column.
-
Field Details
-
DEFAULT_NO_SCHEMA_NAME
Name to use if the schema is not specified.- See Also:
-
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
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
return a Map which has List of POJOClass as value keyed by package name as String.- Returns:
-
getSchemas
Returns a list with all the schemas.- Returns:
- a list with all the schemas.
-
getPackages
Return a sorted List of packages- Returns:
-
getTables
Return the list of tables for a particular schema.- Parameters:
schema- the name of the schema.- Returns:
- a list with all the tables.
-
getClasses
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
Return all the tables.- Returns:
- all the tables.
-
getClasses
Return a sorted List of all POJOClass- Returns:
-
getQualifiedSchemaName
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
Returns the qualified name of a table.- Parameters:
table- the table.- Returns:
- the qualified name of the table.
-
getPropertyType
-
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
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
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
-
getOrderedProperties
-
getSimpleProperties
-
getOrderedSimpleProperties
-