All Questions
31,771
questions
0
votes
0
answers
6
views
Hibernate: Generate non-id value from sequence
I have an entity with 2 fields which both use the same sequence, but when debugging I see that only the id field value is being generated:
@Table(name = "MY_TABLE")
public class MyEntity {
...
0
votes
0
answers
11
views
javax.persistence.PersistenceException: org.hibernate.exception.GenericJDBCException: could not extract ResultSet
Here the error:
javax.persistence.PersistenceException: org.hibernate.exception.GenericJDBCException: could not extract ResultSet
at org.hibernate.internal.ExceptionConverterImpl.convert(...
-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
11
views
Row updated in another transaction error unless there is a breakpoint on the save method
I have 2 methods that update an entity and have similar functionality, but I have inherited the codebase with little testing so don’t want to do a refactor yet.
However, there is a bug in one of these ...
0
votes
1
answer
16
views
JPA Subquery return object and use on query multiselect
I'm have a java spring application that use a criteria query. The query has a multiselect and one of the values is a subquery that bring an complete entity. The application work on original enviroment ...
-2
votes
1
answer
30
views
JPA get highest value in column with where condition
I'm using a JpaRepository to access a table in my database. I defined the table through an entity. My goal is, to get the highest value in the wordNumber column. But I also have to distinguish entries ...
-2
votes
0
answers
22
views
How to set foreign key constraint order by JPA annotation? [closed]
I'm using JPA in a Spring-Boot application with JPA (jakarta.persistence Annotations).
The creation of my DB schema (hbm2ddl=create) failed with an:
⚡ Foreign key constraint is incorrectly formed ...
0
votes
0
answers
35
views
JPQL did not translated to SQL correctly when using Window Functions
Models:
@Entity
@Data
//This is main entity
public class Collection {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id;
private String name;
@OneToMany(mappedBy = &...
-1
votes
2
answers
39
views
any scenario's to use @Transactional annotation at Repository delete method?
I am reveiewing the code for one of the senior member for the first peer review so he added @Transactional annotation at custom repository with delete method. The custom Repository delete method is ...
-1
votes
0
answers
22
views
JPA Unit Test Error: Table not found During ALTER TABLE Execution
I am encountering an error in a simple JPA unit test where it attempts to execute an ALTER TABLE command on a table that it claims does not exist. Here is the relevant error message:
INFO: Property ...
0
votes
0
answers
31
views
Issuse with relationship mapping MapKeyEnumerated with an Entity List as values
I have this Entity
@Entity
public class MealPlanADay {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@JsonIgnore
private Long id;
//@OneToMany(cascade = CascadeType.ALL,...
0
votes
0
answers
24
views
Hibernate seems to ignore the dialect I specify
I'm using Olingo JPA for producing an OData API.
The database I'm connecting to doesn't support the 'LOCATE' function; instead it implements 'POSITION'.
This seems to be true of a few databases: ...
0
votes
1
answer
65
views
IntelliJ IDE Cannot Find javax.annotation.processing.Generated Symbol While mvn test Works Correctly
I am having a problem with my project configuration and running the program and unit test. When running with mvn test the JUnit test executes propertly, but when executing from within the IntelliJ IDE,...
-1
votes
0
answers
168
views
java: cannot find symbol - symbol: class Generated location: package javax.annotation.processing during build
What are the possible errors that are causing this:
/home/api/target/generated-sources/annotations/org/example/core/user/model/User_.java:3:35
java: cannot find symbol
symbol: class Generated
...
-1
votes
1
answer
47
views
Why does VsCode generate classes with both jakarta.data.metamodel and jakarta.persistence.metamodel?
For some time now, I've had a problem in VsCode where I end up with duplicate generated sources.
For example, let's take the SiteEntity entity.
In /target/generated-sources/annotations/com/.../sites, ...