This week's book giveaway is in the Clojure forum.
We're giving away four copies of Clojure in Action and have Amit Rathore and Francis Avila on-line!
See this thread for details.
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Hibernate and small web apps

 
Stef Mischook
Greenhorn
Posts: 15
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is there any point to using JDO or Hibernate for small web apps that may have only a few tables to deal with and perhaps 1/2 dozen queries? Or are these tools more or less show their stuff in the enterprise arena?

Thanks,

Stefan
 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Depends really. I'd think more how likely said "small web app" was to be deployed with a different DB than that it was developed on. Once you get past the initial learning curve I'd say Hibernate was pretty much comparable with JDBC for complecity.
 
Stef Mischook
Greenhorn
Posts: 15
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In terms of complecity ... yes about the same as JDBC.

In terms of time in development - based on my initial impression I would say that projects with 10 tables or less and only a couple of queries a table you are going to write much less code via JDBC.

I think ORM shines with larger projects.
 
pascal betz
Ranch Hand
Posts: 547
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
if you already know SQL/your object model is simple, then have a look at ibatis sql maps.
Your SQL queries/inserts/updates are stored in xml files (that is nice if someone else than the java programmer writes the SQL or you want to change to another DB).
This is an select statement in ibatis (taken from ibatis.com)

<select id="getAddress" parameterClass="int"
resultClass="examples.domain.Address">
select
ADR_ID as id,
ADR_DESCRIPTION as description,
ADR_STREET as street,
ADR_CITY as city,
ADR_PROVINCE as province,
ADR_POSTAL_CODE as postalCode
from ADDRESS
where ADR_ID = #value#
</select>


if you execute this statement, then you will get a prefilled examples.domain.Address object where ADR_ID is like the parameter you pass in. You are not restricted to pass only one paramter: you can also pass maps or beans.

i think it is a nice, thin layer above your database. perhaps a good fit if you do not need a full featured/complex system like hibernate.

pascal
 
Stef Mischook
Greenhorn
Posts: 15
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey Pascal,

Thanks for the heads up on Abatis, looks very good.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic