All Questions
8,411
questions
0
votes
1
answer
27
views
How to Handle Indexes for @MapsId in JPA: Should FK and PK Share the Same Index?
I am using the @MapsId annotation in JPA to map a foreign key (FK) to a primary key (PK). According to the @MapsId annotation, the FK and PK share the same value. However, when I checked the database ...
0
votes
0
answers
28
views
How to Convert a Complex SQL Query to Hibernate Criteria API
I'm learning about Hibernate's Criteria API and would like to know how to convert this particular SQL query to Criteria API. Here is the SQL query I’m working with:
select s1.score as score,count(s1....
2
votes
0
answers
59
views
Can't connect to MySQL server in Git-Hub Action
I installed MySQL 9.0 in the docker environment using mirromutth/[email protected] [1] in GitHub Action. I set it up in Spring project as follows.
File application.yml
spring:
datasource:
url: ...
0
votes
0
answers
45
views
JPA repository findBy return different result when using H2 and MySQL
This is the simply version of my application.
I have 2 entity.
Customer.java
package com.udacity.jdnd.course3.critter.user;
import java.util.List;
import java.util.ArrayList;
import com.udacity.jdnd....
-1
votes
0
answers
21
views
How to combine firstname,middlename,lasname with null case in HQL search query
In my application I've saved staff name as first name, middle name & last name separately on the database. So if the user enters the full name or part of the name to search the staff, it should ...
0
votes
0
answers
11
views
Error executing DDL for foreign key constraint in Hibernate with MySQL [duplicate]
I'm encountering an issue with Hibernate while trying to define a foreign key constraint for a MySQL database in my Spring Boot application.
I have three entities: Promoteur, Projet, and Bien. The ...
0
votes
1
answer
35
views
File not uploading getting "Validation failed for argument [0] in public java.lang.String"
I'm trying to use a form to save text and a file name along with uploading a file to a specific folder. I have used entities here and will share all the code.
package com.rx.healthtechhub.entities;
...
0
votes
0
answers
45
views
Issue: java.sql.SQLException: Column 'y0_' not found During High Database Load
I'm encountering an issue where the error java.sql.SQLException: Column 'y0_' not found appears, especially under increased database load. This error is intermittent and seems to correlate with high ...
-1
votes
1
answer
44
views
Hibernate - Batch update returned unexpected row count from update: 0 actual row count: 0 expected: 1 but im using .save() only
I was wondering why I am having this issue when I am only doing a .save() on the db? I cannot figure this one out for some reason.
my Entity:
@Component
@Entity
@Data
@NoArgsConstructor
@...
0
votes
0
answers
35
views
How to do byte[] comparison with incoming unhexed md5 string in JPA Query by using Spring boot 3 and Hiberate 6.5
I have a column varbinary(16) that stores some slug values as unhex(md5('slug')). It's mapped in entity as byte[].
private byte[] slugBinary;
And in my JPA query (using Spring boot 2.7 and Hibernate ...
1
vote
1
answer
15
views
Connection issue in hibernate
I need to connect my song class with the database using hibernate. But, hibernate is not connecting and excutting the queries. I used several methods and several dependencies of hibernate but still it ...
1
vote
1
answer
60
views
Spring Boot Error: no transaction is in progress
I'm getting this error when I'm trying to save ChatUser object from /showSignUpForm request . The object details are stored successfully in the DB but it gives "jakarta.persistence....
0
votes
1
answer
12
views
Hibernate is not generating any table
I'm learning Spring microservices and faced an issue:
So first I've this docker compose file:
version: '3.1'
services:
mongo:
image: mongo
container_name: mongo
restart: always
ports:...
0
votes
2
answers
54
views
Error Code: 1364. Field 'userid' doesn't have a default value
This is the error:
java.sql.SQLException: Field 'userid' doesn't have a default value at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:130) ~[mysql-connector-j-8.3.0.jar:8.3....
0
votes
0
answers
21
views
Hibernate Envers Auditing BLOB/TEXT Column Key Length Issue
I am working on a project to enable Hibernate Envers auditing in our codebase. We are using hibernate.hbm2ddl.auto=update to generate the audit tables automatically.
However, it auto-generates audit ...