persistence

Nico Heid's picture

Java persistence with Hibernate and Annotations

Hibernate is a well known object-relational mapping library (ORM) for Java. It allows you to map entries in your relational database to objects in your Java classes.
Usually this is done by a mapping file written in XML. As this approach is a bit more expensive we will use annotations to map a class to the relating database table.
Based on the Maven tutorial by my colleague Phillip, we will begin with a quickstart archetype and include Hibernate and a MySQL connection. Then we will write a simple data access object (DAO) which maps to the database table we will create. After that we use a class to set up the connection and fill the database with some of our objects.

Note: This is just a superficial glance at Hibernate to get in touch with the framework.
Read more

Syndicate content