mathlovingkitten
mathlovingkitten

Reputation: 168

Hibernate Setup

I always used Hibernate annotations in my old job, but since all our projects were already set up, I never really learned the mechanism behind it.

Could someone please give me a brief outline of how to set everything up, just to get me started?

I am developing in Java using Maven and Oracle 10g Express Edition. My IDE is Eclipse.

Upvotes: 3

Views: 7269

Answers (2)

Navin Israni
Navin Israni

Reputation: 1377

The (non-Maven) steps to build a Hibernate project in Eclipse would be: Step 1: Add the required JARs to setup Hibernate project Step 2: Add the JARs to the lib folder of your project Step 3: Additionally, I would suggest you to explore the Hibernate directory structure since you are using it for the first time.

If you need more assistance, I wrote a post on my site http://myjavatrainer.com/setup-hibernate-project/

Hope it will be helpful to you.

Maven is build tool for your projects. Maven is a build tool by Apache, it will help to manage the dependencies better. You will have to install Maven separately and set it up. Read its documentation full and get it setup. Instead of creating a normal Java app or a web app in Eclipse, you will be creating a Maven project.

MAKE SURE YOU ADD A JAR FOR DRIVER CONNECTOR for the type of database you are planning to use through Hibernate.

Upvotes: 1

dml
dml

Reputation: 469

I'd recommend starting with the Hibernate tutorial. Basically, you'll need to create a Hibernate configuration file on your classpath (dropping it in src/main/resources works with the default Maven project layout) and then start annotating your data objects. There's a tutorial for Hibernate with XML configuration as well.

Upvotes: 3

Related Questions