I\'m looping list and inserting into database , but its getting updating records one by one.finally i\'m seeing in database last record of the list only.
input name
With the save() method in a session, Hibernate couples the object to a row and this relation remains while the session remains active. Therefore, if you use the same object, you actually update the existing row. The solution is to construct a new object for every row. In this case:
for (String item : items)
{
Feature feature = new Feature();
feature.setName(item);
session.save(feature);
}