-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: Tutorial/Example/Sample Code for Hibernate in Session EJB
PostPosted: Tue Mar 14, 2006 3:40 am 
Newbie

Joined: Mon Mar 13, 2006 5:21 am
Posts: 1
Hi.

I'm new to Hibernate and I've read through the tutorial roadmap for new users and Chapter 2 of the reference plus some tutorials on the Web. I have so far also completed the Hibernate installation and database configuration successfully.

What I would like to do is to develop a session EJB (to deploy under WebLogic server) that acts as a facade that accesses Hibernate to persist POJOs (or called value objects?) to database.

Does anyone know of a tutorial, or demo/example/sample code that I can reference to see how to use Hibernate from within a session EJB. The only vague idea I know is that I have to create a database connection pool and my code has to use InitialContext to grab hold of Hibernate's SessionFactory. And I have to map the different properties of my POJOs to the database tables' columns and to create the relationships, which I've no difficulty comprehending.

When installing, I was told to copy my database JDBC driver JAR file (I'm using Oracle so I copied ojdbc14.jar) to C:\hibernate-3.1\lib and it worked. But the sample is for a standalone Java application. For EJB, the database access is done through a connection pool, so I do wonder how to connect my database connection pool to Hibernate, and then create a SessionFactory from my code.

In addition, how do I package my EJB and EAR? Is there any additional special steps or files to add into my EJB JAR or Application EAR file? I do know that I've to add Hibernate3.jar into my EJB-JAR at the root directory. Any special configuration I have to do for the WebLogic application server (e.g. add the Hibernate3.jar file to the server /lib directory?)

Question 1: how does WebLogic Server know where Hibernate file and/or that the Hibernate class files are contained in Hibernate3.jar?

Question 2: Do I have to edit my META-INF/MANIFEST.MF file to reference Hibernate?


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
cron
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.