Skip to main content
Filter by
Sorted by
Tagged with
0 votes
0 answers
57 views

There is a class with an EmbeddedId. @Entity @Getter @Setter @Table(name = "indicator_values") public class IndicatorValue { @EmbeddedId public IndicatorValueId id; @Column(...
Сергей Потапчук's user avatar
0 votes
0 answers
56 views

I am upgrading an app to newest Spring Boot 3, and because of that Spring Batch is upgraded to 5.2.3 (from 4.3.10). The application did not persist batch states previously, it was using the "map ...
riskop's user avatar
  • 1,839
Advice
0 votes
0 replies
17 views

According to the 2.6. Basic Types, Byte[] and Character[] may be mapped, yet as discouraged. And then can the array may contain null elements?
Jin Kwon's user avatar
  • 22.4k
-1 votes
0 answers
169 views

I have an entity with an enum class field : @Entity public class Trade { @Id private Long id; @Column(name = "kind") private TradeKind kind; } Here the enum ...
grigouille's user avatar
-3 votes
1 answer
84 views

I have implemented a class User that represents a User (so far either a Student or a Teacher). What they have in common is that they both have IDs, and some information about the user (this is stored ...
Alex's user avatar
  • 7
3 votes
0 answers
56 views

Title: Hibernate OptimisticLockException in Java 21 – works fine in Java 17 Body: I recently upgraded my project from Java 17 → Java 21, and one of my Hibernate test cases started failing with this ...
Jashwanth Sai's user avatar
1 vote
0 answers
83 views

Working on a scalable custom ID generator in JPA. The format I want to achieve is: <first three letters of country or region> + <year> + <sequence number> For example: USA2025001 I'm ...
RaviSai1819's user avatar
5 votes
1 answer
153 views

Quick background information for context: I'm writing a relatively small tool for a small gaming community to download and manage user generated content. It's a modular Java 24 + JavaFX Project done ...
GenerationLost's user avatar
1 vote
2 answers
109 views

I have an extensive JPA model which exclusively uses unidirectional @ManyToOne relationships from child to parent, for example like this. public class Child { @ManyToOne(optional = false) @...
Mumrah's user avatar
  • 422
0 votes
1 answer
65 views

Having unidirectional ManyToMany mapping in an entity called A to entity called B on field called files: @ManyToMany(fetch = FetchType.LAZY) @JoinTable(name = JOIN_TABLE_NAME) private List<B> ...
MarekChr's user avatar
  • 1,174
0 votes
0 answers
53 views

public void toggleBlacklistPatient(Patient patient, boolean blacklist){ if(patient == null || patient.getId() == null){ return; } if(blacklist && !...
Chinthaka Prasad Wijerathna's user avatar
2 votes
3 answers
203 views

I'm working with these entities: UserEntity: @Entity @Table (name = "users", uniqueConstraints = @UniqueConstraint(columnNames={"name"})) public class UserEntity { @Id @...
Rikelo's user avatar
  • 33
1 vote
2 answers
105 views

I use Hibernate for a project. It's a ticket system. For that I created comments with childcomments. But every time I want to delete a comment, hibernate escalates and tries to load just EVERYTHING. ...
LostQuotient117's user avatar
0 votes
0 answers
63 views

I'm working on a personal project to get better understanding of BE/architecture/how everything ties together, but I'm having trouble finding examples that show the full picture. Right now, I'm ...
almostcolin's user avatar
-3 votes
3 answers
255 views

I’m trying to implement a generic utility method that takes a String value and a Class<?> type, and returns an instance of that type. The context: This value represents data from a JPA column, ...
David Todorov's user avatar
2 votes
2 answers
114 views

I created the tables Person, PersonExtra, PersonBasic, etc. in my database with the superclass Person and subclasses PersonExtra and PersonBasic. @Entity @Table(name = "person") @Inheritance(...
gustavo's user avatar
  • 22
2 votes
0 answers
86 views

Say I have a model with a many to many or many to one relationship. This model would like this: @Entity public class A { // other fields ... @OneToMany(...) private List<B> bEntities = ...
Özgür Güzeldereli's user avatar
2 votes
1 answer
73 views

Situation Imagine the cacheable JPA Entity : @Entity @Table(name = "COUNTRY") @Cacheable @Getter @Setter public class CountryEntity { @Id @Column(name = "CODE") ...
huartgi's user avatar
  • 111
0 votes
0 answers
37 views

I have a JOBS table in Oracle 19c and a method that fetches jobs from the table, sets their status as RUNNING, and then releases the lock by committing the transaction. Basically, I have something ...
Niyazi Ekinci's user avatar
0 votes
0 answers
56 views

I have xId, yId, and zId bundles as a list, and I have to look them up in the DB using Where conditions. Is there a way to look up them most efficiently. val bundledList = listOf( listOf(1, 1, 1), ...
Kim Tae O's user avatar
2 votes
0 answers
121 views

After upgrading from Hibernate 5 to Hibernate 6, a native query that used to work now fails with an “ORA-17006: Invalid column name” error. Entity definitions Base class: @Entity @Table(name = "...
Maksson's user avatar
  • 23
1 vote
1 answer
81 views

I have two entities, Vehicle and Driver, with a one-to-one relationship. I also have a database constraint to ensure the uniques of a vehicle-to-driver relationship. @Entity class Vehicle( @Id val ...
regmoraes's user avatar
  • 5,559
5 votes
2 answers
224 views

I'm running a Spring Boot app. I have these two tables in my database. I fill an example of data that contains these tables. Table user Here columns id and century are PKs, and column state_id is a FK ...
Fizik26's user avatar
  • 863
1 vote
0 answers
31 views

I have Post and Comment entities with one to many relationship. @Entity public class Post{ @Id private Integer id; @OneToMany(mappedBy ="post") private Set<Comment&...
Berhe Birhane's user avatar
0 votes
1 answer
86 views

I'm running a Spring Boot app. I have these two tables in my database. I fill an example of data that contains these tables. Table user Here column id is a PK and column state_id is a FK from table ...
Fizik26's user avatar
  • 863
0 votes
0 answers
148 views

I’m facing an issue where INSERT queries on a MySQL table get stuck in “waiting for lock”, and even after innodb_lock_wait_timeout (50s), the connections are not released back to HikariCP, eventually ...
tusharRawat's user avatar
0 votes
0 answers
43 views

I am using a camel route defined in xml. The route starts from this step: <camel:route id="jpaRoute" routePolicyRef="startPolicy"> <camel:from uri="jpa://?...
fascynacja's user avatar
  • 3,186
1 vote
1 answer
121 views

In Spring Boot I have an entity: @Entity @Table(name = "Product") @EntityListeners(AuditingEntityListener.class) public class Product extends BaseEntity { ... @NotNull @...
Inux's user avatar
  • 15
0 votes
1 answer
80 views

I have the following scenario: class A { @OneToMany(mappedBy = "a", cascade = {CascadeType.PERSIST}) List<B> bsOfA; @OneToMany(mappedBy = "a", cascade = {CascadeType....
Guppy_00's user avatar
  • 317
0 votes
0 answers
49 views

I have the following entity setup in Spring Boot with Spring Data JPA: @Entity public class Role extends BaseEntity { @ManyToMany(fetch = FetchType.EAGER, cascade = {CascadeType.PERSIST, ...
Gaurav Kumar's user avatar
0 votes
0 answers
29 views

I have a multi data source configuration in spring boot 3.3.3 application connecting to 2 different datasources. which is working for build in queries. Now on one of the connections, i have to do ...
Sharvari Nagesh's user avatar
0 votes
1 answer
67 views

I have a table (product) as follows which holds product related data @Entity @Table(name = "product") public class ProductEntity { @Id @GeneratedValue(strategy = GenerationType....
Kasun Siyambalapitiya's user avatar
0 votes
0 answers
35 views

Given the Entities public class Foo extends AbstractFoo { @ManyToMany(fetch = FetchType.LAZY) @JoinTable(name = "foo_bar", joinColumns = {@JoinColumn(name = "foo_id&...
Leo's user avatar
  • 1
1 vote
2 answers
143 views

I have a basic CRUD, when trying to delete using the user email I get "message": "No EntityManager with actual transaction available for current thread - cannot reliably process 'remove'...
PauloRamos's user avatar
1 vote
1 answer
123 views

I have the following scenario: class AId { String aId1; String aId2; } @IdClass{AId.class} class A { @Id String aId1; @Id String aId2; String aType; // possible values are 0,1 } @IdClass{BId....
Guppy_00's user avatar
  • 317
0 votes
0 answers
55 views

I am trying to create a @NamedQuery that use COUNT and ALIAS(AS) to retrieve informations from a SELECT. The problem is I don't know how could I to create an ALIAS using @NamedQuery. I was looking for ...
FernandoPaiva's user avatar
1 vote
2 answers
104 views

I’m refactoring a microservice and I need to move one of my domain objects into an external shared dependency (library). Currently, this domain object is annotated with JPA (@Entity, @Id, etc.). ...
Ryley38's user avatar
  • 403
2 votes
0 answers
86 views

Eclipse 2025-06, OpenJDK 25, Hibernate Tools 6.5, PostgreSQL Database v17, postgresql-42.7.2.jar driver I set up Hibernate Configuration and checked Console Configuration Type to JPA (jdk 1.5+). In ...
Asif's user avatar
  • 35
1 vote
1 answer
127 views

I am working on a Spring Boot + JPA application, and I am confused about the best practice for persisting enums in the database. Let’s say I have the following enum in Java: public enum SellerStatus { ...
Rishabh Rastogi's user avatar
0 votes
1 answer
128 views

After updating to Spring Boot 3.4.3 and consequently to Spring Batch 3.5.5, I started getting an error when starting the Job. Previously, I used Spring Batch 2.6.4 and there were no errors. Job config:...
R1zen's user avatar
  • 133
0 votes
1 answer
91 views

I have an rs with an endpoint method annotated as @Transactional. That method fetches an entity, updates a field on it (to a value different than before) and then persists it. However, after the ...
TheOneAndOnlyMe's user avatar
0 votes
0 answers
26 views

I've created CalendarEvent Enity as below: package com.vissibl.core.domain import com.vissibl.core.api.calendar.EventStatus import com.vissibl.core.api.calendar.EventType import com.vissibl.core.api....
Rajesh's user avatar
  • 1
1 vote
1 answer
124 views

I have some micro-services and some functionalities are shared across these micro-services, so with my team we agreed that we needed this functionality moved to a SDK. I've started the migration of a ...
Ricardo Barba Hernandez's user avatar
0 votes
1 answer
68 views

I want to store the user who made the changes as well as the timestamp when the changes were made. I have a Quarkus backend with REST endpoints. The REST endpoints receive a REST model, which is then ...
unrated's user avatar
  • 280
0 votes
1 answer
92 views

When I try to save Product to this table (with refImg set to bytes from File.readBytes()), the following error is thrown by Spring, InvalidDataAccessResourceUsageException: could not execute statement ...
GPorubanTKK's user avatar
0 votes
1 answer
53 views

Are lifecycle callback methods that are defined in a superclass also invoked when updating a subclass entity? For example assume I have the following entities @Entity public class Animal { // ... ...
Axo's user avatar
  • 19
3 votes
0 answers
58 views

I'm working with a rather large @Entity class that performs asynchronous validation as users create data via multi-step frontend forms. The current process performs a batch update: findAllById(); ...
Mike's user avatar
  • 668
0 votes
0 answers
35 views

I am trying to update user details on a form. I have created a UpdateForm Component that runs componentDidMount to get a particular user and I also used static getDerivedStateFromProps to pre-populate ...
mohamed yusuph's user avatar
2 votes
1 answer
154 views

In one of my Spring Data JPA repositories I have this native query (PostgreSQL): @Query(value = "SELECT * FROM ballots b WHERE b.companies && :companyIds and b.meeting_id in :meetingIds&...
Sergey Tsypanov's user avatar
0 votes
1 answer
69 views

I'm looking into JavaDoc of @javax.persistence.PreUpdate and @javax.persistence.PrePersist and there isn't any notice about whether entity persist or update flow will be interrupted when an exception ...
Sergey Tsypanov's user avatar

1
2 3 4 5
1044