Questions tagged [hibernate-jpa]

53 questions
1
vote
0 answers

Weblogic 10.3.3 :: java.lang.NoSuchMethodError: javax.persistence.spi.PersistenceUnitInfo.getSharedCacheMode()

I get the error Caused By: java.lang.NoSuchMethodError: javax.persistence.spi.PersistenceUnitInfo.getSharedCacheMode()Ljavax/persistence/SharedCacheMode; at org.hibernate.ejb.util.LogHelper.logPersistenceUnitInfo(LogHelper.java:39) …
826dna
  • 163
  • 3
  • 11
1
vote
0 answers

JPA update only if model exists

em.merge is not an option because I don't want a new row if the id doesn't already exist. Also, it calls an extra select. I don't want to do find and then call merge as it will again be extra selects. I was hoping for a way without having to write…
fR0DDY
  • 795
  • 1
  • 8
  • 20
1
vote
0 answers

JPA "update" query stuck and locks all Database

I have an update query that sometimes gets stuck and locks the entire database. I have to ask the DBA to kill the query manually whenever this occurs. The status of the query in the db is "sleeping", as can be seen in the following screenshot. I'm…
1
vote
1 answer

findAllBy JPA with embeddedId

I have this Document hibernate jpa entity with an EmbeddedId: @Entity data class Document( @EmbeddedId @NotNull val documentExpertId: DocumentExpertId, // other fields ) @Embeddable data class DocumentExpertId( …
1
vote
1 answer

Java Nifi Processor with Hibernate JPA

I'm trying to use a hibernate JPA from my custom Nifi processor written in Java. From inside the processor i don't have any information about connection string, username, password etc (because in the Nifi it is defined in a separated service). But…
yuriscom
  • 550
  • 3
  • 17
1
vote
0 answers

Spring Data Rest returning null values for Parent and Child entity

I have an implementation with Spring Rest Data for a Employee and Department class. However when I try to fetch the data using rest template, the id is always comes null for both the entities but with calling hibernate methods, it populating all the…
1
vote
1 answer

Spring boot JPA - json with nested object and id

I am trying to do a project with some basic ORM relationships and REST controllers for sending jsons. One of my POJOs looks like this: @Entity @Table(name = "product_models") public class ProductModel extends BaseEntityWithName { @ManyToOne(fetch…
0
votes
1 answer

microprofile-openapi-api 2.0 switches off hibernate-jpamodelgen

I have a java microservice-project with theese two dependencies defindes in my gradle.build file: implementation(group: 'org.eclipse.microprofile.openapi', name: 'microprofile-openapi-api', version:…
0
votes
0 answers

Spring data jpa with hibernate is failing on PK (primary key) violation during save and flush execution

I'm upgrading from Spring 4.3.23.RELEASE to Spring 5.3.20 and running into issues with the save and flush of the record due to that Spring is not using the correct next available key value from the Oracle SEQUENCE that is configured in the Java…
elfman
  • 1
  • 1
0
votes
2 answers

HikariPool-1 - Exception during pool initialization with SpringBoot and Hibernate and JPA Repository

HikariPool-1 - Exception during pool initialization when trying to run spring-boot application. While running mvn spring-boot:run command, the logs show repositories initialized and server starts and is in running state but throws exception during…
Haaru
  • 23
  • 1
  • 5
0
votes
1 answer

No Persistence provider for EntityManager Error

I am getting this error "No Persistence provider for EntityManager named" and not able to proceed. I am learning hibernate and trying so hands on stuff. I tried all the methods mentions in this search forum, but still i get the same error. I tried…
Sujesh Surya
  • 143
  • 1
  • 1
  • 12
0
votes
1 answer

Could not initialize class sun.security.ssl.SSLExtension when deploying spring boot with mssql database to glassfish 5.1

I am new to glassfish server and I am trying to deploy a Spring boot application in glassfish 5.1. My Spring boot application communicates with database via JPA and Hibernate. When I compile and deploy with mysql, deployment went fine. However, when…
0
votes
1 answer

How to return the genarated ID in CrudDAOImpl.java when using Hibernate-JPA

I use the hibernate-JPA implementation (v5.6.1.Final) in my project. I have implemented the data access layer as follows: Class Visualization Diagram. 1.1 Employee.java Entity package com.elephasvacation.tms.web.entity; import…
Dhanusha_Perera07
  • 3,347
  • 5
  • 14
  • 22
0
votes
1 answer

How can I make sql generated by Hibernate use in operators over equality operators

What I want is a way for Hibernate to generate 1 statement to delete all children, instead of 1 statement per child. If I have a relationship between Entity A and B , where A is the parent and B can be many children. If I use annotations such as…
MrClamps
  • 31
  • 9
0
votes
1 answer

Spring JPA: keeping the persistence context small

How can I keep the persistence context small in a Spring JPA environment? Why: I know that by keeping the persistence context small, there will be a significant performance boost! The main problem area is: @Transactional void MethodA() { WHILE…
tm1701
  • 7,307
  • 17
  • 79
  • 168