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

dot.entitygraph.dot.ftl Maven / Gradle / Ivy

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

<#list md.entityBindings as entity>
  /* Node ${entity.entityName} */
  <@nodeName entity.entityName/> [ label = "<@propertyLabels name=entity.entityName properties=entity.properties/>", URL="${entity.entityName?replace(".","/")}.html" ]
  /* Subclass edges for ${entity.entityName} */
  <#list entity.getDirectSubclasses() as subclass>
     <@nodeName subclass.entityName/> -> <@nodeName entity.entityName/>  [ weight="10", arrowhead="onormal"  ]
  
  
  <@propertyEdges root=entity.entityName?replace(".","_dot_") properties=entity.properties/>     


}

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

<#macro propertyLabels name properties>
<@compress single_line=true>
             { 
                ${name?replace(".","\\.")}|
                <#list properties as p>
                  <#if p.value.isSimpleValue()> 
                   ${p.name}\l
                 
                
              }

<#macro dumpComponent compProperty>
      <#assign component=compProperty.value>
      /* Node component ${component} */
      ${c2h.getHibernateTypeName(compProperty)?replace(".","_dot_")} [ 
        label = "<@propertyLabels name=component.componentClassName properties=component.properties/>"
           ]
      <@propertyEdges root=component.componentClassName?replace(".","_dot_") properties=component.properties/>   


<#macro propertyEdges root properties>
  /* Property edges/nodes for ${root} */
  <#list properties as property>
     <#if c2h.getSafeHibernateTypeName(property)?exists>
     ${root} -> ${c2h.getHibernateTypeName(property)?replace(".","_dot_")} [ 
        label="${property.name}" 
        <#if c2j.isComponent(property)>
        arrowtail="diamond"
        
        ]
     
     <#if c2j.isComponent(property)>
     <@dumpComponent property/>
     
     
  




© 2015 - 2024 Weber Informatics LLC | Privacy Policy