Using query language with MongoDB
In the previous posts we have seen how to insert and read data from the MongoDB client and from the Java API. Now to fetch documents by executing queries on the collection.We saw the find method that...
View ArticleTinkering with blogger - Adding a scrolling headline
OK first and foremost - This is not related to Java. And second - This was all done with the purpose of getting an internship (yes selfish and self serving reasons for this post people).Now that I have...
View ArticleMore querying in MongoDB
In the last post we started running queries on MongoDB. To continue on the operators, I decided to do a find on the auto generated id:> db.fruits.find({ "_id" :...
View ArticleDBCursor - size,length and count
Consider the below method: publicstatic String DB_NAME = "fruits";publicstatic String COLLECTION_NAME = "fruits";publicstatic void main(String[] args) throws UnknownHostException { Mongo mongoClient =...
View ArticleIndexes and MongoDB
I have never given too much thought to database indexing. Its a concept that works silently in the background of database tables and views. Most databases provide indexes by default for the primary...
View ArticleHello Spring Batch
Batch processing is something that we keep hearing in the enterprise industry. Most software projects will at some point require that certain tasks happen in the background on certain scheduled times....
View ArticleMultiple Steps in a Job
In the previous post we saw how to execute a job with a single step. A job can be composed of multiple steps. So I decided to extend the previous job to include two steps.Step 1 is same as before -...
View ArticleIntroducing database to Spring Batch
Until now we have seen Spring batch without its meta data persistence features. When I say meta-data for Spring batch it includes batch related information - a listing of the steps executed, and their...
View ArticleLambda
This is kind of late - very late, but then like always - better late than never. So while java lovers world over have dug deep, praised, criticized and in some cases confused the developer community...
View ArticleConsumers in Java Lambda World
A I mentioned in the previous post, Lambda expressions have helped simplify Collection use cases. We saw that with sorting a Collection. Let me explore some more simplifications in this post.We often...
View ArticleSuppliers in Java Lambda World
In the previous post I had a look at Consumer function objects and how they were used in the forEach method of the Iterable class. An exactly opposite kind of interface to the Consumer is the Supplier...
View ArticleInterfaces versus Abstract classes : pre and post Java 8
I have been given a contract to implement in Java. As a developer one of the early design decisions needed is, do I want an interface or an abstract class at the base of my hierarchy. This question is...
View ArticlePredicates to determine the truth !
We have seen some of the functional interfaces like Consumer and Supplier in the earlier posts. The next one I wanted to explore is the Predicate interface. This one is used for testing certain...
View ArticleThe Function Interface
I worked with using lambdas for Comparator interface in my first post on Lambdas. We saw how a Function interface could be used to convert an object of one type into an object of another.This class is...
View ArticleVariations in java functions
In the previous post, we saw the Function Interface that takes an object of one type and transforms it into an object of another type. Consider the user case where we need to split a string and retain...
View ArticleThe BiVersions of Java FunctionalInterfaces
In the previous post, we saw a version of the Function class that took two parameters into apply instead of one. Similar to the BiFunction interface, we also have BiPredicate, BinaryOperator, and...
View ArticleInterfaces and Default Methods
In an earlier post, I covered one of Java 8's new features - default methods in interfaces. While I did the pros there were some corner cases to be considered when implementing this feature.Consider...
View ArticlePrimitives and Lambdas
II have been playing with the lambda expressions and they have all involved working with objects. There are also some classes in the SDK that have been created for working with primitives.I tested some...
View ArticleBe careful with Sets and equals behavior
I was recently assigned to fix a bug in the code. For the scope of this post I re-framed the problem as below:Context: There is a set of objects of each type (lets say fruits). Over a series of...
View ArticleServlet 3.x - time to have a look
Its not brand new - in fact it first appeared in December 2009. Since starting to use servlets (actually servlet 2.5) I never really bothered to look at the specs. What started with application...
View Article