Posts

Showing posts from December, 2011

Simple Hands on Hibernate

Image
Hi, In the below post will try to explain how to create simple Hibernate Project from crash. Below is the scenario: I have an EVENT table and want to insert one simple row in that table. Here is the table script: CREATE TABLE EVENT_DETAILS  ( NAME VARCHAR2(20),  LOCATION VARCHAR2(20),  ID VARCHAR2(20) NOT NULL,  CONSTRAINT EVENT_DETAILS_PK PRIMARY KEY (ID) ) First, you need to download the Hibernate Distribution Bundle, you can get it here: http://www.hibernate.org/downloads Extract the Zip file and use Hibernate.jar . Here I downloaded " hibernate-distribution-3.6.8.Final " but we will be traditional mapping files in this example. Now, create a new Java Project in eclipse. Say, " SampleBankPartyApp ". Create a folder structure under your project: " config/orm/hibernate/cfg " and " config/orm/hibernate/hbm " Next, we need to create Hibernate Configuration file. Here I am using Oracle 11g database. You can change the confi