Relative Content

Tag Archive for javapostgresqljakarta-eereferencenotnull

How to solve a reference problem between two PgSQL tables with Jakarta EE where a serial id is referenced from another table where it can be null?

The project is a Museum Control project. The problem I am facing is that the “ausstellung” table has the ausstellung_id serial value and the “veranstaltung” table has the veranstaltung_id serial value. In the “veranstaltung_ausstellung” table is a relation between these two. However, here can ausstellung_id be NULL. IMO the problem comes from here, but all of the code and database query and data is provided. Java 21 with Jakarta EE and PostgreSQL.