Showing posts from 2015

JPA 2.1 – Features every developer should know

Features and Enhancements in JPA 2.1 Named Stored Procedure Query Sometimes it is easier or more efficient to use a stored procedure to perform the operations within the database. Before JPA 2.1 the only way to call a stored procedure was to use a native query. The newly introduced  @NamedStoredProcedureQuery  can now be used to annotate a query to call the stored procedure.  more details in  How to call stored procedures in JPA . Stored Procedure Query The Stored Procedure Query is an alternative way to implement a stored procedure call without using annotations. For this purpose the  EntityManager  was extended by the  createStoredProcedureQuery(String procedureName, Class… resultClasses)  method. You can read more about it in  How to call stored procedures in JPA – Part 2 . Attribute Converter Attribute Converter provide a nice and easy way to define a custom mapping between your property on the entity and the database column. The only thing that is needed is a

Boon, another JSON Parser, Faster and lighter than GSON

Boon and JSON Boon is not a JSON parsing project. It is more than that, but JSON parsing is intrinsic to what Boon is all about.  Boon is the probably the fastest way to serialize and parse JSON in Java so far for your project. . It is faster at object serialization, enabling JSON expressions, JSON parsing and much more. Boon JSON is FAST! In addition it has a very easy to use, convention-based API. (Boon should be the fastest for most use cases that I have seen for REST, but there are some clear areas where Jackson and FASTJson are faster. At the moment, Boon is not the fastest way to encode JSON if you have a large strings with unicode outside of the ASCII range. The plan is to close the gap, but currently this makes Jackson faster for these use cases. Also please note that Boon is a newer project and not as mature as Jackson or GSON.) Serialization Serialization is achieved by: Jackson style ObjectMapper mapper = JsonFactory.create(); mapper.writeVa

Why code reviews matter

Agile teams are self-organizing, with skill sets that span across the team. This is accomplished, in part, with code review. Code review helps developers learn the code base, as well as help them learn new technologies and techniques that grow their skill sets. So, what exactly is a code review? When a developer is finished working on an issue, another developer looks over the code and considers questions like: Are there any obvious logic errors in the code? Looking at the requirements, are all cases fully implemented? Are the new automated tests sufficient for the new code? Do existing automated tests need to be rewritten to account for changes in the code? Does the new code conform to existing style guidelines? Code reviews should integrate with a team’s existing process. For example, if a team is using task branching workflows, initiate a code review after all the code has been written and automated tests have been run and passed–but before the code is merged upstre