The 10 Things Everyone does Wrong when Committing Pull Requests

So, you've found a nice Open Source project that has added great value to your own work and you want to give back. Before we move on, let me stress that this isn't anything personal. This article doesn't criticise anyone particular, and the ranty tone is just for your reading entertainment. I do not want … Continue reading The 10 Things Everyone does Wrong when Committing Pull Requests

3 Reasons why It’s Okay to Stick with SQL

The past decade has been an extremely exciting one in all matters related to data. We have had: An ever increasing amount of data produced by social media (once called “Web 2.0”) An ever increasing amount of data produced by devices (a.k.a. the Internet of Things) An ever increasing amount of database vendors that explore … Continue reading 3 Reasons why It’s Okay to Stick with SQL

Integrating jOOQ with Grails Featuring the UWS-jOOQ Plugin

Introduction Grails is a web framework aimed to boost development productivity. One of the main features is domain centric database schema generation. Applications built with Grails are able to update existing schema just before they start. To do this, Grails is using built-in domain mappers or migrations in more advanced cases. The goal of the … Continue reading Integrating jOOQ with Grails Featuring the UWS-jOOQ Plugin

Yak Shaving is a Good Way to Improve an API

Yak Shaving (uncountable): (idiomatic) Any apparently useless activity which, by allowing you to overcome intermediate difficulties, allows you to solve a larger problem. (idiomatic) A less useful activity done to consciously or unconsciously procrastinate about a larger but more useful task. Both interpretations of the term Yak Shaving as explained by Wiktionary are absolutely accurate … Continue reading Yak Shaving is a Good Way to Improve an API

The Java Legacy is Constantly Growing

I've recently stumbled upon a very interesting caveat of the JDK APIs, the Class.getConstructors() method. Its method signature is this: Constructor<?>[] getConstructors() The interesting thing here is that Class.getConstructor(Class...) returns a Constructor<T>, with <T> being maintained: Constructor<T> getConstructor(Class<?>... parameterTypes) Why is there a difference, i.e. why doesn't the first method return Constructor<T>[]? Let's consider the … Continue reading The Java Legacy is Constantly Growing

Avoid Recursion in ConcurrentHashMap.computeIfAbsent()

Sometimes we give terrible advice. Like in that article about how to use Java 8 for a cached, functional approach to calculating fibonacci numbers. As Matthias, one of our readers, noticed in the comments, the proposed algorithm may just never halt. Consider the following program: public class Test { static Map<Integer, Integer> cache = new … Continue reading Avoid Recursion in ConcurrentHashMap.computeIfAbsent()

jOOQ – Ein alternativer Weg mit Java und SQL zu arbeiten

We've published an article in the German magazine http://www.java-aktuell.de, which is published by the iJUG e.V.. You can read and download the article free of charge from our blog! In Java gibt es kein Standard-API, das die Ausdrucksstärke und Mächtigkeit von SQL direkt unterstützt. Alle Aufmerksamkeit ist auf objekt-relationales Mapping und andere höhere Abstraktionslevel gerichtet, … Continue reading jOOQ – Ein alternativer Weg mit Java und SQL zu arbeiten

How to use SQL PIVOT to Compare Two Tables in Your Database

This can happen ever so easily. You adapt a table by adding a new column: ALTER TABLE payments ADD code NUMBER(3); You go on, implementing your business logic - absolutely no problem. But then, later on (perhaps in production), some batch job fails because it makes some strong assumptions about data types. Namely, it assumes … Continue reading How to use SQL PIVOT to Compare Two Tables in Your Database

How to Extract a Date Part in SQL

The Modern SQL Twitter account (by Markus Winand) published a hint about how to extract a date part in SQL: https://twitter.com/ModernSQL/status/570294338124697600 Is it true? Yes it is, in the SQL standard and in a variety of standards-compliant databases. But let's check what jOOQ does when you run the following program on all 18 currently supported … Continue reading How to Extract a Date Part in SQL

jOOQ vs. Slick – Pros and Cons of Each Approach

Every framework introduces a new compromise. A compromise that is introduced because the framework makes some assumptions about how you'd like to interact with your software infrastructure. An example of where this compromise has struck users recently is the discussion "Are Slick queries generally isomorphic to the SQL queries?". And, of course, the answer is: … Continue reading jOOQ vs. Slick – Pros and Cons of Each Approach