Another great option in Java is jOOQ, which lets you write type-safe and potentially composable queries such as:
context
.update(User.USER)
.set(User.USER.NAME, userName)
.where(User.USER.ID.eq(userId))
.execute()