This is a migrated thread and some comments may be shown as answers.

How to insert data from jsp to database using hibernate

1 Answer 24 Views
Grid
This is a migrated thread and some comments may be shown as answers.
ILYA
Top achievements
Rank 1
ILYA asked on 28 Feb 2019, 02:57 PM

Hello!

We using Batch editing Grid from springdemos and unfortunatelly, after pressing "Save changes" data doesn't insert from jsp to database (if you reload page, it will save, but if you open your database, you can't see any changes).

We find a piece of code (using debug), where we come, when we want to save (commit) changes (it's model "ProductDao"):

@Override
public void saveOrUpdate(List<Product> products) {
Session session = sessionFactory.getCurrentSession();

for (Product product : products) {
session.saveOrUpdate(product);
}
}

So what do we need to write here to commit changes to database?

1 Answer, 1 is accepted

Sort by
0
Tsvetomir
Telerik team
answered on 04 Mar 2019, 02:45 PM
Hi Ilya,

The Kendo UI Grid is a client-side widget which is designed to provide easy-to-use and rich variety of configurations. It has a data source which is used to make the connection between the client-side and the server-side. When changes are made, they are saved locally in the data source. 

With that said, the saving of the modified data items to the database has to be handled on the server side according to the developer's preferences. You can check the following resources which cover in details the matter:

As a side note, below the grid itself, there is a tab strip in which the relevant files are attached, for example in this case - the view and the controller:



Finally, you might be interested in running our demos locally:
Within the EditingController.java file, the implementation of the update operation can be observed. Take a look at the provided resources above and let me know in case additional clarifications are needed.


Best regards,
Tsvetomir
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.

Tags
Grid
Asked by
ILYA
Top achievements
Rank 1
Answers by
Tsvetomir
Telerik team
Share this question
or