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…
Categories: Hibernate, Java
Hibernate, Java, Object Relational Mapping, Persistence

Recent Comments