I have a little problem with mysql + hibernate. in the database I have: I don’t have any record of January 13th 2023 if I perform a query to get this information of the January 14th 2023, in the code I get this: I don’t know why if in the database I have 14-jan-23 in the code I get: 13-jan-23
Tag: hibernate
SpringBoot ManyToOne saving to database issue – getting error: Field ‘user_id’ doesn’t have a default value
My situation is this: I am creating a marketplace where users can buy and sell products. I am trying to list a product with a ManyToOne relationship with the logged in user. I am getting the error: Field ‘user_id’ doesn’t have a default value. Im guessing this is because I haven’t set the user_id but I’m not sure how to.
Getting null value reference in One to Many mapping in Spingboot
I am trying to implement ONE-to-MANY mapping among two entities. In here designations have a location and a location have many designations. Once I added the designation it mapped fine, but it update the location table with null except id. Here I’m using the Microsoft SQL server. Application Properties DesignationMaster LocationMaster Service class of Designations Controller class of Designation I
Error creating table in MSSQL server in Microsoft Azure: Spring Boot and Hibernate
I have created a Spring Boot Web Application with Hibernate. I am using Microsoft Azure and SQL Database to deploy my application. I have configured the database on Azure and in my code. Configuration code is- 1. application.properties file 2. application.yml file I am creating several tables in my database. All the tables are getting created, but one that needs
Multiple @ElementCollection fields with discriminator?
I want to have a Game entity that has two List of player IDs stored as Longs This is my table: game_player_team game_id player_id team 1 1 H 1 2 H 1 3 A 1 4 A And this is how far I got modeling the Game entity I can’t work out how to get only the player_id’s for the
How to return a custom response for validation errors using Hibernate Validator and Quarkus
I implemented a REST endpoint in my Quarkus application. For validation purpose I’m using the hibernate-validator. So I added the @Valid annotation to the incoming parameter and added some constraints to that class. Everythings works as expected. When sending a request with invalid data I see a response like this: But I would like to have a more compact response
Unidirectional OneToOne cascading from Child to Parent
I’m in the process of migrating a Hibernate 3 application to Hibernate 5.2. We have a couple of one-to-one unidirectional mappings with cascading (which we can’t make bidirectional because the parent can’t know anything about the other entities). The following (simplified example) worked fine in the latest Hibernate 3.x and latest Hibernate 4.x, but started running into ConstraintViolationExceptions in Hibernate
while deploy in tomcat – No bean named ‘entityManagerFactory’ available
While deploying project to tomcat I got this error,but with sts ide all works perfectly. spoiled my 2days 🙁 . pom.xml Answer A version updation of hibernate worked for me!
Execution stuck: Hibernate + Oracle DB with Wallet : DriverManagerConnectionProviderImpl – HHH000115: Hibernate connection pool size: 20 (min=1)
When working with Hibernate and Oracle DB with Wallet. Getting below error: org.hibernate.engine.jdbc.connections.internal.DriverManagerConnectionProviderImpl HHH000115: Hibernate connection pool size: 20 (min=1) I am trying currently with Java/JDK: 17 Hibernate: ‘org.hibernate:hibernate-core:5.4.27.Final’ Oracle Autonomous DB: 19c connection via wallet. I tried with different version of JDK(8 and 11) and Hibernate(5.3.xx, 6.4.xx, 5.2.xx). Same error everytime. Answer The issue in my case was because
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