1:n disable constraints for the n-side?

The Problem I have a 1:n relation, but the n side shouldnt rely on constraints. So i actually wanna insert a EntityPojo via its future id, when its not saved yet ( Lets ignore that its a bad practice )…

Is there a algorithm to resolve credit rating?

I need to implement a logic in either Java OR SQL for the following. There are credit ratings from numbers 1 to 11. And corresponding to each rating say x, I have 3 grades, effectively :x+, x and x-. …

With MyBatis. How can I map two different records in one table, then construct a single query result when joining that table?

The definition of my query result entity has two fields, origin and destination, which are both Location type, and I’m trying to fetch the information in location table with JOINS.Here are the …

SQL query is only returning one entry, when it should be returning several

I am creating a book tagging system and I am trying to call all the books with the same tag. My query is only turning up the first book, and not any of the following books with the same tag. Here is …

How to add multiline Strings in Java?

How to make long queries more readable? For example I have this one: String query = “SELECT CASE WHEN EXISTS (SELECT * FROM users WHERE username = ‘username’ AND user_password = crypt(‘password’, …

Liquibase bidirectional relationships changelog order

I’ve faced a problem when implementing liquibase in an existing project. So we have two entities: Company: @Entity @Table(name = “company”) @EqualsAndHashCode(of = {}, callSuper = true) @…

JOOQ materialized views

is it possible to create materialized views using the JOOQ builder? Something like this DSL.createMaterializedView().execute()

Is there a way to query ltrees in JOOQ?

Is there any sort of extension that would allow me to use Postgres ltrees in JOOQ without having to use raw SQL? Any way to make one myself maybe?

In Jooq, how to make the “delete” statement return the deleted records?

In my project, there are 2 tables, orders and order_payments. The latter is a join table with 2 columns, order_id and payment_id. I didn’t use FK for efficiency sake. When I delete some orders from …

Is there way to set default as null for SQL parameter?

I have a code that creates sql parameters using MapSqlParameterSource. Here is my code: MapSqlParameterSource parameters = new MapSqlParameterSource() .addValue(EVENT_ID, eventId) …