public void saveHoliday(TblLegalHoliday holiday) {
final String seqScript = "select " + Constant.SeqConstant.SEQ_HR
+ ".nextval from dual";
Object numObj = getHibernateTemplate().execute(new HibernateCallback() {
public Object doInHibernate(Session session)
throws HibernateException, SQLException {
return session.createSQLQuery(seqScript).uniqueResult();
}
});
holiday.setId((BigDecimal) numObj);
this.getHibernateTemplate().save(holiday);
}
final String seqScript = "select " + Constant.SeqConstant.SEQ_HR
+ ".nextval from dual";
Object numObj = getHibernateTemplate().execute(new HibernateCallback() {
public Object doInHibernate(Session session)
throws HibernateException, SQLException {
return session.createSQLQuery(seqScript).uniqueResult();
}
});
holiday.setId((BigDecimal) numObj);
this.getHibernateTemplate().save(holiday);
}