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
0
votes
1 answer

Transaction closing syntax compatible with hibernate 4 and 5

I have a transaction closing syntax working for a long time in a webapp. It's running hibernate 4.3.10.Final: if(t!=null && !t.wasCommitted()) t.rollback(); if(s!=null) s.close(); // t is a org.hibernate.Transaction, s is a…
Bruno Lamps
  • 544
  • 6
  • 27
0
votes
1 answer

Can't deploy war because ClassCastException: org.hibernate.jpa.HibernatePersistenceProvider incompatible javax.persistence.spi.PersistenceProvider

I got this error even i have created a shared lib on was 9, this lib contains all the hibernate 5.4.3 dependency including javax.persistence 2.2
Hinde
  • 69
  • 1
  • 2
  • 8
0
votes
1 answer

How to create table from xml in Hibernate 5?

I keep table schema in this file tableaddress.orm.xml
john
  • 647
  • 5
  • 23
  • 53
0
votes
2 answers

Replacement for DirectPropertyAccessor?

I am upgrading a Spring 4.3.2 project to Spring 5.1.5. One of my test cases started failing with the error. ClassNotFoundException: org.hibernate.property.DirectPropertyAccessor Which makes sense since it has been deprecated in Hibernate 5.x which…
Vivek Shankar
  • 770
  • 1
  • 15
  • 37
0
votes
0 answers

Is it possible to invoke methods of entity classes using JPA Criteria API?

package com.surya.dto; import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.Id; import javax.persistence.Table; @Entity @Table(name = "department") public class Department { @Column @Id private…
0
votes
1 answer

Unable to locate Attribute with the the given name [XXX] on this ManagedType [unknown]

I have this entity with its ID defined in Identifiable class. InventoryLoad has InventoryLoadID as its PK public class InventoryLoad extends AbstractIdentifiable implements Auditable {     @OneToMany(mappedBy =…
0
votes
1 answer

while running a named query in hibernate-5 how I would make sure that it is using JPA2.1 standards

while running a named query in hibernate-5 how would I make sure that it is using JPA2.1 standards(JPQL Grammer) When running in hibernate5 it executes fine, this should fail when in JPA2.1, what/where do I need set something to use the JPA…
0
votes
1 answer

Hibernate association management from fresh/new to loaded entities not consistent - why?

We would like to use the association management functionality of Hibernate (5.4.2.Final), together with bytecode enhancement and field access. This works for some cases and not for others beyond our understanding - would appreciate…
Learner
  • 1,215
  • 1
  • 11
  • 26
0
votes
1 answer

How to start Spring Boot Application 2 with Hibernate 5 (JPA) without depending on Database?

First: this is not a duplicate question. More than 4.5 years ago another user wrote (on Stackoverflow.com) that he had a requirement where his Spring Boot Application should be able to start even when database is down. He used Spring Boot…
LowLevel
  • 1,085
  • 1
  • 13
  • 34
0
votes
1 answer

Alter Oracle session variables outside of a Hibernate transaction

We've been using a pattern like this for a while to ensure a specific operation is executed with BATCH NOWAIT, for performance reasons. try { session.createSQLQuery("ALTER SESSION SET COMMIT_LOGGING='BATCH'…
Nick
  • 11,475
  • 1
  • 36
  • 47
0
votes
0 answers

Session not getting created after upgrading to hibernate 5

I have the following code in my HibernateUtil class. But when trying to call the getSession() method getting the following error.org.springframework.web.util.NestedServletException: Handler dispatch failed; nested exception is…
user3292629
  • 138
  • 2
  • 16
0
votes
1 answer

Lazy Loading with EJB + JPA + Jersey

I have the following working without FetchType.LAZY: @Entity public class Test { @Id @GeneratedValue(strategy = GenerationType.IDENTITY) private Long id; private String text; @ManyToOne @JoinColumn(name = "lazy_id") …
Eduardo
  • 277
  • 1
  • 6
  • 17
0
votes
1 answer

hibernate.connection.handling_mode and REQUIRES_NEW Transactions (Hibernate 5.2+Spring 4.3)

I am noticing very different behaviors in our JPA/JTA application, when I set the hibernate.connection.handling_mode and when I do not set it. I have the following entity defined - @Cache(usage =…
aathif
  • 156
  • 2
  • 15
0
votes
1 answer

Unknown entity: org.hibernate.engine.transaction.internal.TransactionImpl

I am using hibernate5. I have placed my hibernate.cfg.xml file in config folder of same package.The following error is observed when I tried to run the code org.hibernate.MappingException: Unknown entity:…
Aarthi Ananth
  • 460
  • 1
  • 4
  • 16
0
votes
1 answer

hibernate 5 - Could not obtain transaction-synchronized Session for current thread;

I am able to use sessions if I open a new one, however, I am getting this error if I try to get the current session which I guess doesn't exist. persistence-h2.properties #…
quartaela
  • 2,579
  • 16
  • 63
  • 99