Tag: crudrepository
-
How to create a Database and perform CRUD operations in MongoDB through command prompt?
MongoDB is one of the most popular NoSQL databases . Instead of inserting rows into tables as in traditional relational databases you insert documents into collections in a MongoDB. The documents have the structure of a JSON. And the documents dont have to have a defined structure as tables need to in a relational database.…
-
How to write custom queries in Spring Data at method level?
Say you want to write a custom JPA query for one of your data requirements. Spring Data provides great abstraction over JPA to perform CRUD operations. You can easily retrieve entity objects from database based on field values using methods like ‘findByName’ , ‘findByNameAndAge’ etc in your interface extending Spring Data repositories. If you need…
-
How to delete records in Spring Data based on multiple field values?
Spring Data has made it so easy to deal with database. Most boiler plate code are removed and user can just concentrate on the business logic. Here is a simple way to delete records using multiple field values from a relational database table . STEP 1: Prepare your entity which corresponds to the table. Write…