Archive

Archive for August 14, 2009

Java Persistence with Hibernate Part 3 – Create the Database and Persistent Class

August 14, 2009 1 comment

Create a Database

In using Hibernate you may either create the database first and create the class we need to persist or vice-versa.

create database enrollment;
create table student(
 student_id int,
 first_name varchar(40),
 last_name varchar(40),
 primary key(student_id)
);

With the SQL code above, we’ve created a database named “enrollment” and a table named “student” with three columns(student_id, first_name and last_name) with student_id as our primary key(unique identifier).
Read more…

Java Persistence with Hibernate Part 2 – Getting Started

August 14, 2009 Leave a comment

In Java Persistence with Hibernate Part 1 I’ve discussed the need for object/relational persistence and some things that Hibernate aims to answer.

Hibernate has several modules which answer specific problems. The two most important modules to learn are Hibernate Core and Hibernate Annotations.
Read more…

Follow

Get every new post delivered to your Inbox.