Forums Register Login

using Hibernate with Session Bean

+Pie Number of slices to send: Send
Hi,
I am working over a project that uses struts, hibernate and EJB.
I am using JBoss and MySQL and Netbeans IDE.

I created a JavaEE Project in Netbeans and in EJB module I have created few entity classes from database.
Now I have to create SessionBean which activates after i log into the system and then perform few task such as create and delete users.
I am confused how to use hibernate in my session bean to read and write database....

Help Me Please....!!!
I am badly stucked with this thing.....!!!



Thanks In Advance
1
+Pie Number of slices to send: Send
Have you started by looking at the documentation? If not this is a good place to begin.
+Pie Number of slices to send: Send
Moreover, you should have mentioned the EJB version you are using.

Some sample code would have of the session bean in question is also not a bad thing to share...
+Pie Number of slices to send: Send

This is my session bean class structure......
I am using EJB 3.0
These classes are in an EJB Module....
and i am developing a web project using struts....
now I have a form... where will submit information....
now i wanna do is that this session ejb starts when the user log in and when the user create a new user then this createUser function in session bean.... write it into the database using hibernate....

I am totally confused how to sort this thing out...


is it possible to access hibernate in an EJB module


any kind of code or tutorial will help me

Thank you in advance.....!!!
+Pie Number of slices to send: Send
 


is it possible to access hibernate in an EJB module


Yes. There is nothing unusual about Hibernate - it is just another Java application.

The documentation I mentioned above is a good place to start.I'd recommend spending a little time writing a stand alone application, just so you can simplify the problem, then hook it into your EJB application.
+Pie Number of slices to send: Send
Thank you Paul.....
I have been through that document and it helped.
May be some more time spending on that will work out my problem...

Just a one simple question do I have to use JPA for this job to be done...???
+Pie Number of slices to send: Send
JPA has support for using ORM frameworks like Hibernate (I mean the annotations and all)

But that is not a good reason to use JPA. There should be other reasons too like vendor neutral
+Pie Number of slices to send: Send
 

Sunny Bhandari wrote:JPA has support for using ORM frameworks like Hibernate


No, that's the other way around. Hibernate offers a JPA implementation.
+Pie Number of slices to send: Send
Well I Have changed the overall logic for my application and now My problem is resolved

Thank you all for the concern
look! it's a bird! it's a plane! It's .... a teeny tiny ad
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com


reply
reply
This thread has been viewed 2534 times.
Similar Threads
connection not released
How to access a Bean in From Separate EAR.
How to add web module in ejb module in netbeans for stateless session bean
how to connect to a database in hibernate
NetBeans and MySQL
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 28, 2024 19:31:47.