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: 5.6.15.Final
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 */
<#foreach table in tables> 
  <#if table.isPhysicalTable()>
  /* Node ${table.name} */
  <@nodeName table/> [ label = "<@columnLabels name=table.name columns=table.columnIterator/>" ]  
  
  <@propertyEdges root=table.name?replace(".","_dot_") foreignKeys=table.foreignKeyIterator/>     
  


}

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

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

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




© 2015 - 2024 Weber Informatics LLC | Privacy Policy