• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Is it necessary to use Hibernate in this case?

 
Andres Delrotti
Ranch Hand
Posts: 178
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have an application which displays the monthly assignment schedule of every employee. Each employee is assigned a task each day and let's say I have 175 employees......so...in a month....there would be (30x175) = 5250 employee-task assignment information. That would mean retrieving 5250 records from the DB if I wanted to view the employee assignment monthly schedule....and let's say there are other more complicated information involved here along with the sorting of data.

So in this particular case? Is it necessary to use Hibernate to minimize complexity in coding especially in the queries? or should I stick with using JDBC? What are the main pros and cons of each?
[ October 04, 2005: Message edited by: aj delr ]
 
Gerardo Tasistro
Ranch Hand
Posts: 362
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I would definetly use Hibernate. The pros I see is that structre is really easy to map to an hbm file and let H deal with the SQL writing. You can also use LAZY http://www.hibernate.org/280.html to save on the resources by not initializing all the objects. Plus in the future you will probably expand or modify the data structure. With H you basically just edit the hbm. With JDBC you have to go SQL hunting.
 
necati sekkeli
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think it depends on how much you use Hibernate before. In my opinion, Hibernate will be useful in design phase. But if you are a newbie in Hibernate , 5000 entities also can be handled without Hibernate too.
 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Hibernate will be useful in design phase

Hibernate is an impementation, not a design tool. I don't know if it really brings anything to the design phase. If you design your software using OO concepts you are basically writing in the requirement to have an ORM layer somewhere - either writing it yourself or using some third party tool such as Hibernate. And its presence should not (in my opinion) influence any ER modelling decisions, despite Hibernate's docs suggesting you can design data models from the Object model down.

(BTW: this wasn't the question asked but you mention it in your reply: 5000 entities would probably strongly suggest some sort of mapping layer, since an entity = one table not one record. So you would be looking at a fairly big ER model)
[ October 07, 2005: Message edited by: Paul Sturrock ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic