<?xml version='1.0' encoding="UTF-8"?>

<!--
  ~ Hibernate, Relational Persistence for Idiomatic Java
  ~
  ~ License: GNU Lesser General Public License (LGPL), version 2.1 or later.
  ~ See the lgpl.txt file in the root directory or <http://www.gnu.org/licenses/lgpl-2.1.html>.
  -->
<preface xml:id="preface" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
    <title>Preface</title>

    <para>
        Developing Object-Oriented software that deals with data from Relational Databases can be cumbersome and
        resource consuming.  Development costs are significantly higher due to a paradigm mismatch between how data is
        represented in objects versus relational databases.  Hibernate is an Object/Relational Mapping (ORM) solution
        for Java environments.  ORM refers to the technique of mapping data between an object model representation to
        a relational data model representation.  See
        <link xlink:href="http://en.wikipedia.org/wiki/Object-relational_mapping">Wikipedia</link>
        for a good high-level discussion.  Also, Martin Fowler's
        <link xlink:href="http://martinfowler.com/bliki/OrmHate.html">OrmHate</link> article takes a look at many of
        the mentioned mismatch problems.
    </para>

    <para>
        Although having a strong background in SQL is not required to use Hibernate, having a basic understanding of the
        concepts can help you understand Hibernate more quickly and fully.  An understanding of data modeling principles
        is especially important.  Both <link xlink:href="http://www.agiledata.org/essays/dataModeling101.html"/> and
        <link xlink:href="http://en.wikipedia.org/wiki/Data_modeling"/> are good starting points for understanding these
        data modeling principles.
    </para>

    <para>
        Understanding the basics of transactions and design patterns such as "Unit of Work"<citation>PoEAA</citation>
        or "ApplicationTransaction" are important as well.  These topics will be discussed in the documentation, but
        a prior understanding will certainly help.
    </para>

    <para>
        Hibernate not only takes care of the mapping from Java classes to database tables (and from Java data types to
        SQL data types), but also provides data query and retrieval facilities. It can significantly reduce
        development time otherwise spent with manual data handling in SQL and JDBC.  Hibernate’s design goal is to
        relieve the developer from 95% of common data persistence-related programming tasks by eliminating the need for
        manual, hand-crafted data processing using SQL and JDBC.  However, unlike many other persistence solutions,
        Hibernate does not hide the power of SQL from you and guarantees that your investment in relational technology
        and knowledge is as valid as always.
    </para>

    <para>
        Hibernate may not be the best solution for data-centric applications that only use stored-procedures to
        implement the business logic in the database, it is most useful with object-oriented domain models and business
        logic in the Java-based middle-tier. However, Hibernate can certainly help you to remove or encapsulate
        vendor-specific SQL code and will help with the common task of result set translation from a tabular
        representation to a graph of objects.
    </para>

    <para>
        See <link xlink:href="http://hibernate.org/orm/contribute/"/> for information on getting involved.
    </para>

    <tip>
        <para>
            If you are just getting started with using Hibernate you may want to start with the
            <citetitle pubwork="article">Hibernate Getting Started Guide</citetitle> available from the
            <link xlink:href="http://hibernate.org/orm/documentation">documentation page</link>.  It contains quick-start
            style tutorials as well as lots of introductory information.  There is also a series of topical guides
            providing deep dives into various topics.
        </para>
    </tip>

</preface>
