• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Hibernate + Swing Is possible?????

 
Edward Durai
Ranch Hand
Posts: 223
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Xperts,

Is it possible to combine Hibernate + Swing?

(My Point of View Hibernate Contains Transaction, Session... But In Swing Session???)
So i have lot of confusions.

SO
if Hibernate + Swing
IF YES. HOW? ELSE TELL THE REASON.

I EAGERLY WAITING FOR YOUR REPLY
Thanks
Edward and Hari
 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Is it possible to combine Hibernate + Swing?

Yes. You can pretty much use any java based technology in conjunction with another.

What is your specific confusion?
[ January 20, 2006: Message edited by: Paul Sturrock ]
 
Edward Durai
Ranch Hand
Posts: 223
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello Sir, Thanks for ur kind reply. I am still confused. Pls tell me
Is it possible to handle Sessions in Swing? Because Hibernate handles session.
How Can I combine swing with Hibernate? Give me small Idea.

Thanks
Edward
 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Is it possible to handle Sessions in Swing?

Yes. Using Hibernate from a Java application that uses the Swing API is no different from using Hibernate from an Java application that use any other part of the Java API. Swing does not "handle Sessions" implicitly. You write your application to open and close a Hibernate Session as you need it.
 
Vinnie Jenks
Ranch Hand
Posts: 207
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I've never used Hibernate w/ Swing but I would suspect that, being a rich-client app, it would be much easier than having to deal w/ the request/response issues w/ Hibernate sessions in a servlet environment.

You could probably open a single session for the lifetime of the running Swing app and close it when the app closes.
 
Edward Durai
Ranch Hand
Posts: 223
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank You. Which IDE is best suitable for developing Hibernate Application.

Which is the best MyEclipse or NetBeans?

thanks
 
Vinnie Jenks
Ranch Hand
Posts: 207
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well, that's a matter of opinion. However, if you're working with Swing, Netbeans 5.0 can't be beat - not even close. The matisse layout in NB 5.0 is amazing...it makes Swing fun.

However, there is no official "support" for Hibernate in Netbeans...but really we're just talking about a couple of libraries and some XML config files...it's not like Netbeans doesn't handle that well, it certainly does.

Eclipse has a Hibernate plug-in but I've never used it. After all of the maddening headaches I've experienced w/ Eclipse, I'm not sure I'll ever use it again for anything...especially J2EE development...Netbeans just blows the doors off of it these days.

HTH
 
Dave Brown
Ranch Hand
Posts: 301
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Agreeing with the last post, I use netbeans, they've just released V5 RC1 which in my opinion has a faster reponse time than the previous beta. (code completion wise anyway) So i'm very happy now with netbeans.

Its a doddle to use with hibernate, just add the hibernate jar to the project,define the hibernate config xml and an xml config for your bean you want to persist and you're done, It's much easier than I first thought it would be to use.

And as the previous post said, it's probably wise to open a hibernate session when you're app loads and then it'll be available to you until the app closes.

I dont want to get into an eclipse/netbeans debate but when all you have to do is what I said above to get it working with netbeans I dont really see the point in having to rely on plugins, I think people tend to pre-assume if something needs a plugin then it probably is quite complex to get started with. It's not.

Dave
 
Jesse Barnum
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Vinnie Jenks:
I've never used Hibernate w/ Swing but I would suspect that, being a rich-client app, it would be much easier than having to deal w/ the request/response issues w/ Hibernate sessions in a servlet environment.

You could probably open a single session for the lifetime of the running Swing app and close it when the app closes.


That won't work in a multi-user environment, because the data in the Hibernate session never gets updated after it is initially read and cached.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic