The jOOQ API is all about convenience, and as such, an important operation (the most important one?) like fetch() must come with convenience, too. The default way to fetch data is this: It fetches the entire result set into memory and closes the underlying JDBC resources eagerly. But what other options do we have? Iterable … Continue reading The Many…
#joo
16 posts
19 May 2022
7 Oct 2021
Don’t you hate how you have to wrap checked exception throwing code in static initialisers? E.g. you cannot write this in Java: There’s an unhandled ClassNotFoundException, and you can’t catch / rethrow it simply. A static initialiser is needed: Yuck. Luckily, one of jOOλ’s lesser known features is the Sneaky class, which contains a bunch … Continue reading Use jOOλ’s…
11 Feb 2019
jOOλ is our second most popular library. It implements a set of useful extensions to the JDK’s Stream API, which are useful especially when streams are sequential only, which according to our assumptions is how most people use streams in Java. Such extensions include: … and many more. Collectors But that’s not the only thing … Continue reading Lesser Known…
29 Aug 2016
With Java 8 being mainstream now, people start using Streams for everything, even in cases where that’s a bit exaggerated (a.k.a. completely nuts, if you were expecting a hyperbole here). For instance, take mykong’s article here, showing how to collect a Map’s entry set stream into a list of keys and a list of values: … Continue reading Using jOOλ…
16 Feb 2016
Before I move on with the actual article, I’d like to give credit to Daniel Dietrich, author of the awesome vavr library, who has had the idea before me: @lukaseder try with a static method <T, T1 extends T, … Tn extends T> Seq<T> toSeq(T1 t1, …, Tn tn) { … } (from my mobile … Continue reading An Ingenious…
26 Jan 2016
Recently, we’ve published our article about the awesome window function support in jOOλ 0.9.9, which I believe is some of the best additions to the library that we’ve ever done. Today, we’ll look into an awesome application of window functions in a use-case that is inspired by this Stack Overflow question Sean Nguyen: How to … Continue reading How to…
6 Jan 2016
You heard right. Up until now, the awesome window functions were a feature uniquely reserved to SQL. Even sophisticated functional programming languages still seem to lack this beautiful functionality (correct me if I’m wrong, Haskell folks). We’ve written tons of blog posts about window functions, evangelising them to our audience, in articles like: Probably the … Continue reading 2016 Will…
22 Oct 2015
Java 8 has lambdas and streams, but no tuples, which is a shame. This is why we have implemented tuples in jOOλ – Java 8’s missing parts. Tuples are really boring value type containers. Essentially, they’re just an enumeration of types like these: Writing tuple classes is a very boring task, and it’s best done … Continue reading The Danger…
13 Aug 2015
Functional programming allows for quasi-declarative programming in a general purpose language. By using powerful fluent APIs like Java 8’s Stream API, or jOOλ’s sequential Stream extension Seq or more sophisticated libraries like vavr or functionaljava, we can express data transformation algorithms in an extremely concise way. Compare Mario Fusco’s imperative and functional version of the … Continue reading Common SQL…
7 Apr 2015
Sometimes you simply cannot avoid it: Pessimistic locking via SQL. In fact, it’s an awesome tool when you want to synchronise several applications on a shared, global lock. Some may think this is abusing the database. We think use the tools you have if they can solve the problem you have. For instance, the RDBMS … Continue reading How to…
2 Apr 2015
Imagine you have a list of items: (Don’t judge me. Books from this random book generator) Now you’d like to create a new list where the third item only is replaced by some new value: Of course, you could go and either modify the original list: … or create a copy of the original list … Continue reading How to…
2 Oct 2014
More and more people are catching up with the latest update to our platform by adopting functional programming also for their businesses. At Data Geekery, we’re using Java 8 for our jOOQ integration tests, as using the new Streams API with lambda expressions makes generating ad-hoc test data so much easier. However, we don’t feel … Continue reading Don’t Miss…
10 Sept 2014
Java 8 was – as always – a release of compromises and backwards-compatibility. A release where the JSR-335 expert group might not have agreed upon scope or feasibility of certain features with some of the audience. See some concrete explanations by Brian Goetz about why … … “final” is not allowed in Java 8 default … Continue reading When the…
5 May 2014
Every now and then, I miss SQL’s three-valued BOOLEAN semantics in Java. In SQL, we have: TRUE FALSE UNKNOWN (also known as NULL) Every now and then, I find myself in a situation where I wish I could also express this UNKNOWN or UNINITIALISED semantics in Java, when plain true and false aren’t enough. Implementing … Continue reading Three-State Booleans…
12 Mar 2014
Subscribe to the newsletter here Tweet of the Day Our customers, users, and followers are sharing their love for jOOQ to the world. Here are: Dominik Dorn who finds jOOQ awesome. As simple as that! #JOOQ is awesome! — Dominik Dorn (@domdorn) February 14, 2014 Mariusz Nosiński who cannot believe he hasn’t discovered jOOQ before. How's … Continue reading jOOQ…
7 Mar 2014
At Data Geekery, we love Java. And as we’re really into jOOQ’s fluent API and query DSL, we’re absolutely thrilled about what Java 8 will bring to our ecosystem. We have blogged a couple of times about some nice Java 8 goodies, and now we feel it’s time to start a new blog series, the… … Continue reading Java 8…