Updating Entities with Update Query in Spring Data JPA

March 25, 2015 by

With object-relational mapping (ORM) tools such as Hibernate, one usually modifies entities by first fetching them from the database, modifying some fields, and then persisting the entities again. This is a good approach in many cases, but in some scenarios this may not be desirable. For instance, if you want to update a collection of entities (i.e.… read more

Convert Byte Array to String in C#

March 24, 2015 by

Converting a byte array to a string in C# is easy. In fact, it can be done in a single line. Below is an example that converts a string into a byte array. In the example that follows, we will then convert that byte array back to a string, effectively showing you how to do the… read more

Ignoring Unrecognized JSON Fields With Spring & Jackson

March 13, 2015 by

If you try to bind JSON to an object in Spring MVC with Jackson, then you might have seen the below error before. Could not read JSON: Unrecognized field \”something\” (class com.codingexplained.user.dto.account), not marked as ignorable […] This error occurs whenever an unknown field is encountered in the JSON; that is, a field specified in the JSON is not… read more

Moving .ebextensions to root in .war file

March 6, 2015 by

If you wish to deploy your application to Amazon’s Elastic Beanstalk, then you can customize your server setup by placing configuration files within a .ebextensions directory within the root of your .war file (for web applications). These files can then contain various kinds of instructions. One can install packages with package managers such as yum or… read more

Unpacking War File on OS X and Linux

March 6, 2015 by

If you have packaged a web application within a .war file, then you might want to check the contents of it for various reasons. There are a number of tools that can do this, but I am going to show you a simple command that can display the contents of the war file within the… read more