In following example , I am selecting two columns passing columns name at run time (by passing parameter in getAllGraphData method).
public List getAllGraphData(int loginId, String bodyStats, String fixedDatePeriod) {
List list = null;
session = HibernateUtil.getSession();
transaction = session.beginTransaction();
list = session.createSQLQuery("select * from user_stats where loginId=:LoginId")
.addScalar(fixedDatePeriod)
.addScalar(bodyStats)
.setInteger("LoginId", loginId).list();
}
0 comments:
Post a Comment