All Downloads are FREE. Search and download functionalities are using the official Maven repository.

dot.tablegraph.dot.ftl Maven / Gradle / Ivy

There is a newer version: 7.0.0.Beta1
Show newest version
digraph TableGraph {
  compound=true;
    bgcolor="white"; 
    fontcolor="black"; fontname="Helvetica"; fontsize="10.0"; 
    ranksep="equally"; 
    label="Table Graph"; 
    URL="http://tools.hibernate.org";
  edge [
        color="lightgrey", 
        fontcolor="black", 
        fontname="Helvetica", 
        fontsize="8.0",         
        labelangle=-25.0, 
        labeldistance=1.5
        headport=nw,
        tailport=se
        ];
  node [
       fontcolor="black",
       fontname="Helvetica", 
       fontsize="10.0", 
       shape=record, 
       fillcolor="yellow", 
       style="solid,filled"];

/* TODO: multi schema tables */
<#list tables as table>
  <#if table.isPhysicalTable()>
  /* Node ${table.name} */
  <@nodeName table/> [ label = "<@columnLabels name=table.name columns=table.columns/>" ]  
  
  <@propertyEdges root=table.name?replace(".","_dot_") foreignKeys=table.foreignKeys.values()/>     
  


}

<#macro nodeName table>${table.name?replace(".","_dot_")}

<#macro columnLabels name columns>
<@compress single_line=true>
             { 
                ${name?replace(".","\\.")}|
                <#list columns as p>
                   <${p.name}>${p.name}\l
                   <#if p_has_next>|
                
              }

<#macro propertyEdges root foreignKeys>
  /* edges/nodes for ${root} */
  <#list foreignKeys as fk>
     ${root} -> <@nodeName fk.referencedTable/> [ 
        label="${fk.name}" 
        ]
  




© 2015 - 2024 Weber Informatics LLC | Privacy Policy