Questions tagged [hibernate-5.x]

Hibernate-the object-relational mapping framework for the Java language released new version 5.x with enhanced features like query parser,multi-tenancy improvements,follow-on fetches,OSGi improvements etc.

Hibernate-the object-relational mapping framework for the Java language released new version 5.x with enhanced features like query parser,multi-tenancy improvements,follow-on fetches,OSGi improvements etc.

For more details on Hibernate version 5.x view Hibernate ORM Roadmap

368 questions
1
vote
1 answer

Migrate Hibernate 4.3 to 5.2 - missing table

I'm trying to migrate from Hibernate 4.3 to 5.2. The problem I end up having is with the following entity structure: @MappedSuperclass @Inheritance(strategy = InheritanceType.TABLE_PER_CLASS) public abstract class Post { @ManyToMany(fetch =…
nyxz
  • 6,918
  • 9
  • 54
  • 67
1
vote
2 answers

HQL doesn't allow REGEXP or RLIKE for MySQL with Hibernate 5

I'm trying to add RLIKE condition to an HQL query but I'm getting "unexpected token: rlike" error message on HQL validation. I'm using Spring boot with Spring-data and Hibernate 5 over MySQL. Query: @Query("from PortEntity p where p.name rlike…
1
vote
1 answer

hibernate 5.2 spring boot 1.5 integration without JPA

I a using hibernate 5.2 with spring boot 1.5 version. I have used sessionFactory instead of entityManager. When I create a command line application by making the main class extend the CommandLineRunner, I am able to do insert and delete into my…
Amar Dev
  • 1,360
  • 2
  • 18
  • 38
1
vote
0 answers

'Detached entity passed to persist' during merge with enableLazyInitialization=true hibernate-enhance-maven-plugin

After migrating hibernate from 4.3.11 to 5.1.10 and using the new hibernate-enhance-maven-plugin replacing the deprecated ant bytecode enhancement task, the following happens with an entity with OneToMany association with…
Gubbes
  • 43
  • 6
1
vote
1 answer

Use java.time in Hibernate 5.1

I'm using Hibernate 5.1 in my application. Now I want to convert all the java.util.date classes to the java.time java 8 classes. I changed all my source code to the new Java 8 standard. But when I query the first query that contains a mapping to a…
JimmyD
  • 2,629
  • 4
  • 29
  • 58
1
vote
2 answers

JPA/Hibernate cannot understand persist order

I'm trying to understand how the jpa/hibernate "magic" really works in practice, to avoid future (and common) pitfalls. So I created some simple JUnit tests, where the set of instructions is exactly the same, but the call order of em.persist() is…
Michele Mariotti
  • 7,372
  • 5
  • 41
  • 73
1
vote
0 answers

How autowire SessionFactory in Hibernate 5?

I try autowire SessionFactory, but get this error: APPLICATION FAILED TO START *************************** Description: Field bookRepository in com.test.app.BookService required a bean named 'entityManagerFactory' that could not be found. Here I…
Olesia Ilchuk
  • 314
  • 2
  • 5
  • 16
1
vote
2 answers

Hibernate fail to register REF_CURSOR parameter

I am new to Hibernate. Using the 5.2.10 FINAL version connecting to Oracle 11g using the Oracle10gDialect with JPA 2.1 and ojdbc8.jar I try to access a simple stored procedure taking a String input parameter and output a Oracle…
Ivan
  • 417
  • 1
  • 4
  • 10
1
vote
2 answers

PostgreSQL 9.6 DATE column mapping using Hibernate 5+ in Java 8

Let's consider a simple Postgres database with only one table and one column, that is of type DATE, i.e.: CREATE DATABASE test; CREATE TABLE test_table ( date_test DATE NOT NULL DEFAULT CURRENT_DATE ); From the Hibernate documentation regarding…
Colonder
  • 1,556
  • 3
  • 20
  • 40
1
vote
1 answer

Hibernate 3.x to 5.x migration issues

I am migrating hibernate 3.x to latest version 5.x and I see many issues that I need some help with. SessionFactory.evict() - My code uses SessionFactory.evict() which I don't see in 5.x. What should I replace this code with?…
Maz
  • 653
  • 12
  • 22
1
vote
1 answer

How use java.time.LocalDate using Hibernate5 and Vaadin8?

I'm new on Vaadin and I'm trying to do a simple crud application. I was starting from Vaadin CRUD sample; then I modify the backend project to use Hibernate and the ui project to manage the various tables. I can do that for simple data type like…
Filippo1980
  • 2,745
  • 5
  • 30
  • 44
1
vote
1 answer

How to specify hibernate entity association's mapping class when using java based configuration? (as in @OneToOne, etc.)

I am trying to completely opt out of xml based mapping and write the same using java based configuration. It was working completely fine until I had the requirement of using entity mappings. Can someone help me with how to specify hibernate mapping…
eccentricCoder
  • 846
  • 1
  • 14
  • 35
1
vote
0 answers

hibernate5 JpaRepository save not saving entities in bidirectional relationship

I'm upgrading Hibernate4 to Hibernate5 (Spring 4.3.7) (Spring-data-jpa 1.11.1) and facing the problem with saving of bidirectionally associated entities save using JpaRepository.save(ownerObject). Here are my entities :- DataType (Owner Entity) :-…
1
vote
0 answers

Hibernate 5.1 implementing UserType for Oracle SYS.XMLTYPE

I am trying to store Oracle XMLTYPE data as JPA Entity in my java application. First I implemented UserType for xml field: public class FiledsListUserType implements UserType { private static JAXBContext jaxbContext; public Object…
user3378876
  • 1,816
  • 4
  • 24
  • 26
1
vote
0 answers

Why still Hibernate does its logging (eg SQL) in synchronous mode (if enabled)

Wondering why still Hibernate SQL loggings happening in simple synchronous mode and hence have a performance hit rather than doing it asynchronously (like how we can do using log4j2 for example).
Avis
  • 2,197
  • 18
  • 28