A DBA’s point of view of Hibernate

A very nice little rant on Hibernate: http://jeffkemponoracle.com/2011/11/25/3-reasons-to-hate-hibernate While I don't agree 100% (e.g. CRUD/OLTP really is different from OLAP, and Hibernate is a strong CRUD tool), I certainly share most of his feelings.

Arcane magic with the SQL:2003 MERGE statement

Every now and then, we feel awkward about having to distinguish INSERT from UPDATE for any of the following reasons: We have to issue at least two statements We have to think about performance We have to think about race conditions We have to choose between [UPDATE; IF UPDATE_COUNT = 0 THEN INSERT] and [INSERT; … Continue reading Arcane magic with the SQL:2003 MERGE statement

GROUP BY ROLLUP / CUBE

Every now and then, you come across a requirement that will bring you to your SQL limits. Many of us probably give up early and calculate stuff in Java / [or your language]. Instead, it might've been so easy and fast to do with SQL. If you're working with an advanced database, such as DB2, … Continue reading GROUP BY ROLLUP / CUBE

Next stop on the Annotatiomania™ Train: FetchGroups

Here's how an Annotatiomaniac™ can optimise his second-level cached JPA queries conveniently by adding yet more annotations (what else?) to his simple and plain POJO's. Remember that EJB 3.0 was about removing dependencies from javax.ejb.EJBObject, javax.ejb.EJBHome and similar interfaces? Well... check out this example: import org.apache.openjpa.persistence.*; @Entity @FetchGroups({ @FetchGroup(name="detail", attributes={ @FetchAttribute(name="publisher"), @FetchAttribute(name="articles") }), ... }) … Continue reading Next stop on the Annotatiomania™ Train: FetchGroups

Join the “dark side” with jOOQ

jOOQ is now also associated with the "dark side" and "SciFi": http://blog.pdark.de/2011/11/23/peace-between-java-and-sql/ So, join the dark side now :-)

Java’s missing unsigned integer types

This is a topic that has been discussed many times before. Java's lack of unsigned byte/short/int/long types. The main reasons why the JLS designers omitted those types were: They're hardly really useful They're a bit more difficult to implement They're a bit more difficult to understand They would lead to more primitive types that have … Continue reading Java’s missing unsigned integer types

Overload API methods with care – the sequel

I had recently blogged about funny issues that arise when overloading API methods with generics involved: https://blog.jooq.org/overload-api-methods-with-care/ I promised a sequel as I have encountered more trouble than that, so here it is. The trouble with generics and varargs Varargs are another great feature introduced in Java 5. While being merely syntactic sugar, you can … Continue reading Overload API methods with care – the sequel

jOOQ-meta. A “hard-core SQL” proof of concept

jOOQ-meta is more than just meta data navigation for your database schema. It is also a proof of concept for the more complex jOOQ queries. It is easy for you users to believe that the simple vanilla queries of this form will work: create.selectFrom(AUTHOR).where(LAST_NAME.equal("Cohen")); But jOOQ claims to be a "hard-core SQL library". A "hard-core … Continue reading jOOQ-meta. A “hard-core SQL” proof of concept

Overload API methods with care

Overloading methods is a strong concept in API design, especially when your API is a fluent API or DSL (Domain Specific Language). This is the case for jOOQ, where you often want to use the exact same method name for various means of interaction with the library. Example: jOOQ Conditions package org.jooq; public interface Condition … Continue reading Overload API methods with care