Software Secret Weapons™

 
Linguine Maps For Hibernate
by Pavel Simakov on 2005-12-09 11:34:01 under Linguine Maps, view comments
Bookmark and Share
 

Index  •  Intro  •  WSDL  •  Apache Ant  •  DTD's for XML  •  ObJectRelationalBridge  •  Hibernate  •  Gallery  •  FAQ  •  Help  •  JavaDoc  •  Download
Hibernate Configuration  •  Object Relational Impedance Mismatch  

Linguine Maps for Hibernate is an open-source utility that will automatically produce easy to read UML-style entity-relation diagrams from Hibernate mapping files. The diagram shows all the entities with their attributes from the original Hibernate mapping files and the relationships between entities. Create diagrams from XML mapping files or  visualize Hibernate Configuration object  directly.

There is absolutely no manual work! It is fully automatic! Use it online now! Just paste your favorite database Hibernate mapping file into a web form and instantly view a diagram! With a diagram it will take you only minutes to become familiar with Hibernate mapping files. Having UML-style diagrams is a great way to improve team communication. Diagrams are better understood by business people, compared to the source code. And developers can always go back to source files when more details are needed.

Here we defined a simple Hibernate mapping file for customer/order/product. And converted it to a diagram. It is that easy!


<hibernate-mapping>
    <class name="Customer" table="customers">
        <id name="id"/>
        <property name="name"/>
        <set name="orders" inverse="true">
            <key column="customer_id"/>
            <one-to-many class="Order"/>
        </set>
    </class>

    <class name="Order" table="orders">
        <id name="id"/>
        <property name="date"/>
        <many-to-one name="customer" class="Customer"/>
        <list name="lineItems" table="line_items">
            <key column="order_id"/>
            <composite-element class="LineItem">
                <property name="quantity"/>
                <many-to-one name="product" class="Product"/>
            </composite-element>
        </list>
    </class>

    <class name="Product" table="products">
        <id name="id"/>
        <property name="serialNumber"/>
    </class>
</hibernate-mapping>

There are many more sample diagrams available for Hibernate mapping files.

Linguine Maps is written in Java and provides clean object-oriented diagramming API for graph visualization. We developed a full set of Apache ANT tasks for integrating programmatic visualization with the build process. This package also contains demo applications that show you how to visualize abstract graphs.

Comments (3)

  • Comment by dimuthul — August 20, 2007 @ 2:24 am

    I simply cannot get this working on Linux :(((.

  • Comment by Nikhil — December 18, 2008 @ 6:43 am

    Hi dimuthul ,
    I think one should install graphviz. Am I right Pavel ?

  • Comment by siva — January 20, 2009 @ 2:37 am

    i want to know more about the mappings & relationships


Leave a comment


  Copyright © 2004-2014 by Pavel Simakov
any conclusions, recommendations, ideas, thoughts or the source code presented on this site are my own and do not reflect a official opinion of my current or past employers, partners or clients