-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: hibernate with spring
PostPosted: Fri Apr 18, 2008 12:57 am 
Regular
Regular

Joined: Sun Apr 13, 2008 3:04 am
Posts: 71
Location: Bangalore
on study for hibernate and spring, I see the info of spring able to avoid boiler place code etc.. more at
http://www.geekinterview.com/question_details/48893

However, is this real benifit of spring, I could clearly expect hibernate to provide such template api or one could write on their own some thing like this..

private static void persist(final Persistant aPersistant,
final Operation aOperation)
throws Exception
{
if (aPersistant != null)
{
aPersistant.validate();

Session lSession = null;
try
{
lSession = HibernateUtil.getTransactionSession();
switch (aOperation)
{
case SAVE:
{
lSession.save(aPersistant);
break;
}
case UPDATE:
{
lSession.update(aPersistant);
break;
}
case DELETE:
{
lSession.delete(aPersistant);
break;
}
}
}
finally
{
HibernateUtil.closeSession(lSession);
}
}
}

...

is any one from hibernate could highlight significance of using spring with hibernate..

Regards,

_________________
Raja Nagendra Kumar,
C.T.O
http://www.tejasoft.com
TejaSoft - Specialists in Code Audit, Unit Testing and Merciless Re-factoring - Engineering Crisis Turnaround Experts


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.