All Questions
1,130
questions
-1
votes
1
answer
23
views
Issue with Changing @Table Annotation to "users" in JPA Entity Class Using H2 Database
I'm encountering an issue with my Java application where changing the @Table name in my entity class causes the application to fail during tests and runtime. Here are the details:
Originally, my ...
-1
votes
0
answers
35
views
Hibernate + Spring Boot: Handling "More than one row with the given identifier was found" Exception
I'm working on a Spring Boot application with Hibernate and encountering an issue where Hibernate throws "More than one row with the given identifier was found" exception. I'm using custom ...
-1
votes
0
answers
18
views
Aggregated One-to-many field not being saved properly into the database with Spring Data
I'm trying to make a simple restful app and got stuck on testing the repo level.
For the educational purpose it's not allowed to use Spring Boot.
I need to have a One-to-many, Many-to-Many, Many-to-...
1
vote
0
answers
27
views
How to setup optimistic locking for overlapping datetime?
I am trying to make a booking system, where users can book a booking at a location for a certain time period. The problem I am having is, 2 entries that happen at the same time and overlap in the time ...
0
votes
1
answer
45
views
JPA insert objects with null ids
I have the following entities :
@Data
@Entity
@Builder
@NoArgsConstructor
@AllArgsConstructor
@Table(name = "user")
public class UserEntity {
@Id
@GeneratedValue(strategy = ...
0
votes
0
answers
14
views
How can I fetch the extra field from the JPA specification result
I have a table called Job in my database, I want to prepare a query using JPA Specification, to get a count of Jobs from the Media users using Count and groupBy, after generating the result I will ...
1
vote
2
answers
60
views
Getting java.lang.StackOverflowError when two users follow each other
I am working on a Java application using Spring Boot, and I have a UserEntity class where users can follow each other. However, when two users follow each other, I encounter a java.lang....
0
votes
1
answer
32
views
Remove a entry from hibernate collection without fetching entire collection
Using Hibernate, I have bi-directional association between person/address. Person entity can have too many addresses and I want to add and remove to address collection without loading entire ...
0
votes
0
answers
26
views
Getting error at @GeneratedValue(strategy = GenerationType.Auto)
enter image description hereThe type java.lang.Enum cannot be resolved. It is indirectly referenced from required type jakarta.persistence.GenerationType showing at package
i want to resolve my error....
0
votes
1
answer
29
views
Creating schema on ORACLE db using JPA buddy
Hi i'm trying to create my database schema and tables from JPA entities.
I am using an Oracle database.
When i execute the query i get this error:
[2024-05-16 18:32:02] [42000][1918] ORA-01918: user '...
0
votes
0
answers
33
views
JPA Query with NOT LIKE doesn't work to filter ips
I am working with a JPQL query to filter some gateways ips ending with 1 (the column in the database is of type INET but on the entity is of type String):
...AND concat(c.ip,'') not LIKE '%.1'
THe ...
0
votes
0
answers
40
views
H2 database columns and values don't converge Spring Boot
I'm trying to insert data into a table named "movie" using Spring Boot and H2 database. However, the columns and values don't converge. I've tried using the INSERT INTO statement, but it ...
0
votes
0
answers
19
views
Foreign key as null using JPA
I have two tables,
table 1 has a primary key: obj_id
and table 2 is using this table one primary key as foreign key,
so Ideally the model class should look like,
@Data
@Builder
@AllArgsConstructor
@...
0
votes
0
answers
38
views
How do I track the memory usage of Hibernate/JDBC database connections?
I am working on a project where we are making fairly large data retrievals and processing the data using a Spring Boot app. The app retrieves data from 5 tables spread across 2 SQL databases (4 tables ...
0
votes
1
answer
26
views
Hibernate validator does not see the table
The problem is that with hibernade.ddl-auto: validate enabled, I get an error that the users_roles table does not exist:
Failed to initialize JPA EntityManagerFactory: [PersistenceUnit: default] ...