Sample Apps: Spring data MongoDB and JSF Integration tutorial (PART 5)
In the last part of this tutorial, we will add create, edit and delete function to the MongoShop Product Catalog application.
The search page is modified. A modal confirm dialogue box is added before the product is physically deleted
updated search.xhtml
updated ProductSearchBean.java
A product detail page is added to view the produc details. Creation and edition of product is done in the product detail page.
detail.xhtml
ProductDetailsBean.java
updated ProductService.java
Conclusion:
1. Spring Data Mongo DB provides MongoTemplate which allow you to perform MongoDB operation easily.
2. MongoDB JSON-style document could mapped to POJO easily with the help of Spring Data MongoDB
3. Repository abstraction of spring data reduces the boilerplate code write for accessing MongoDB.
4. You add custom behaviour to spring data repository.
Source Code:
Originally published at https://www.borislam.com on December 9, 2021.