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,