I am trying to upgrade JOOQ from 3.14.6 to 3.17.5. I am observing that generated SQL across two versions are different Jooq 3.14.6 In Jooq 3.17.5 Can someone let me know If there are any settings in jooq codegen (version 3.17.5) which will allow me to have the generated SQL same as in 3.14.6? Is there any documentation link which
Tag: postgresql
JPA Query. Path array of parameters that need to be selected
I need to choose dynamically which parameters should be in query output. Is there any way to do something like that: For example I have Entity User with name, surname, address, age. In one case I want to choose only name, in other sername, age and address. And e.t.c Answer You can create interfaces to represent a View like the
Get records which are last updated in n minutes in jpa
I am working on a jpa query which requires to fetch all the records whose last updated time is more than 15 minutes My query goes like I will be passing the minutes dynamically ie in my jpa This does not work. I want to pass the minute dynamically. Can someone please help me with this Answer You can use
Data type is not updating on Database
In my entity class, I want to change the data type of a field but it’s not updating in the database. I am using PostgreSQL. I have also tried adding this: in application properties and still, it doesn’t work I don’t know why, please help, and thanks. What I have : Answer If you just created your database and doesn’t
Database entry problem. Only null value is written
I’m trying to work with REST api and after creating JSON post call, null value is written to the database instead of the value that was written in JSON. I am working with PostgreSQL database. After I send JSON using Postman or Swagger I get Server Response Code: 200. But the database writes the color as null. EXAMPLE: JSON: Server
Flyway Repeatable Script Throwing Table Does Not Exist Error
I am currently trying to trim down my versioned scripts into one baseline script (we don’t pay for flyway so is a pain). So I deleted my schema and attempted to run my one big script that contains everything I had. I exported the DDL out of my DBeaver client. However when starting my applications I am getting this error:
org.postgresql.util.PSQLException: ERROR: column is of type date but expression is of type integer: cannot write date into postgres using java
I’m trying to insert a record inside my table but I cannot insert any values into the Date column. This is the code I use to make an insert: How I call this function: The fullstack trace I get: Answer The correct solution to this problem is to use a PreparedStatement – do not concatenate parameters into SQL strings. Your
Find date inside each month
In my project, in the repository, this select finds the nearest date with a currency id that is less than or equal to the date whose range I set. How can I find a date in each month that is greater than or equal to the date I want to bind, but with the condition that this date must be
PostgreSQL’s JSONB data type with Hibernate: Error creating bean with name ‘entityManagerFactory’ defined in class path resource-Unable to load class
Now I learn about nested jsons and geojson and how to save them in PostgreSQL as JsonB directly in database and before starting. Inspiration source: https://thorben-janssen.com/persist-postgresqls-jsonb-data-type-hibernate/ Error I get when running the app: Here is the Main Entity: Here is the geojson(nested json) I want to save as Jsonb in a column in database: Here is the implementation of Usertype
Spring boot won’t connect to Postgres database
I am trying to learn Spring Boot with a tutorial. I have the code and the database, but I keep getting a Hibernate ERROR whenever I try to connect the two… This is the Error I get: I have the dependency set up in my pom.xml: The StudentService And the StudentController class application.properties: Unfortunately I have no idea what’s the