I have a bean of type string[] which has two or more values. I want to save the array:
user.setItem(item[i]);
session.beginTransaction();
session.save(user);
session.getTransaction().commit();
But I am getting only one data item saved not the entire array .
If you are using Annotation, do as follows (Use List instead of Array)
And do as follows
Because you have a managed Entity instance (User) and the lifecycle of a value-type instance (your String list) is bound to that of its owning entity instance (User). Hibernate will save your new item.