Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Hibernate; Making life easier.

 
Zeki Karaca
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi @all,

I have been using hibernate for a few months now and i am not satisfied with it. Hibernate should make life easier but i have experienced some major drawbacks when using hibernate. As a start, configuring hibernate can be a pain in the ass. I lost about a week just to get it all setup and running like i needed to. Hibernate is also trying to reinvent the wheel. It even uses its own HQL. Why not use plain SQL? And Hibernate Annotations makes code messy, large and less readable. So is this the best we can do? I think there will be better techniques, maybe withing a reasonable amount of time, that will really do way better than hibernate. There must be.

So how do you guys experience hibernate. Do you like it or not?
 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

It even uses its own HQL. Why not use plain SQL?

Because there is no such thing as "plain SQL". ANSI 92 SQL is the closest thing we have to a cross platform standard and it is variously implemented accross all databases. Some database implement some of it, others all, some implement it all but prefer their own varient. HQL is so close to SQL in syntax that I find it pretty easy to switch between the two.


And Hibernate Annotations makes code messy, large and less readable.

If you are not a not a fan of annotation, why use them?

I like Hibernate. OK its not perfect, but I can remember the days when a decent Java ORM didn't exist. Not good times.
 
Sean Clark
Rancher
Posts: 377
Android Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey,

It's sad to hear about your bad experience with hibernate, I have to say it has been a lot of help for me as it takes away a lot of the mundane tasks of going through resultsets creating entities from the data. I tend to generate the entities from the database tables using either the JPA function from Eclipse or using Hibernate Tools. I don't usually use HQL for the querys (I think the reason they use it is because it is not database specific - unlike SQL) however if you want to use SQL hibernate will not stop you. I tend to use the Criteria interface for searching.

I haven't really used any other ORMs so I would also be interested if people had other opinions, but for what I have used it for, Hibernate has done its job so far.

Sean
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic