In the Database:
TIMESTAMP DEVICE_ID SRC_ADDR PKTS_FWDED
-------------------------------------------
2010-08-10 11:45:07.547 4 2887253771 3
2010-08-10 11:45:09.547 4 2887253771 18
output of Hibernate:
TIMESTAMP = 2010-08-10 11:45:07.547 DEVICE_ID: 4 SRC_ADDR: 2887253771 PKTS_FWDED 3
TIMESTAMP = 2010-08-10 11:45:07.547 DEVICE_ID: 4 SRC_ADDR: 2887253771 PKTS_FWDED 3 <-- duplicate of the first entry
Code
Session session = getHibernateUtil().getSession();
Query query = session.getNamedQuery(queryName);
for (Map.Entry<String, ?>e : queryParameters.entrySet()){
query.setParameter(e.getKey(), e.getValue());
}
return query.list();