Questions tagged [hibernate-jpa]
53 questions
3
votes
1 answer
Micronaut data native-image: No bean of type [io.micronaut.data.operations.PrimaryRepositoryOperations] exists
I'm working on a new example by using Micronaut, Micronaut Data, JPA, Postgres, and GraalVM, following
https://github.com/rmondejar/micronaut-postgres-example
This example has been created by using Micronaut Launch, 2.0.0.RC1 with the following…

Rubén Mondéjar
- 41
- 4
3
votes
0 answers
how to set hibernate query timeout
I am new to Hibernate and using the following versions of Hibernate:
hibernate-core-4.3.11.Final
hibernate-jpa-2.1-api-1.0.0.Final
I am trying to set a timeout on a query. The Query class of Hibernate has setTimeout API which is used to set the…

Pushkar Deole
- 31
- 2
3
votes
1 answer
Hibernate AttributeConverter fails if using custom query with JOIN
I found very interesting bug in hibernate jpa 2.1. When I'm writing custom query implementation in a repository and using both custom AttributeConverter and JOIN in the query then AttributeConverter don't work. I'm sure, that JOIN causes this…

Bohdan Petrenko
- 997
- 2
- 17
- 34
2
votes
1 answer
EntityManager refresh() method does not refresh but resets
The em.refresh(person) in the following code does not work. Rather than refreshing the person with a fresh value from database, it resets (undo or discards) the changes made in the cache. I am not able to understand…

skip
- 12,193
- 32
- 113
- 153
2
votes
0 answers
Searching into postgres Jsonb column using CriteriaBuilder JPA
I am facing issues while retrieving/searching through Postgres JSONB column using CriteriaBuilder.
Postgres Query : SELECT * FROM table where lower(jsonb_extract_path(tags,'Case')::text) = lower('"normal"') as text));
Tags: datatype of tags column…

Sushant Mane
- 21
- 2
2
votes
1 answer
How to test Hibernate JPA persistence layer?
I need to write tests for data access (Hibernate persistence actions) because I want to know that it works as expected even if I upgrade Hibernate version. So what is the best way to do it with Junit?? And is it really useful to test an external…

khouloud
- 417
- 4
- 17
2
votes
1 answer
date field with CreationTimestamp throw PropertyValueException: not-null property references a null or transient value
I am using web-services with spring-boot 2.0.6 and hibernate 5.2.17. When I save an object with a createTime field of @CreationTimestamp, @Column(nullable = false) and @Temporal(TemporalType.TIMESTAMP), I get the exception…

xmcx
- 283
- 3
- 18
2
votes
1 answer
Deleting Hibernate entity that has a foreign key in database
I have already looked into this issue that I am having and tried to remove the AccountBalance from the Set in the corresponding Account Hibernate class, and then saving the Account object, but the database isn't updated.
I want to delete an…

James Meade
- 1,147
- 5
- 22
- 46
2
votes
1 answer
org.apache.catalina.LifecycleException;failed to start component
After deploying/replacing the class files in Tomcat 8 I got the following error. I haven't been able to find (or properly implement) a solution to the problem at hand yet. Any help would be…

Shruti Misal
- 21
- 1
- 2
2
votes
1 answer
Hiberate JPA - sequences becoming negative when record is inserted
The environment:
Database - Oracle 12c
Hibernate - 5.2.10Final
JPA - version 2.0
We are using entityManager.merge to insert the object. The value of the sequence is a positive value but when inserted in db, it becomes negative. Can't seem to find…

Hingle McJingleberry
- 541
- 4
- 26
2
votes
1 answer
@EntityListeners Annotation Causes TypeNotPresentExceptionProxy Error
I have a JPA entity that looks something like this. Note the @EntityListeners annotation:
import javax.persistence.EntityListeners;
import…

user3303372
- 761
- 1
- 10
- 21
1
vote
1 answer
How to setup Hibernate JPA in Spring-Boot project without Spring Data?
I am quite new to Spring and have a task to create a multi-module project that needs to use Hibernate JPA and Spring-Boot (Spring Data JPA is not allowed for this project).
I am using the PostgreSQL database and…

Judita
- 119
- 1
- 2
- 8
1
vote
1 answer
I get an "Invalid persistence.xml" with createEntityManagerFactory but not @PersistenceContext
I have a project where we use Hibernate-jpa-2.1 and get an EntityManager istance both in this way
@PersistenceContext(unitName = "common-api")
EntityManager em;
and this
em =…

Capitano Giovarco
- 157
- 1
- 11
1
vote
2 answers
Caused by: java.lang.IllegalArgumentException: Property 'driverClassName' must not be empty
In the code I have shared here Exception in thread "restartedMain" java.lang.reflect.InvocationTargetException Caused by: java.lang.NullPointerException I am getting new error. Could you please help me with…

G.Chahar
- 185
- 6
- 19
1
vote
2 answers
how I obtain only two attribute of my class
I have a problem with the controller, it is returning the whole User Instance while I only need to return attribute which are : "email" and "password".
The problem exists in the public String login () method in the Controller class AuthController…

j3v1t0
- 41
- 1
- 6