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?
|