Tag Archives: Tutorials

Logical Querying MongoDB Java Example

This post will focus on the logical Logical Querying MongoDB Java Example
operators that are available in
momgodb.I will use Java for the
illustration purpose of these
operators. You can use any of
the language for which mongo
driver is available. For the comparison operators you can refer the previous post here.
There are 4 logical operators that have been documented in mongodb specs.
We will continue with the same example that we have seen in the previous post. Continue reading Logical Querying MongoDB Java Example

MongoDB Java Hello World Example

In the previous post  we have seen some of the basics on the primary keys and ObjectId in MongoDB.Now its time to get our hands dirty with some code , here I am using Java to interact with our mongo database. In this MongoDB Java Hello World example we will cover the following points : –

MongoDB Java Hello World Example
MongoDB Java Hello World Example
  1. Connect to mongodb server
  2. Connect to a database / Create a new Database
  3. Create a new collection
  4. Insert a new Document
  5. Search a Document
  6. Update a Document
  7. Delete a Document Continue reading MongoDB Java Hello World Example

Default Methods in Java 8 Explained – Part 2 (A comic way)

If you have missed out the first part of this story i.e Default Methods in Java 8 ,you can read it here , else you can read the recap of first part here.

Recap : Interface IRoleService (i.e project manager) decided to assign extra duties to all (developer,tester ,ba etc) who are working on the project by introducing a new method extraDuties() in its interface. After this introduction of new extra duties  , TesterServiceImpl (i.e Tester of the application) rebelled and clear that he won’t perform any extra duties.When senior manager came to know about this situation , he advised interface IRoleService to introduce default methods so that no body will be forced to provide an implementation for extraDuties().

Now before going ahead let’s look at the code how default methods will be invoked and what Continue reading Default Methods in Java 8 Explained – Part 2 (A comic way)

annotation-config vs component-scan – Spring Core

<context:annotation-config> and <context:component-scan> are two of the most basic concepts available in the Spring Core introduced in Spring 3 that every Spring user should understand.It is important that to understand the usage of each of them and how they are different to each other.

annotation-config :  Annotation config main job is to activate all the annotations that are present in java beans and those are already registered either by defining in your application context file or being registered while component scanning. Important point is they need to be registered.

Continue reading annotation-config vs component-scan – Spring Core

Revert or Undo a commit using git amend

In the previous post we have seen that how we can revert or undo a local or public git commit using git revert. In this post we are going to see some other ways in which we can Revert or Undo a commit using git. Yes, you have read it right only we are talking about only local commit.

Note : There are lot of things in life and git can’t be undone always .

Undo a commit using git amend :
Let’s consider a scenario where you have just started development of your application , and now you have lot of files to checkin into the git repository so for doing that you have to do a Continue reading Revert or Undo a commit using git amend

Revert or undo last git commit

If you have missed out my previous posts on git repositories then you can read it here.

While working on GIT distributed version control system , you might have found yourself in a scenario where you have to revert or undo last git commit. Reason for revert can be anything like wrong file checked in , some junk code has been checked in that can impact your well developed application etc.

Now here two scenario exists depends on the level of your commit–
1. If the commit has been already pushed to central remote repository that means now it is a public commit that means other developers can see these changes. Continue reading Revert or undo last git commit

What is Maven Central Repository and How to configure external remote maven repository ?

If you have missed my previous post on maven basic terminologies then you can read it here . In this post we will roam around Maven Central Repository, how they work , what are their significance in Maven, How you can customize Maven Repositories and lot of other things about maven repositories.

Important Terms in Apache Maven FrameworkWhat is a Maven Repository:
When you invoke maven reactor for the first time by calling any maven build life cycle , goal , plugin etc , you might have noticed that maven started downloading a lot of files from a url , Continue reading What is Maven Central Repository and How to configure external remote maven repository ?

Understand git clone command, difference between svn checkout and git clone

Understand git clone , svn checkout Vs git cloneRecently our project migrated from SVN to GIT Distributed Version Control and later I came to know that it has lot of advantages over SVN. So I started looking into GIT basic terminology like clone , commit , pull , push fetch , rebase , merge , branches and honestly speaking earlier I was very confused but as soon I started going into the depth I found it interesting and something that I have never worked till now. I read lot of books , lot of blogs on basic GIT terminologies and here I am going to write my findings on same, so that it can help newbies like me and most importantly for my future reference.

So whole story begins with how to get the code into your local system Continue reading Understand git clone command, difference between svn checkout and git clone

Share and Enjoy

  • Facebook
  • Twitter
  • Delicious
  • LinkedIn
  • StumbleUpon
  • Add to favorites
  • Email
  • RSS

Important Terms in Apache Maven Framework

In this post we are going to see the definition and usage of some important terms in Apache Maven framework. Before going into the depth of maven it is very important to understand the essence of these terms. So , let’s begin

Important Terms in Apache Maven Framework 1.   What is Maven : – There is a misconception among many people about What exactly Maven is ? and What it do ? . Some people say that , it is a build tool used to generate artifacts in the form of jar, war and ear file from your source code , other group of developers say that it is a Project Management Tool that has a Project Object Model (pom file) , a standard life cycle , executing different goals at different phase in the life cycle , do the dependency management etc . Actually both of them are correct , Maven is much more than a traditional build tool . How ?? We will see that in just a minute.

Maven strictly believes in the policy of “Configuration over Convention” that says Continue reading Important Terms in Apache Maven Framework

Quartz Scheduler Framework in Java API and Integration With Spring

These days almost each and every type of applications from standalone to enterprise level have jobs, that it has to execute at a particular time or want to repeat the same job at a particular interval. So, if your application is running on Java Stack then we have a very good robust and open source framework to meet our scheduling needs.

Here I am talking about the Quartz scheduler framework which has been completely written in java , fault tolerant and can integrate very easily with any framework. Before we start looking into the Quartz integration with Spring , first try to look at what are important components in Quartz Scheduler Framework. Continue reading Quartz Scheduler Framework in Java API and Integration With Spring

Share and Enjoy

  • Facebook
  • Twitter
  • Delicious
  • LinkedIn
  • StumbleUpon
  • Add to favorites
  • Email
  • RSS