• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

which one should I choose?

 
xu yuanzhi
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I work with a application by struts and spring. I do not want to use hibernate as my app is small and hql is so limited. So which r/m should I use?

I need it to map query result to a Object that I defined myself and easy to manage my sql as in hibernate.
 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

I do not want to use hibernate as my app is small and hql is so limited.

What SQL features do you want that are not supplied by HQL? If you are using complex or proprietary SQL its unlikely any ORM tool will provided all the capabilities you need (though of course most of them, Hibernate included, will not stop you running native SQL).
 
xu yuanzhi
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You are right. But in my application, I think it's unnecessary to use hibernate. My friend suggest ibatis and I try it. Maybe it's ok. And thank you.
 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

But in my application, I think it's unnecessary to use hibernate

If its unecessary to use Hibernate, why choose iBatis instead?
 
Mark Spritzler
ranger
Sheriff
Posts: 17278
6
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
While I use Hibernate in every app I do that needs a database, which is every app I do.

But if it is small, and you need something quick and only queries and simple tables, one to one mapping of classes, then iBatis might be the perfect choice. or use JavaRanch's Jenny http://www.javaranch.com/jenny_beta/jennyFAQ.jsp

Mark
 
Gregg Bolinger
Ranch Hand
Posts: 15304
6
Chrome IntelliJ IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm typically one to +1 iBatis for most use cases. Even over Hibernate. But depending on how small your app is, iBatis can even be overkill. I'd suggest taking a look at Spring's SimpleJdbcDaoSupport and interfaces like RowMapper. They work very well and if you are already using Spring then shouldn't be anything extra to add.
 
ankur rathi
Ranch Hand
Posts: 3830
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What's the issue with JDBC???
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic