SQL allows you to do calculations on columns over multiple rows using aggregate functions like COUNT
, SUM
, AVG
etc. This post explains how to use them in Kotlin Exposed. We will also cover arithmetic operations on one or more columns. If you haven’t used Kotlin Exposed before, you can go here for an introduction.
Continue reading →
This post explains how to use table aliases using Kotlin Exposed. Aliases are necessary when you want to join the same table multiple times. If you haven’t used Kotlin Exposed before, you can go here for an introduction: Kotlin Exposed - A lightweight SQL library.
Continue reading →
A big part of the fun of starting a new project is making a design and choosing an appropriate
technology stack. If you are a Java developer and need to access a SQL database, a common choice is
to use JPA with an ORM framework such as Hibernate. This adds a lot of complexity
to your project for multiple reasons. In my experience, writing performing queries requires careful analysis. Writing custom
queries is possible but more complex. For starters, JPQL/HQL queries are parsed at runtime and the criteria API is far
from user friendly. Moreover, the extensive use of annotations makes it harder to quickly see how the database
is structured.
Continue reading →