Skip to content
Advertisement

Tag: spring-data-jpa

Problem in updating the entity with unidirectional @ManyToOne relation

I have two entities as below and the main problem is when I want to update the AccountRequestStatus entity. I save the integer enum code of AccountRequestStatusEnum in the database to persist the AcountRequest status in the whole application. AccountRequestStatusEnum AccountRequest AccountRequestStatus The first time that an account request comes from MQ my to application, I save the initial code

Spring Boot Hibernate creates tables with wrong names

When I run my project, the Hibernate creates automatically tables with wrong names. I have two tables User and Role and also three classes: abstract class IdField.java: User.java class: and Role.java class: And Hibernate creates two tables with wrong names as id_field and id_field_roles: but I want table names as it is in @Table annotation like “user” and “role” Answer

How can I show Multiple Rows in JSON

I need to show sql result in a JSON like this in a spring boot app. Class Repo Service Controller I’m getting this message on log: query did not return a unique result: 94; nested exception is >javax.persistence.NonUniqueResultException: query did not return a unique result: 94 After that, I wanna delete/update all of salesperson associated id’s (transfer clients (id’s) from

Spring Boot 2 Multiple Datasource – work only the one with @Primay annotation

I have a problem, I’m trying to use two Oracle databases in spring boot using DataSource, The DataSource wiht the @Primay annotation works fine but the oher one only gives me: I don’t have idea what I should do now. Any help will be welcomed. Thanks! application.properties pom.xml DatabaseConfiguration.java Repository from 1st DB Repository from 2nd DB Answer I could

Using the concept of JPA, how to update table using data from another table?

FmoReorgGeo.java FMOReorgGeoServiceImpl.java FMOReorgGeoRepository.java ERROR LOG *I am trying to fetch data from reorgViewX and then updating FmoReorgGeo table. I am being able to fetch data correctly but when running update query I am getting error. The error says: Could not extract result set metadata; nested exception is org.hibernate.HibernateException: Could not extract result set metadata. I am using the concept of

Advertisement