doc.tables.table.ftl Maven / Gradle / Ivy
<#import "/doc/common.ftl" as common>
Hibernate Mappings - Table Info
<@common.header/>
Schema ${dochelper.getQualifiedSchemaName(table)}
Table ${table.name}
<#if table.comment?exists>
${table.comment}
#if>
Column Summary
Name
SqlType
Length
Precision
Scale
Nullable
Unique
<#list table.columns as column>
${column.name}
${dochelper.getSQLTypeName(column)}
${dochelper.getLength(column)}
${dochelper.getPrecision(column)}
${dochelper.getScale(column)}
${column.nullable?string}
${column.unique?string}
#list>
<#-- SHOW THE PRIMARY KEY -->
Primary Key
Name
Columns
<#if table.hasPrimaryKey()>
<#if table.primaryKey.name?has_content>
${table.primaryKey.name}
<#else>
Name not specified
#if>
<#list dochelper.getPrimaryKeyColumnIterator(table) as column>
${column.name}
#list>
<#else>
No Primary Key
#if>
<#-- SHOW THE FOREIGN KEYS -->
<#if !table.foreignKeys.isEmpty()>
Foreign Keys
Name
Referenced Table
Columns
<#list table.foreignKeys.values() as foreignKey>
${foreignKey.name?default("Name not specified")}
${foreignKey.referencedTable.name}
<#list foreignKey.columns as column>
${column.name}
#list>
#list>
#if>
<#-- SHOW THE UNIQUE KEYS -->
<#if !table.uniqueKeys.isEmpty()>
Unique Keys
Name
Columns
<#list table.uniqueKeys.values() as uniqueKey>
${uniqueKey.name?default("Name not specified")}
<#list uniqueKey.columns as column>
${column.name}
#list>
#list>
#if>
<#-- SHOW THE TABLE INDEXES -->
<#if !table.indexes.isEmpty()>
Indexes
Name
Columns
<#list table.indexes.values() as index>
${index.name?default("Name not specificed")}
<#list index.columns as column>
${column.name}
#list>
#list>
#if>
<#if !table.columns.isEmpty()>
Column Detail
<#list table.columns as column>
${column.name}
-
Type: ${dochelper.getSQLTypeName(column)}
-
Length: ${dochelper.getLength(column)}
-
Precision: ${dochelper.getPrecision(column)}
-
Scale: ${dochelper.getScale(column)}
-
Nullable: ${column.nullable?string}
-
Unique: ${column.unique?string}
-
Comment: ${column.comment?if_exists}
<#--
Mappings:
<#list dochelper.getProperties(table, column) as property>
property.persistentClass.className - property.name
#list>
-->
#list>
#if>