3 ms·
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
by shock-value 6y ago
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()
- alex-lx 6y agojOOQ and its DSL is good, however IMO it's more readable using raw SQL (by using `context.fetchInto` and its variants) than to using DSL when deal with complex query.
- jwdunne 6y agoI’ve noticed this in other contexts too. For small queries with straight forward joins, a query builder is nice and readable. But for larger, more complex queries, I found putting the query into its own file was best for readability.
- lukaseder 6y agoWhy not just create views and query those with jOOQ, then?
- alex-lx 6y agohi, @lukaseder, Thank you for creating jOOQ. I don't have much experience on views, and some called `Best Practice` forbid to use that because it's hard to maintain. What do you think about that.
- JulianWasTaken 6y agoIn Python this would look like sqlalchemy's query layer (which is great).