Spring Core

Spring Data MongoDB Insert document

<p>In this tutorial&comma; we will discuss the inserting document to the MongoDB&period; The document is the same as a row in the table of the relational database&period; In our example&comma; we will insert a document to &&num;8220&semi;<b>dojCollection<&sol;b>&&num;8221&semi; of &&num;8220&semi;<b>dineshonjavaDB<&sol;b>&&num;8220&semi;&period;<&sol;p>&NewLine;<h2><b>Methods for saving and inserting documents-<&sol;b><&sol;h2>&NewLine;<p>There are several convenient methods on MongoTemplate for saving and inserting your objects&period; To have more fine-grained control over the conversion process you can register Spring converters with the MappingMongoConverter&comma;<br &sol;>&NewLine;for example&comma; <b>Converter&lt&semi;Employee&comma; DBObject&gt&semi;<&sol;b> and <b>Converter&lt&semi;DBObject&comma; Employee&gt&semi;<&sol;b>&period;<&sol;p>&NewLine;<p><b>Note&colon; <i>The difference between insert and save operations is that a save operation will perform an insert if the object is not already present&period;<&sol;i><&sol;b><br &sol;>&NewLine;<b>1&period; <&sol;b>&OpenCurlyDoubleQuote;<b>save<&sol;b>” is means &OpenCurlyDoubleQuote;insert it if a record does not exist” and &OpenCurlyDoubleQuote;update it if a record has existed”&comma; or simply saveOrUpdate&lpar;&rpar;&period;<br &sol;>&NewLine;<b>2&period; <&sol;b>&OpenCurlyDoubleQuote;<b>insert<&sol;b>” is means &OpenCurlyDoubleQuote;insert it if a record is not exited” and &OpenCurlyDoubleQuote;ignore it if a record has existed”&period;<&sol;p>&NewLine;<p>The simple case of using the save operation is to save a POJO&period; In this case&comma; the collection name will be determined by name &lpar;not fully qualified&rpar; of the class&period; You may also call the save operation with a specific collection name&period; The collection to store the object can be <i>overridden<&sol;i> using mapping metadata&period;<&sol;p>&NewLine;<p>When inserting or saving&comma; if the Id property is not set&comma; the assumption is that its value will be autogenerated by the database&period; As such&comma; for autogeneration of an ObjectId to succeed the type of the Id property&sol;field in your class must be either a String&comma; ObjectId&comma; or BigInteger&period;<&sol;p>&NewLine;<p>In Spring data for MongoDB&comma; you can use save&lpar;&rpar;&comma; insert&lpar;&rpar; and insertList&lpar;&rpar; to save domain object into mongoDB database&period;<&sol;p>&NewLine;<pre class&equals;"highlight">Employee employee &equals; new Employee&lpar;"&period;&period;&period;"&rpar;&semi;&NewLine; &NewLine; &sol;&sol;save employee object into "employee" collection&NewLine; mongoOperation&period;save&lpar;employee&rpar;&semi;&NewLine; &NewLine; &sol;&sol;save employee object into "newCollection" collection&NewLine; mongoOperation&period;save&lpar;"newCollection"&comma;employee &rpar;&semi;&NewLine; &NewLine; &sol;&sol;save employee object into "employee" collection&NewLine; mongoOperation&period;insert&lpar;employee&rpar;&semi;&NewLine; &NewLine; &sol;&sol;save employee object into "newCollection" collection&NewLine; mongoOperation&period;insert&lpar;"newCollection"&comma; employee &rpar;&semi;&NewLine; &NewLine; &sol;&sol;save list of employee objects into "employee" collection&NewLine; mongoOperation&period;insertList&lpar;employeeInList&rpar;&semi;&NewLine; &NewLine; &sol;&sol;save list of employee objects into "newCollection" collection&NewLine; mongoOperation&period;insertList&lpar;"newCollection"&comma; employeeInList&rpar;&semi;&NewLine;<&sol;pre>&NewLine;<p>The <b>insert&sol;save operations <&sol;b>available to you are listed below&period;<&sol;p>&NewLine;<div class&equals;"itemizedlist">&NewLine;<ul >&NewLine;<li>void <b>save <&sol;b> &lpar;Object objectToSave&rpar; Save the object to the default collection&period;<&sol;li>&NewLine;<li>void <b>save <&sol;b> &lpar;Object objectToSave&comma; String collectionName&rpar; Save the object to the specified collection&period;<&sol;li>&NewLine;<&sol;ul>&NewLine;<&sol;div>&NewLine;<p>A similar set of insert operations is listed below<&sol;p>&NewLine;<div class&equals;"itemizedlist">&NewLine;<ul >&NewLine;<li>void <b>insert<&sol;b> &lpar;Object objectToSave&rpar; Insert the object to the default collection&period;<&sol;li>&NewLine;<li>void <b>insert <&sol;b> &lpar;Object objectToSave&comma; String collectionName&rpar; Insert the object to the specified collection&period;<&sol;li>&NewLine;<li><b>insertAll <&sol;b>Takes a Collection of objects as the first parameter&period; This method inspects each object and inserts it to the appropriate collection based on the rules specified above&period;<&sol;li>&NewLine;<&sol;ul>&NewLine;<&sol;div>&NewLine;<p><b>Note&colon; <&sol;b>By default&comma; if you saved an object&comma; and didn’t define any of the &&num;8220&semi;<b>collection names<&sol;b>&&num;8220&semi;&comma; it will use the domain object name as the collection name&period; See the &&num;8220&semi;<b>save<&sol;b>&&num;8221&semi; method on mongoTemplate&period;<&sol;p>&NewLine;<pre class&equals;"highlight">public void save&lpar;Object objectToSave&rpar; &lbrace;&NewLine; save&lpar;getEntityCollection&lpar;objectToSave&rpar;&comma; objectToSave&rpar;&semi;&NewLine;&rcub;&NewLine;<&sol;pre>&NewLine;<p>See the full example to insert a document into the &&num;8220&semi;<b>dojCollection<&sol;b>&&num;8221&semi; of the &&num;8220&semi;<b>dineshonjavaDB<&sol;b>&&num;8220&semi;&period;<&sol;p>&NewLine;<div class&equals;"separator" style&equals;"clear&colon; both&semi; text-align&colon; center&semi;"><img src&equals;"https&colon;&sol;&sol;dineshonjava&period;com&sol;wp-content&sol;uploads&sol;2013&sol;01&sol;springdata2&period;png" border&equals;"0" &sol;><&sol;div>&NewLine;<h3><b>Step 1&colon; Creating the domain class Employee<&sol;b><br &sol;>&NewLine;<b>Employee&period;java <&sol;b><&sol;h3>&NewLine;<pre class&equals;"highlight">package com&period;dineshonjava&period;mongo&period;dto&semi;&NewLine;&NewLine;import org&period;springframework&period;data&period;annotation&period;Id&semi;&NewLine;import org&period;springframework&period;data&period;mongodb&period;core&period;mapping&period;Document&semi;&NewLine;&NewLine;&sol;&ast;&ast;&NewLine; &ast; &commat;author Dinesh Rajput&NewLine; &ast;&NewLine; &ast;&sol;&NewLine;&commat;Document&lpar;collection &equals; "dojCollection"&rpar;&NewLine;public class Employee &lbrace;&NewLine; &commat;Id&NewLine; private int empId&semi;&NewLine; private String empName&semi;&NewLine; private long salary&semi;&NewLine; private int empAge&semi;&NewLine; public int getEmpId&lpar;&rpar; &lbrace;&NewLine; return empId&semi;&NewLine; &rcub;&NewLine; public void setEmpId&lpar;int empId&rpar; &lbrace;&NewLine; this&period;empId &equals; empId&semi;&NewLine; &rcub;&NewLine; public String getEmpName&lpar;&rpar; &lbrace;&NewLine; return empName&semi;&NewLine; &rcub;&NewLine; public void setEmpName&lpar;String empName&rpar; &lbrace;&NewLine; this&period;empName &equals; empName&semi;&NewLine; &rcub;&NewLine; public long getSalary&lpar;&rpar; &lbrace;&NewLine; return salary&semi;&NewLine; &rcub;&NewLine; public void setSalary&lpar;long salary&rpar; &lbrace;&NewLine; this&period;salary &equals; salary&semi;&NewLine; &rcub;&NewLine; public int getEmpAge&lpar;&rpar; &lbrace;&NewLine; return empAge&semi;&NewLine; &rcub;&NewLine; public void setEmpAge&lpar;int empAge&rpar; &lbrace;&NewLine; this&period;empAge &equals; empAge&semi;&NewLine; &rcub;&NewLine; &commat;Override&NewLine; public String toString&lpar;&rpar; &lbrace;&NewLine; return "Employee &lbrack;age&equals;" &plus; empAge &plus; "&comma; empName&equals;" &plus; empName &plus; "&comma; empId&equals;"&NewLine; &plus; empId &plus; "&comma; salary&equals;" &plus; salary &plus; "&rsqb;"&semi;&NewLine; &rcub;&NewLine;&rcub;&NewLine;<&sol;pre>&NewLine;<h3><b>Step 2&colon; Creating a configuration file<&sol;b><br &sol;>&NewLine;<b>mongo-config&period;xml<&sol;b><&sol;h3>&NewLine;<pre class&equals;"highlight">&lt&semi;beans xmlns&colon;context&equals;"http&colon;&sol;&sol;www&period;springframework&period;org&sol;schema&sol;context" xmlns&colon;mongo&equals;"http&colon;&sol;&sol;www&period;springframework&period;org&sol;schema&sol;data&sol;mongo" xmlns&colon;p&equals;"http&colon;&sol;&sol;www&period;springframework&period;org&sol;schema&sol;p" xmlns&colon;xsi&equals;"http&colon;&sol;&sol;www&period;w3&period;org&sol;2001&sol;XMLSchema-instance" xmlns&equals;"http&colon;&sol;&sol;www&period;springframework&period;org&sol;schema&sol;beans" xsi&colon;schemalocation&equals;"http&colon;&sol;&sol;www&period;springframework&period;org&sol;schema&sol;beans &NewLine; http&colon;&sol;&sol;www&period;springframework&period;org&sol;schema&sol;beans&sol;spring-beans-3&period;0&period;xsd&NewLine; http&colon;&sol;&sol;www&period;springframework&period;org&sol;schema&sol;data&sol;mongo&NewLine; http&colon;&sol;&sol;www&period;springframework&period;org&sol;schema&sol;data&sol;mongo&sol;spring-mongo-1&period;0&period;xsd"&gt&semi;&NewLine; &NewLine; &lt&semi;&excl;-- Default bean name is 'mongo' --&gt&semi;&NewLine; &lt&semi;mongo&colon;mongo host&equals;"localhost" port&equals;"27017"&sol;&gt&semi;&NewLine; &lt&semi;&excl;-- Default bean name is 'mongo' --&gt&semi;&NewLine; &lt&semi;mongo&colon;mongo&gt&semi;&NewLine; &lt&semi;mongo&colon;options connections-per-host&equals;"100"&NewLine; threads-allowed-to-block-for-connection-multiplier&equals;"5"&NewLine; max-wait-time&equals;"120000000"&NewLine; connect-timeout&equals;"10000000"&NewLine; socket-keep-alive&equals;"true"&NewLine; socket-timeout&equals;"15000000"&NewLine; auto-connect-retry&equals;"true"&sol;&gt&semi;&NewLine; &lt&semi;&sol;mongo&colon;mongo&gt&semi;&NewLine; &NewLine; &lt&semi;context&colon;annotation-config&sol;&gt&semi;&NewLine; &NewLine; &lt&semi;context&colon;component-scan base-package&equals;"com&period;dineshonjava&period;mongo"&gt&semi;&NewLine; &lt&semi;context&colon;exclude-filter type&equals;"annotation" expression&equals;"org&period;springframework&period;context&period;annotation&period;Configuration"&sol;&gt&semi;&NewLine; &lt&semi;&sol;context&colon;component-scan&gt&semi;&NewLine; &NewLine; &lt&semi;&excl;-- Offers convenience methods and automatic mapping between MongoDB JSON documents and your domain classes&period; --&gt&semi;&NewLine; &lt&semi;bean class&equals;"org&period;springframework&period;data&period;mongodb&period;core&period;MongoTemplate" id&equals;"mongoTemplate"&gt&semi;&NewLine; &lt&semi;constructor-arg ref&equals;"mongo"&sol;&gt&semi;&NewLine; &lt&semi;constructor-arg name&equals;"databaseName" value&equals;"dineshonjavaDB"&sol;&gt&semi;&NewLine; &lt&semi;&sol;bean&gt&semi;&NewLine; &NewLine;&lt&semi;&sol;beans&gt&semi;&NewLine;<&sol;pre>&NewLine;<h3><b>Step 3&colon; Creating Class which inserting the document into the MongoDB&period;<&sol;b><br &sol;>&NewLine;HelloMongoDB&period;java<&sol;h3>&NewLine;<pre class&equals;"highlight">package com&period;dineshonjava&period;mongo&period;main&semi;&NewLine;&NewLine;import static org&period;springframework&period;data&period;mongodb&period;core&period;query&period;Criteria&period;where&semi;&NewLine;import static org&period;springframework&period;data&period;mongodb&period;core&period;query&period;Query&period;query&semi;&NewLine;&NewLine;import java&period;util&period;ArrayList&semi;&NewLine;import java&period;util&period;List&semi;&NewLine;&NewLine;import org&period;springframework&period;beans&period;factory&period;annotation&period;Autowired&semi;&NewLine;import org&period;springframework&period;data&period;mongodb&period;core&period;MongoOperations&semi;&NewLine;import org&period;springframework&period;stereotype&period;Repository&semi;&NewLine;&NewLine;import com&period;dineshonjava&period;mongo&period;dto&period;Employee&semi;&NewLine;&NewLine;&sol;&ast;&ast;&NewLine; &ast; &commat;author Dinesh Rajput&NewLine; &ast;&NewLine; &ast;&sol;&NewLine;&commat;Repository&NewLine;public class HelloMongoDB &lbrace;&NewLine; &NewLine; &commat;Autowired&NewLine; MongoOperations mongoOperations&semi;&NewLine; &NewLine; public void execute&lpar;&rpar; &lbrace;&NewLine; if &lpar;mongoOperations&period;collectionExists&lpar;Employee&period;class&rpar;&rpar; &lbrace;&NewLine; mongoOperations&period;dropCollection&lpar;Employee&period;class&rpar;&semi;&NewLine; &rcub;&NewLine; &NewLine; &sol;&sol; Case1 - insert a employee&comma; put "DOJ" as collection name &NewLine; Employee employee &equals; new Employee&lpar;&rpar;&semi;&NewLine; employee&period;setEmpId&lpar;1001&rpar;&semi;&NewLine; employee&period;setEmpName&lpar;"Anamika Rajput"&rpar;&semi;&NewLine; employee&period;setSalary&lpar;30000&rpar;&semi;&NewLine; employee&period;setEmpAge&lpar;23&rpar;&semi;&NewLine; &NewLine; mongoOperations&period;save&lpar;employee&comma; "DOJ"&rpar;&semi;&NewLine; &NewLine; &sol;&sol; find&NewLine; Employee employee1 &equals; mongoOperations&period;findOne&lpar;query&lpar;where&lpar;"empId"&rpar;&period;is&lpar;1001&rpar;&rpar;&comma; Employee&period;class&comma;"DOJ"&rpar;&semi;&NewLine; System&period;out&period;println&lpar;employee1&rpar;&semi;&NewLine; &NewLine; &sol;&sol; Case2 - insert a employee&comma; put entity as collection name &NewLine; Employee employee2 &equals; new Employee&lpar;&rpar;&semi;&NewLine; employee2&period;setEmpId&lpar;1002&rpar;&semi;&NewLine; employee2&period;setEmpName&lpar;"Dinesh Rajput"&rpar;&semi;&NewLine; employee2&period;setSalary&lpar;70000&rpar;&semi;&NewLine; employee2&period;setEmpAge&lpar;26&rpar;&semi;&NewLine; &NewLine; mongoOperations&period;save&lpar;employee2&rpar;&semi;&NewLine; &NewLine; &sol;&sol; find&NewLine; Employee employee3 &equals; mongoOperations&period;findOne&lpar;query&lpar;where&lpar;"empId"&rpar;&period;is&lpar;1002&rpar;&rpar;&comma; Employee&period;class&rpar;&semi;&NewLine; System&period;out&period;println&lpar;employee3&rpar;&semi;&NewLine; &NewLine; &sol;&sol; Case3 - insert a list of employees&NewLine; Employee employee4 &equals; new Employee&lpar;&rpar;&semi;&NewLine; employee4&period;setEmpId&lpar;1003&rpar;&semi;&NewLine; employee4&period;setEmpName&lpar;"Adesh Rajput"&rpar;&semi;&NewLine; employee4&period;setSalary&lpar;30000&rpar;&semi;&NewLine; employee4&period;setEmpAge&lpar;23&rpar;&semi;&NewLine; &NewLine; Employee employee5 &equals; new Employee&lpar;&rpar;&semi;&NewLine; employee5&period;setEmpId&lpar;1004&rpar;&semi;&NewLine; employee5&period;setEmpName&lpar;"Vinesh Rajput"&rpar;&semi;&NewLine; employee5&period;setSalary&lpar;32000&rpar;&semi;&NewLine; employee5&period;setEmpAge&lpar;23&rpar;&semi;&NewLine; &NewLine; Employee employee6 &equals; new Employee&lpar;&rpar;&semi;&NewLine; employee6&period;setEmpId&lpar;1005&rpar;&semi;&NewLine; employee6&period;setEmpName&lpar;"Sweety Rajput"&rpar;&semi;&NewLine; employee6&period;setSalary&lpar;50000&rpar;&semi;&NewLine; employee6&period;setEmpAge&lpar;22&rpar;&semi;&NewLine; &NewLine; List&lt&semi;Employee&gt&semi; empList &equals; new ArrayList&lt&semi;Employee&gt&semi;&lpar;&rpar;&semi;&NewLine; empList&period;add&lpar;employee4&rpar;&semi;&NewLine; empList&period;add&lpar;employee5&rpar;&semi;&NewLine; empList&period;add&lpar;employee6&rpar;&semi;&NewLine; &NewLine; mongoOperations&period;insert&lpar;empList&comma; "Employee-List"&rpar;&semi;&NewLine; &NewLine;List&lt&semi;Employee&gt&semi; results &equals; mongoOperations&period;find&lpar;query&lpar;where&lpar;"empAge"&rpar;&period;is&lpar;23&rpar;&rpar;&comma; Employee&period;class&comma; "Employee-List"&rpar;&semi;&NewLine; System&period;out&period;println&lpar;"Results&colon; " &plus; results&rpar;&semi;&NewLine; &NewLine; &rcub;&NewLine;&rcub;&NewLine;<&sol;pre>&NewLine;<h3><b>Step 4&colon; Running the Example<&sol;b><&sol;h3>&NewLine;<p>Following code shows how to run this example<&sol;p>&NewLine;<p>HelloMongoTestApp&period;java<&sol;p>&NewLine;<pre class&equals;"highlight">package com&period;dineshonjava&period;mongo&period;main&semi;&NewLine;&NewLine;import org&period;springframework&period;context&period;ConfigurableApplicationContext&semi;&NewLine;import org&period;springframework&period;context&period;support&period;ClassPathXmlApplicationContext&semi;&NewLine;&NewLine;&sol;&ast;&ast;&NewLine; &ast; &commat;author Dinesh Rajput&NewLine; &ast;&NewLine; &ast;&sol;&NewLine;public class HelloMongoTestApp &lbrace;&NewLine;&NewLine; &sol;&ast;&ast;&NewLine; &ast; &commat;param args&NewLine; &ast;&sol;&NewLine; public static void main&lpar;String&lbrack;&rsqb; args&rpar; &lbrace;&NewLine; ConfigurableApplicationContext context &equals; new ClassPathXmlApplicationContext&lpar;"mongo-config&period;xml"&rpar;&semi;&NewLine; &NewLine; HelloMongoDB hello &equals; &lpar;HelloMongoDB&rpar; context&period;getBean&lpar;"helloMongoDB"&rpar;&semi;&NewLine; hello&period;execute&lpar;&rpar;&semi;&NewLine; System&period;out&period;println&lpar; "DONE&excl;" &rpar;&semi;&NewLine; &rcub;&NewLine;&NewLine;&rcub;&NewLine;<&sol;pre>&NewLine;<p>If everything is fine then run the above main application as Java Application we will get the following output&period;<&sol;p>&NewLine;<div style&equals;"background-color&colon; &num;ff99cc&semi;"><b>output&colon;<&sol;b><br &sol;>&NewLine;log4j&colon;WARN No appenders could be found for logger &lpar;org&period;springframework&period;context&period;support&period;ClassPathXmlApplicationContext&rpar;&period;<br &sol;>&NewLine;log4j&colon; WARN Please initialize the log4j system properly&period;<br &sol;>&NewLine;Employee &lbrack;age&equals;23&comma; empName&equals;Anamika Rajput&comma; empId&equals;1001&comma; salary&equals;30000&rsqb;<br &sol;>&NewLine;Employee &lbrack;age&equals;26&comma; empName&equals;Dinesh Rajput&comma; empId&equals;1002&comma; salary&equals;70000&rsqb;<br &sol;>&NewLine;Results&colon; &lbrack;Employee &lbrack;age&equals;23&comma; empName&equals;Adesh Rajput&comma; empId&equals;1003&comma; salary&equals;30000&rsqb;&comma; Employee &lbrack;age&equals;23&comma; empName&equals;Vinesh Rajput&comma; empId&equals;1004&comma; salary&equals;32000&rsqb;&rsqb;<br &sol;>&NewLine;DONE&excl;<&sol;div>&NewLine;<h3><b>Download SourceCode&plus;Libs<&sol;b><br &sol;>&NewLine;<a href&equals;"https&colon;&sol;&sol;sites&period;google&period;com&sol;site&sol;dinesh9582486434&sol;my-forms&sol;MongoDBInsertDocumentDemo&period;zip&quest;attredirects&equals;0&amp&semi;d&equals;1" target&equals;"&lowbar;blank" rel&equals;"noopener"><b>MongoDBSpringInsertDemo&period;zip<&sol;b><&sol;a><&sol;h3>&NewLine;<p><b>References<&sol;b><br &sol;>&NewLine;<a href&equals;"http&colon;&sol;&sol;static&period;springsource&period;org&sol;spring-data&sol;data-mongo&sol;docs&sol;1&period;0&period;0&period;M5&sol;reference&sol;html&sol;&num;d0e1563" target&equals;"&lowbar;blank" rel&equals;"noopener"><b>Spring data for MongoDB<&sol;b><&sol;a><&sol;p>&NewLine;<div style&equals;"background-color&colon; &num;ff99cc&semi;">                        <b>     &lt&semi;&lt&semi;<a href&equals;"https&colon;&sol;&sol;dineshonjava&period;com&sol;spring-data-mongodb-hello-world-example&sol;">previous<&sol;a>&lt&semi;&lt&semi;             &vert;&vert; <a href&equals;"https&colon;&sol;&sol;dineshonjava&period;com&sol;introduction-to-mongodb&sol;">index  <&sol;a>&vert;&vert;         &gt&semi;&gt&semi;<a href&equals;"https&colon;&sol;&sol;dineshonjava&period;com&sol;spring-data-mongodb-update-document&sol;">next<&sol;a>&gt&semi;&gt&semi;<&sol;b><&sol;div>&NewLine;<div class&equals;"wp-post-navigation"> &NewLine;&Tab;&Tab;&Tab;&Tab;&Tab;&Tab;&Tab;&Tab;&Tab; <div class&equals;"wp-post-navigation-pre"> &NewLine;&Tab;&Tab;&Tab;&Tab;&Tab;&Tab;&Tab;&Tab;&Tab; <a href&equals;"https&colon;&sol;&sol;dineshonjava&period;com&sol;spring-data-mongodb-hello-world-example&sol;">Previous<&sol;a> &NewLine;&Tab;&Tab;&Tab;&Tab;&Tab;&Tab;&Tab;&Tab;&Tab; <&sol;div> &NewLine;&Tab;&Tab;&Tab;&Tab;&Tab;&Tab;&Tab;&Tab;&Tab; <div class&equals;"wp-post-navigation-next"> &NewLine;&Tab;&Tab;&Tab;&Tab;&Tab;&Tab;&Tab;&Tab;&Tab; <a href&equals;"https&colon;&sol;&sol;dineshonjava&period;com&sol;spring-data-mongodb-update-document&sol;">Next<&sol;a> &NewLine;&Tab;&Tab;&Tab;&Tab;&Tab;&Tab;&Tab;&Tab;&Tab; <&sol;div> &NewLine;&Tab;&Tab;&Tab;&Tab;&Tab;&Tab;&Tab;&Tab;&Tab;<&sol;div>&NewLine;<script type&equals;"text&sol;javascript">&NewLine;jQuery&lpar;document&rpar;&period;ready&lpar;function&lpar;&dollar;&rpar; &lbrace;&NewLine; &dollar;&period;post&lpar;'https&colon;&sol;&sol;dineshonjava&period;com&sol;wp-admin&sol;admin-ajax&period;php'&comma; &lbrace;action&colon; 'mts&lowbar;view&lowbar;count'&comma; id&colon; '583'&rcub;&rpar;&semi;&NewLine;&rcub;&rpar;&semi;&NewLine;<&sol;script>

Dinesh Rajput

Dinesh Rajput is the chief editor of a website Dineshonjava, a technical blog dedicated to the Spring and Java technologies. It has a series of articles related to Java technologies. Dinesh has been a Spring enthusiast since 2008 and is a Pivotal Certified Spring Professional, an author of a book Spring 5 Design Pattern, and a blogger. He has more than 10 years of experience with different aspects of Spring and Java design and development. His core expertise lies in the latest version of Spring Framework, Spring Boot, Spring Security, creating REST APIs, Microservice Architecture, Reactive Pattern, Spring AOP, Design Patterns, Struts, Hibernate, Web Services, Spring Batch, Cassandra, MongoDB, and Web Application Design and Architecture. He is currently working as a technology manager at a leading product and web development company. He worked as a developer and tech lead at the Bennett, Coleman & Co. Ltd and was the first developer in his previous company, Paytm. Dinesh is passionate about the latest Java technologies and loves to write technical blogs related to it. He is a very active member of the Java and Spring community on different forums. When it comes to the Spring Framework and Java, Dinesh tops the list!

Share
Published by
Dinesh Rajput

Recent Posts

Strategy Design Patterns using Lambda

Strategy Design Patterns We can easily create a strategy design pattern using lambda. To implement…

4 years ago

Decorator Pattern using Lambda

Decorator Pattern A decorator pattern allows a user to add new functionality to an existing…

4 years ago

Delegating pattern using lambda

Delegating pattern In software engineering, the delegation pattern is an object-oriented design pattern that allows…

4 years ago

Spring Vs Django- Know The Difference Between The Two

Technology has emerged a lot in the last decade, and now we have artificial intelligence;…

4 years ago

TOP 20 MongoDB INTERVIEW QUESTIONS 2022

Managing a database is becoming increasingly complex now due to the vast amount of data…

4 years ago

Scheduler @Scheduled Annotation Spring Boot

Overview In this article, we will explore Spring Scheduler how we could use it by…

4 years ago