开发者

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 giv开发者_StackOverflow社区e 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.


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.


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜