In this post, under JSONB, I will explain how to use custom date format when serializing/deserializing Java object containing date information to json format. By default JSONB when converting date information to json it prints in the format as shown below 2019-02-16T07:16:38.537Z[UTC] We can change this format globally, globally meaning the custom format will be…… Continue reading Using Custom DateFormat
Custom format for Property names using PropertyNamingStrategy Part 2
In this post under JSONB, I will continue explaining how to create custom format for property names using PropertyNamingStrategy interface. In the post, “Custom format for Property names using PropertyNamingStrategy Part 1”, I listed the different formats provided by the interface out of the box, which are 1) CASE_INSENSITIVE 2) IDENTITY 3) LOWER_CASE_WITH_DASHES 4) LOWER_CASE_WITH_UNDERSCORES…… Continue reading Custom format for Property names using PropertyNamingStrategy Part 2
Custom format for Property names using PropertyNamingStrategy Part 1
In this post under JSONB, I will explain how to create custom format for property names using PropertyNamingStrategy interface. Whenever we serialize a java object to JSON format, the property or field names in json are same as property names in its corresponding java class. For example when we serialize the below java class instance…… Continue reading Custom format for Property names using PropertyNamingStrategy Part 1
RecordSeparatorPolicy interface Example
In this post of Spring Batch, I will explain with an example, the purpose of RecordSeparatorPolicy interface and how to use it. In all my previous posts under Spring Batch, the examples (i.e., input file to read from) that I used, had a collection of records, where each record were delimited by new line as…… Continue reading RecordSeparatorPolicy interface Example
Storing Job Repository in In-Memory datastore
In this post under Spring Batch, I will explain what is the purpose of Job Repository in Spring Batch and how to store it in In-Memory datastore. Job Repository is used to store the state of a Job (finished or currently executing). In other words Job Repository stores all the metadata of a Job. Informations…… Continue reading Storing Job Repository in In-Memory datastore
Transforming items using ItemProcessor
In this post under Spring Batch, I will explain how to achieve Item Transformation using ItemProcessor interface. Item Transformation process transforms the items read by reader before sending them to the writer. The transformation involves changing the state of the read itemor creating a completely new object. In the second case, the written item type…… Continue reading Transforming items using ItemProcessor
Combining two or more Function functional interface
In this post, I will explain how to combine Function functional interfaces. They are two ways in which we can combine Function functional interface and it is achieved using two methods in Function interface as mentioned below 1) default Function andThen(Function after) 2) default Function compose(Function before) Both the methods accept an implementation of Function…… Continue reading Combining two or more Function functional interface
Using custom delimiter while reading and writing batch file
In all previous Spring Batch posts, the DelimitedLineAggregator(which creates String format of java objects) and DelimitedLineTokenizer (which extracts fields from each record) assume ‘,’ as delimiter as shown below EMP_ID0,EMP_NAME0,EMP_STATUS0,0EMP_ID1,EMP_NAME1,EMP_STATUS1,1EMP_ID2,EMP_NAME2,EMP_STATUS2,2EMP_ID3,EMP_NAME3,EMP_STATUS3,3 We can use other symbols as delimiter and inform DelimitedLineAggregator and DelimitedLineTokenizer about this. At the time of reading and writing, the default delimiter is…… Continue reading Using custom delimiter while reading and writing batch file
Saving a transient object
In this post of Hibernate ORM, I will explain how to save a transient object with an example. A transient object exists only in memory, no representation of it exists in database. Hibernate runtime doesn’t manage (ie., automatically update or sync up with database representation) the transient object. The object’s identifier property value will be…… Continue reading Saving a transient object
eq(), first() and last() JQuery functions
In this post of JQuery, I will explain the three functions eq(), first(), and last() functions with a example. Below is the complete code for reference 1 <html> 2 <head> 3 <a href=”https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js”>https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js</a> 4 </head> 5 <body> 6 7 function selectElement() { 8 var $elements = $(‘a’); 9 10 var $indexedElement = $elements.eq(0); 11 alert($indexedElement.length);…… Continue reading eq(), first() and last() JQuery functions