Skip to content
Advertisement

Tag: java

JpaRepository SQL syntax error when trying to save to MySQL Date

I have the following row in my MySQL Table: https://i.stack.imgur.com/u0FC4.png This column is represented as: And it is bound to a Thymeleaf form like so: Now if I insert a date into the MySQL db directly, the date is loaded and set to the correct date on the form: https://i.stack.imgur.com/e35lr.png But every time I try to save or edit the

JOOQ “IN” Query throws null pointer exception

When we try to fetch data with Null values field(TABLE_NAME.COLUMN_NAME.in(null)) with IN clause getting null pointer exception. Maybe because of this. In the database, we can provide null in IN clause. There is an existing “won’t fix” issue in jooq https://github.com/jOOQ/jOOQ/issues/3867 There are some alternatives: check null before IN(Cant do in my case its a really big select statement) So

How to add to INSERT INTO PRIMARY KEY AND FOREIGN KEY

So i have two tables: locations and employees i want locations_id to be the same in employees.locations_id, I am trying to make it all in one statement the erros is this You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ‘INSERT INTO employees(employees_id, locations_id)

Populate DTO using query with JOIN

I have this main Product table: Additional table for storing categories that should be returned as List: Additional table for storing Payment Methods that should be returned as List: I want to return a result like this: I tried this: What is the proper way to populate this DTO? Answer If, as indicated in your comments, you need query your

Advertisement