SlideShare a Scribd company logo
Hibernate
Object/Relational Mapping and Transparent
Object Persistence for Java and SQL Databases
Facts about Hibernate
True transparent persistence
Query language aligned with SQL
Does not use byte code enhancement
Free/open source
What is Hibernate?
** Hibernate is a powerful, ultra-high performance object/relational
persistence and query service for Java. Hibernate lets you develop
persistent objects following common Java idiom - including association,
inheritance, polymorphism, composition and the Java collections
framework. Extremely fine-grained, richly typed object models are
possible. The Hibernate Query Language, designed as a "minimal"
object-oriented extension to SQL, provides an elegant bridge between
the object and relational worlds. Hibernate is now the most popular
ORM solution for Java.
** http://www.hibernate.org
Object-relational
impedance mismatch
Object databases are not the answer
Application Objects cannot be easily
persisted to relational databases
Similar to the putting square peg into round
hole
Object/Relational
Mapping (ORM)
Mapping application objects to relational
database
Solution for infamous object-relational
impedance mismatch
Finally application can focus on objects
Transparent Persistence
Persist application objects without knowing
what relational database is the target
Persist application objects without
“flattening” code weaved in and out of
business logic
Query Service
Ability to retrieve sets of data based on
criteria
Aggregate operations like count, sum, min,
max, etc.
Why use Hibernate?
Simple to get up and running
Transparent Persistence achieved using
Reflection
Isn’t intrusive to the build/deploy process
Persistence objects can follow common java
idioms: Association, Inheritance,
Polymorphism, Composition, Collections
In most cases Java objects do not even know
they can be persisted
Why use Hibernate
cont
Java developer can focus on object modeling
Feels much more natural than Entity Beans or
JDBC coding
Query mechanism closely resembles SQL so
learning curve is low
What makes up a
Hibernate application?
Standard domain objects defined in Java as
POJO’s, nothing more.
Hibernate mapping file
Hibernate configuration file
Hibernate Runtime
Database
What is missing from a
Hibernate application?
Flattening logic in Java code to conform to
relational database design
Inflation logic to resurrect Java object from
persistent store
Database specific tweaks
Hibernate Classes
SessionFactory - One instance per app.
Creates Sessions. Consumer of hibernate
configuration file.
Session - Conversation between application
and Hibernate
Transaction Factory - Creates transactions to
be used by application
Transaction - Wraps transaction
implementation(JTA, JDBC)
Hibernate Sample App
Standard Struts Web Application
Deployed on JBoss
Persisted to MySQL database
All hand coded, didn’t use automated tools to
generate Java classes, DDL, or mapping files
Disclaimer: Made simple stupid on purpose
DVD Library
Functions
Add DVD’s to your collection
Output your collection
Separation of
Responsibility
Struts
Action
JSP
Persistence
classes
DVD POJO
public class DVD {
private Long id;
private String name;
private String url;
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
..
..
}
NOTE:
I transform
the DVDForm Bean to DVD
prior to persisting for
added flexibility
Hibernate Mapping File
DVD.hbm.xml
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD 2.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd">
<hibernate-mapping>
<class name="com.shoesobjects.DVD" table="dvdlist">
<id name="id" column="id" type="java.lang.Long" unsaved-value="null">
<generator class="native"/>
</id>
<property name="name" column="name" type="java.lang.String" not-null="true"/>
<property name="url" column="url" type="java.lang.String"/>
</class>
</hibernate-mapping>
Hibernate.properties
#################
### Platforms ########
#################
## JNDI Datasource
hibernate.connection.datasource java:/DVDDB
## MySQL
hibernate.dialect net.sf.hibernate.dialect.MySQLDialect
hibernate.connection.driver_class org.gjt.mm.mysql.Driver
hibernate.connection.driver_class com.mysql.jdbc.Driver
DVDService Class
public void updateDVD(DVD dvd) {
Session session = ConnectionFactory.getInstance().getSession();
try {
Transaction tx = session.beginTransaction();
session.update(dvd);
tx.commit();
session.flush();
} catch (HibernateException e) {
tx.rollback();
} finally {
// Cleanup
}
}
ConnectionFactory
public class ConnectionFactory {
private static ConnectionFactory instance = null;
private SessionFactory sessionFactory = null;
private ConnectionFactory() {
try {
Configuration cfg = new Configuration().addClass(DVD.class);
sessionFactory = cfg.buildSessionFactory();
} catch (Exception e) {
// Do something useful
}
}
public Session getSession() {
Session session = null;
try {
session = sessionFactory.openSession();
} catch (HibernateException e) {
// Do Something useful
}
return session;
}
ConnectionFactory
Improvedpublic class ConnectionFactory {
private static ConnectionFactory instance = null;
private SessionFactory sessionFactory = null;
private ConnectionFactory() {
try {
Configuration cfg = new Configuration().configure().buildSessionFactory();
} catch (Exception e) {
// Do something useful
}
}
public Session getSession() {
Session session = null;
try {
session = sessionFactory.openSession();
} catch (HibernateException e) {
// Do Something useful
}
return session;
}
Hibernate.cfg.xml
Alternative to hibernate.properties
Handles bigger applications better
Bind SessionFactory to JNDI Naming
Allows you to remove code like the following
and put it in a configuration file
Configuration cfg = new Configuration().addClass(DVD.class);
Sample
hibernate.cfg.xml
<?xml version='1.0' encoding='utf-8'?>
<!DOCTYPE hibernate-configuration PUBLIC "-//Hibernate/Hibernate Configuration DTD//EN"
"http://hibernate.sourceforge.net/hibernate-configuration-2.0.dtd">
<hibernate-configuration>
<!-- a SessionFactory instance listed as /jndi/name -->
<session-factory name="java:comp/env/hibernate/SessionFactory">
<property name="connection.datasource">java:/SomeDB</property>
<property name="show_sql">true</property>
<property name="dialect">net.sf.hibernate.dialect.MySQLDialect</property>
<property name="use_outer_join">true</property>
<property name="transaction.factory_class">net.sf.hibernate.transaction.JTATransactionFactory</>
<property name="jta.UserTransaction">java:comp/UserTransaction</property>
<!-- Mapping files -->
<mapping resource="com/shoesobjects/SomePOJO.hbm.xml"/>
</session-factory>
</hibernate-configuration>
Schema Generation
SchemaExport can generate or execute DDL
to generate the desired database schema
Can also update schema
Can be called via ant task
Code Generation
hbm2java
Parses hibernate mapping files and generates
POJO java classes on the fly.
Can be called via ant task
Mapping File Generation
MapGenerator - part of Hibernate extensions
Generates mapping file based on compiled
classes. Some rules apply.
Does repetitive grunt work
Links to live by
http://www.hibernate.org
http://www.springframework.org
http://www.jboss.org
http://raibledesigns.com/wiki/Wiki.jsp?
page=AppFuse

More Related Content

What's hot (20)

PPTX
Introduction to JPA Framework
Collaboration Technologies
 
ODP
Hibernate complete Training
sourabh aggarwal
 
PPTX
Hibernate
Prashant Kalkar
 
PPTX
Hibernate ppt
Aneega
 
PPT
Hibernate architecture
Anurag
 
PPTX
Introduction to Hibernate Framework
Raveendra R
 
PDF
Introduction to JPA and Hibernate including examples
ecosio GmbH
 
PPT
Hibernate presentation
Manav Prasad
 
PDF
Hibernate Presentation
guest11106b
 
PDF
Java persistence api 2.1
Rakesh K. Cherukuri
 
DOC
Hibernate tutorial for beginners
Rahul Jain
 
PPTX
Introduction to JPA (JPA version 2.0)
ejlp12
 
PPT
hibernate with JPA
Mohammad Faizan
 
PDF
JPA and Hibernate
elliando dias
 
PPTX
Hibernate Basic Concepts - Presentation
Khoa Nguyen
 
PPS
Java Hibernate Programming with Architecture Diagram and Example
kamal kotecha
 
ODP
Hibernate Developer Reference
Muthuselvam RS
 
PPT
Entity Persistence with JPA
Subin Sugunan
 
PPTX
Hibernate tutorial
Mumbai Academisc
 
PPTX
Spring (1)
Aneega
 
Introduction to JPA Framework
Collaboration Technologies
 
Hibernate complete Training
sourabh aggarwal
 
Hibernate
Prashant Kalkar
 
Hibernate ppt
Aneega
 
Hibernate architecture
Anurag
 
Introduction to Hibernate Framework
Raveendra R
 
Introduction to JPA and Hibernate including examples
ecosio GmbH
 
Hibernate presentation
Manav Prasad
 
Hibernate Presentation
guest11106b
 
Java persistence api 2.1
Rakesh K. Cherukuri
 
Hibernate tutorial for beginners
Rahul Jain
 
Introduction to JPA (JPA version 2.0)
ejlp12
 
hibernate with JPA
Mohammad Faizan
 
JPA and Hibernate
elliando dias
 
Hibernate Basic Concepts - Presentation
Khoa Nguyen
 
Java Hibernate Programming with Architecture Diagram and Example
kamal kotecha
 
Hibernate Developer Reference
Muthuselvam RS
 
Entity Persistence with JPA
Subin Sugunan
 
Hibernate tutorial
Mumbai Academisc
 
Spring (1)
Aneega
 

Viewers also liked (6)

PDF
iBATIS
techmonkey4u
 
PPTX
Cấu hình Hibernate
Minh Quang
 
PDF
Hướng dẫn lập trình java hibernate cho người mới bắt đầu
Thành Phạm Đức
 
PPT
Presentation JPA
JS Bournival
 
ODP
ORM, JPA, & Hibernate Overview
Brett Meyer
 
PPTX
Introduction to Hibernate Framework
Phuoc Nguyen
 
iBATIS
techmonkey4u
 
Cấu hình Hibernate
Minh Quang
 
Hướng dẫn lập trình java hibernate cho người mới bắt đầu
Thành Phạm Đức
 
Presentation JPA
JS Bournival
 
ORM, JPA, & Hibernate Overview
Brett Meyer
 
Introduction to Hibernate Framework
Phuoc Nguyen
 
Ad

Similar to Hibernate presentation (20)

PPT
Basic Hibernate Final
Rafael Coutinho
 
PDF
Hibernate 3
Rajiv Gupta
 
PPTX
Hibernate
Sujit Kumar
 
PPT
Hibernate
Preetha Ganapathi
 
PPT
Hibernate introduction
Sagar Verma
 
PPT
Hibernate
Shaharyar khan
 
ODP
Hibernate 18052012
Manisha Balwadkar
 
PPT
Hibernate for Beginners
Ramesh Kumar
 
PPTX
Module-3 for career and JFSD ppt for study.pptx
ViratKohli78
 
PPTX
Session 39 - Hibernate - Part 1
PawanMM
 
PPT
Hibernate
Murali Pachiyappan
 
PPTX
Hibernate
Mallikarjuna G D
 
PDF
What is hibernate?
kanchanmahajan23
 
PDF
Hibernate Tutorial
Syed Shahul
 
DOCX
What is hibernate?
kanchanmahajan23
 
PPT
Hibernate
VISHAL DONGA
 
PPTX
Hibernate in XPages
Toby Samples
 
PPT
What is hibernate?
kanchanmahajan23
 
PPT
5-Hibernate.ppt
ShivaPriya60
 
PPT
Persistence hibernate
Krishnakanth Goud
 
Basic Hibernate Final
Rafael Coutinho
 
Hibernate 3
Rajiv Gupta
 
Hibernate
Sujit Kumar
 
Hibernate introduction
Sagar Verma
 
Hibernate
Shaharyar khan
 
Hibernate 18052012
Manisha Balwadkar
 
Hibernate for Beginners
Ramesh Kumar
 
Module-3 for career and JFSD ppt for study.pptx
ViratKohli78
 
Session 39 - Hibernate - Part 1
PawanMM
 
Hibernate
Mallikarjuna G D
 
What is hibernate?
kanchanmahajan23
 
Hibernate Tutorial
Syed Shahul
 
What is hibernate?
kanchanmahajan23
 
Hibernate
VISHAL DONGA
 
Hibernate in XPages
Toby Samples
 
What is hibernate?
kanchanmahajan23
 
5-Hibernate.ppt
ShivaPriya60
 
Persistence hibernate
Krishnakanth Goud
 
Ad

More from Luis Goldster (20)

PPTX
Ruby on rails evaluation
Luis Goldster
 
PPTX
Design patterns
Luis Goldster
 
PPT
Lisp and scheme i
Luis Goldster
 
PPT
Ado.net &amp; data persistence frameworks
Luis Goldster
 
PPTX
Multithreading models.ppt
Luis Goldster
 
PPTX
Business analytics and data mining
Luis Goldster
 
PPTX
Big picture of data mining
Luis Goldster
 
PPTX
Data mining and knowledge discovery
Luis Goldster
 
PPTX
Cache recap
Luis Goldster
 
PPTX
Directory based cache coherence
Luis Goldster
 
PPTX
Hardware managed cache
Luis Goldster
 
PPTX
How analysis services caching works
Luis Goldster
 
PPT
Abstract data types
Luis Goldster
 
PPTX
Optimizing shared caches in chip multiprocessors
Luis Goldster
 
PPTX
Api crash
Luis Goldster
 
PPTX
Object model
Luis Goldster
 
PPTX
Abstraction file
Luis Goldster
 
PPTX
Object oriented analysis
Luis Goldster
 
PPT
Abstract class
Luis Goldster
 
PPTX
Concurrency with java
Luis Goldster
 
Ruby on rails evaluation
Luis Goldster
 
Design patterns
Luis Goldster
 
Lisp and scheme i
Luis Goldster
 
Ado.net &amp; data persistence frameworks
Luis Goldster
 
Multithreading models.ppt
Luis Goldster
 
Business analytics and data mining
Luis Goldster
 
Big picture of data mining
Luis Goldster
 
Data mining and knowledge discovery
Luis Goldster
 
Cache recap
Luis Goldster
 
Directory based cache coherence
Luis Goldster
 
Hardware managed cache
Luis Goldster
 
How analysis services caching works
Luis Goldster
 
Abstract data types
Luis Goldster
 
Optimizing shared caches in chip multiprocessors
Luis Goldster
 
Api crash
Luis Goldster
 
Object model
Luis Goldster
 
Abstraction file
Luis Goldster
 
Object oriented analysis
Luis Goldster
 
Abstract class
Luis Goldster
 
Concurrency with java
Luis Goldster
 

Recently uploaded (20)

PDF
"Beyond English: Navigating the Challenges of Building a Ukrainian-language R...
Fwdays
 
PDF
Exolore The Essential AI Tools in 2025.pdf
Srinivasan M
 
PPTX
WooCommerce Workshop: Bring Your Laptop
Laura Hartwig
 
PDF
CIFDAQ Weekly Market Wrap for 11th July 2025
CIFDAQ
 
PDF
New from BookNet Canada for 2025: BNC BiblioShare - Tech Forum 2025
BookNet Canada
 
PDF
Chris Elwell Woburn, MA - Passionate About IT Innovation
Chris Elwell Woburn, MA
 
PDF
Transcript: New from BookNet Canada for 2025: BNC BiblioShare - Tech Forum 2025
BookNet Canada
 
PDF
Jak MŚP w Europie Środkowo-Wschodniej odnajdują się w świecie AI
dominikamizerska1
 
PDF
POV_ Why Enterprises Need to Find Value in ZERO.pdf
darshakparmar
 
PPTX
AUTOMATION AND ROBOTICS IN PHARMA INDUSTRY.pptx
sameeraaabegumm
 
PDF
"AI Transformation: Directions and Challenges", Pavlo Shaternik
Fwdays
 
PDF
Agentic AI lifecycle for Enterprise Hyper-Automation
Debmalya Biswas
 
PPTX
Q2 FY26 Tableau User Group Leader Quarterly Call
lward7
 
PDF
Fl Studio 24.2.2 Build 4597 Crack for Windows Free Download 2025
faizk77g
 
PPTX
Building Search Using OpenSearch: Limitations and Workarounds
Sease
 
PDF
Smart Trailers 2025 Update with History and Overview
Paul Menig
 
PDF
July Patch Tuesday
Ivanti
 
PPTX
"Autonomy of LLM Agents: Current State and Future Prospects", Oles` Petriv
Fwdays
 
PDF
Newgen Beyond Frankenstein_Build vs Buy_Digital_version.pdf
darshakparmar
 
PDF
Biography of Daniel Podor.pdf
Daniel Podor
 
"Beyond English: Navigating the Challenges of Building a Ukrainian-language R...
Fwdays
 
Exolore The Essential AI Tools in 2025.pdf
Srinivasan M
 
WooCommerce Workshop: Bring Your Laptop
Laura Hartwig
 
CIFDAQ Weekly Market Wrap for 11th July 2025
CIFDAQ
 
New from BookNet Canada for 2025: BNC BiblioShare - Tech Forum 2025
BookNet Canada
 
Chris Elwell Woburn, MA - Passionate About IT Innovation
Chris Elwell Woburn, MA
 
Transcript: New from BookNet Canada for 2025: BNC BiblioShare - Tech Forum 2025
BookNet Canada
 
Jak MŚP w Europie Środkowo-Wschodniej odnajdują się w świecie AI
dominikamizerska1
 
POV_ Why Enterprises Need to Find Value in ZERO.pdf
darshakparmar
 
AUTOMATION AND ROBOTICS IN PHARMA INDUSTRY.pptx
sameeraaabegumm
 
"AI Transformation: Directions and Challenges", Pavlo Shaternik
Fwdays
 
Agentic AI lifecycle for Enterprise Hyper-Automation
Debmalya Biswas
 
Q2 FY26 Tableau User Group Leader Quarterly Call
lward7
 
Fl Studio 24.2.2 Build 4597 Crack for Windows Free Download 2025
faizk77g
 
Building Search Using OpenSearch: Limitations and Workarounds
Sease
 
Smart Trailers 2025 Update with History and Overview
Paul Menig
 
July Patch Tuesday
Ivanti
 
"Autonomy of LLM Agents: Current State and Future Prospects", Oles` Petriv
Fwdays
 
Newgen Beyond Frankenstein_Build vs Buy_Digital_version.pdf
darshakparmar
 
Biography of Daniel Podor.pdf
Daniel Podor
 

Hibernate presentation

  • 1. Hibernate Object/Relational Mapping and Transparent Object Persistence for Java and SQL Databases
  • 2. Facts about Hibernate True transparent persistence Query language aligned with SQL Does not use byte code enhancement Free/open source
  • 3. What is Hibernate? ** Hibernate is a powerful, ultra-high performance object/relational persistence and query service for Java. Hibernate lets you develop persistent objects following common Java idiom - including association, inheritance, polymorphism, composition and the Java collections framework. Extremely fine-grained, richly typed object models are possible. The Hibernate Query Language, designed as a "minimal" object-oriented extension to SQL, provides an elegant bridge between the object and relational worlds. Hibernate is now the most popular ORM solution for Java. ** http://www.hibernate.org
  • 4. Object-relational impedance mismatch Object databases are not the answer Application Objects cannot be easily persisted to relational databases Similar to the putting square peg into round hole
  • 5. Object/Relational Mapping (ORM) Mapping application objects to relational database Solution for infamous object-relational impedance mismatch Finally application can focus on objects
  • 6. Transparent Persistence Persist application objects without knowing what relational database is the target Persist application objects without “flattening” code weaved in and out of business logic
  • 7. Query Service Ability to retrieve sets of data based on criteria Aggregate operations like count, sum, min, max, etc.
  • 8. Why use Hibernate? Simple to get up and running Transparent Persistence achieved using Reflection Isn’t intrusive to the build/deploy process Persistence objects can follow common java idioms: Association, Inheritance, Polymorphism, Composition, Collections In most cases Java objects do not even know they can be persisted
  • 9. Why use Hibernate cont Java developer can focus on object modeling Feels much more natural than Entity Beans or JDBC coding Query mechanism closely resembles SQL so learning curve is low
  • 10. What makes up a Hibernate application? Standard domain objects defined in Java as POJO’s, nothing more. Hibernate mapping file Hibernate configuration file Hibernate Runtime Database
  • 11. What is missing from a Hibernate application? Flattening logic in Java code to conform to relational database design Inflation logic to resurrect Java object from persistent store Database specific tweaks
  • 12. Hibernate Classes SessionFactory - One instance per app. Creates Sessions. Consumer of hibernate configuration file. Session - Conversation between application and Hibernate Transaction Factory - Creates transactions to be used by application Transaction - Wraps transaction implementation(JTA, JDBC)
  • 13. Hibernate Sample App Standard Struts Web Application Deployed on JBoss Persisted to MySQL database All hand coded, didn’t use automated tools to generate Java classes, DDL, or mapping files Disclaimer: Made simple stupid on purpose
  • 14. DVD Library Functions Add DVD’s to your collection Output your collection
  • 16. DVD POJO public class DVD { private Long id; private String name; private String url; public Long getId() { return id; } public void setId(Long id) { this.id = id; } .. .. } NOTE: I transform the DVDForm Bean to DVD prior to persisting for added flexibility
  • 17. Hibernate Mapping File DVD.hbm.xml <?xml version="1.0"?> <!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 2.0//EN" "http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd"> <hibernate-mapping> <class name="com.shoesobjects.DVD" table="dvdlist"> <id name="id" column="id" type="java.lang.Long" unsaved-value="null"> <generator class="native"/> </id> <property name="name" column="name" type="java.lang.String" not-null="true"/> <property name="url" column="url" type="java.lang.String"/> </class> </hibernate-mapping>
  • 18. Hibernate.properties ################# ### Platforms ######## ################# ## JNDI Datasource hibernate.connection.datasource java:/DVDDB ## MySQL hibernate.dialect net.sf.hibernate.dialect.MySQLDialect hibernate.connection.driver_class org.gjt.mm.mysql.Driver hibernate.connection.driver_class com.mysql.jdbc.Driver
  • 19. DVDService Class public void updateDVD(DVD dvd) { Session session = ConnectionFactory.getInstance().getSession(); try { Transaction tx = session.beginTransaction(); session.update(dvd); tx.commit(); session.flush(); } catch (HibernateException e) { tx.rollback(); } finally { // Cleanup } }
  • 20. ConnectionFactory public class ConnectionFactory { private static ConnectionFactory instance = null; private SessionFactory sessionFactory = null; private ConnectionFactory() { try { Configuration cfg = new Configuration().addClass(DVD.class); sessionFactory = cfg.buildSessionFactory(); } catch (Exception e) { // Do something useful } } public Session getSession() { Session session = null; try { session = sessionFactory.openSession(); } catch (HibernateException e) { // Do Something useful } return session; }
  • 21. ConnectionFactory Improvedpublic class ConnectionFactory { private static ConnectionFactory instance = null; private SessionFactory sessionFactory = null; private ConnectionFactory() { try { Configuration cfg = new Configuration().configure().buildSessionFactory(); } catch (Exception e) { // Do something useful } } public Session getSession() { Session session = null; try { session = sessionFactory.openSession(); } catch (HibernateException e) { // Do Something useful } return session; }
  • 22. Hibernate.cfg.xml Alternative to hibernate.properties Handles bigger applications better Bind SessionFactory to JNDI Naming Allows you to remove code like the following and put it in a configuration file Configuration cfg = new Configuration().addClass(DVD.class);
  • 23. Sample hibernate.cfg.xml <?xml version='1.0' encoding='utf-8'?> <!DOCTYPE hibernate-configuration PUBLIC "-//Hibernate/Hibernate Configuration DTD//EN" "http://hibernate.sourceforge.net/hibernate-configuration-2.0.dtd"> <hibernate-configuration> <!-- a SessionFactory instance listed as /jndi/name --> <session-factory name="java:comp/env/hibernate/SessionFactory"> <property name="connection.datasource">java:/SomeDB</property> <property name="show_sql">true</property> <property name="dialect">net.sf.hibernate.dialect.MySQLDialect</property> <property name="use_outer_join">true</property> <property name="transaction.factory_class">net.sf.hibernate.transaction.JTATransactionFactory</> <property name="jta.UserTransaction">java:comp/UserTransaction</property> <!-- Mapping files --> <mapping resource="com/shoesobjects/SomePOJO.hbm.xml"/> </session-factory> </hibernate-configuration>
  • 24. Schema Generation SchemaExport can generate or execute DDL to generate the desired database schema Can also update schema Can be called via ant task
  • 25. Code Generation hbm2java Parses hibernate mapping files and generates POJO java classes on the fly. Can be called via ant task
  • 26. Mapping File Generation MapGenerator - part of Hibernate extensions Generates mapping file based on compiled classes. Some rules apply. Does repetitive grunt work
  • 27. Links to live by http://www.hibernate.org http://www.springframework.org http://www.jboss.org http://raibledesigns.com/wiki/Wiki.jsp? page=AppFuse