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
53
votes
2 answers

What's new in Hibernate ORM 5?

I just saw that the 4th candidate got released for Hibernate 5. What's new in 5 compared to earlier versions?
Shri S Softwares
  • 1,529
  • 2
  • 12
  • 16
51
votes
8 answers

ImprovedNamingStrategy no longer working in Hibernate 5

I have simple spring-jpa configuration where I have configured Hibernate's ImprovedNamingStrategy. This means if my entity class has a variable userName, then Hibernate should convert it to user_name for querying the database. But this naming…
Anup
  • 556
  • 1
  • 5
  • 11
42
votes
16 answers

Hibernate 5 java.lang.NoSuchMethodError org.jboss.logging.Logger.debugf

I have a problem when I deploy a webapp with hibernate 5 Caused by: java.lang.NoSuchMethodError: org.jboss.logging.Logger.debugf(Ljava/lang/String;I)V at org.hibernate.internal.NamedQueryRepository.checkNamedQueries(NamedQueryRepository.java:149)…
Jago Satori
  • 431
  • 1
  • 4
  • 6
36
votes
1 answer

AbstractMethodError in SessionFactoryImpl when upgrading to Hibernate 5

We're using Spring ORM 4.2.1.RELEASE to interact with Hibernate via JPA. Everything works fine with Hibernate 4.3.11.Final, but when we try to upgrade to Hibernate 5, it breaks with an AbstractMethodError when constructing the…
ThrawnCA
  • 1,051
  • 1
  • 10
  • 23
35
votes
5 answers

Where did Configuration.generateSchemaCreationScript() go in Hibernate 5

In Hibernate 4.x, I used to generate and export the schema as defined in annotated entities as follows (using Spring to find annotated entities on the class path): Connection connection = …
Lukas Eder
  • 211,314
  • 129
  • 689
  • 1,509
34
votes
6 answers

spring - hibernate 5 naming strategy configuration

I am writing application using postgresql database and spring + hibernate frameworks. I upgraded spring framework from 4.1.5.RELEASE to 4.2.0.RELEASE version and upgraded hibernate framework from 4.3.7.Final to 5.0.0.Final version. After upgrade I…
Yoh0xFF
  • 1,450
  • 2
  • 18
  • 31
26
votes
7 answers

java.lang.IllegalArgumentException: expecting IdClass mapping

I have configured composite primary key for my entity Employee as follows Employee.java: @Entity @Table(name="employee") @Proxy(lazy=false) @IdClass(EmployeeId.class) public class Employee implements Serializable { private static final long…
Achaius
  • 5,904
  • 21
  • 65
  • 122
26
votes
3 answers

Correct alternative to SharedSessionContract.createCriteria(Class persistentClass) in Hibernate 5.2

I am upgrading to latest Hibernate 5.2.0 FINAL from Hibernate 3.x. In my old code we were using criteria queries as below. Session session =getHibernateTemplate().getSessionFactory().getCurrentSession(); Criteria criteria =…
Smruti R Tripathy
  • 789
  • 1
  • 10
  • 15
25
votes
4 answers

Hibernate Migration from 4.3.x to 5.x for method org.hibernate.cfg.Configuration.getClassMapping(className)

In Hibernate 4.3.x, there is a method getClassMapping(className) of class org.hibernate.cfg.Configuration. But in Hibernate 5.x, this getClassMapping(className) method is removed from Configuration class. What will be the code substitution in…
Nirav Patel
  • 1,304
  • 2
  • 13
  • 30
22
votes
4 answers

Programmatic SchemaExport / SchemaUpdate with Hibernate 5 and Spring 4

With Spring 4 and Hibernate 4, I was able to use Reflection to get the Hibernate Configuration object from the current environment, using this code: @Autowired LocalContainerEntityManagerFactoryBean lcemfb; EntityManagerFactoryImpl emf =…
Benjamin M
  • 23,599
  • 32
  • 121
  • 201
20
votes
2 answers

How to migrate a Hibernate NamingStrategy to (Implicit|Physical)NamingStrategy? Where is the documentation?

The NamingStrategy was already being marked as deprecated in Hibernate 4.2/4.3 (HHH-7079). Starting with Hibernate 5, now it will shipped with two replacements(?) interfaces ImplictNamingStrategy and PhysicalNamingStrategy (HHH-7078) and have…
knalli
  • 1,973
  • 19
  • 31
16
votes
6 answers

java.lang.ClassNotFoundException: org.hibernate.engine.transaction.spi.TransactionContext

I am developing Spring MVC Hibernate Integration example. In this example I'm using Spring 4.1.9.RELEASE and Hibernate 5.1.0.Final. If I downgrade Hibernate version to 4.3.5.Final then it works. Now inorder to use hibernate 5 what else configuration…
user5778069
16
votes
5 answers

Hibernate & Spring: Exception when trying to create a transaction

So I'm trying to use Spring to manage hibernate transactions for the first time, and something's going wrong. I'm not sure what. I've looked at a bunch of similar answers on this site and nothing I've seen seems to be right. So, I'm gonna copy and…
craigmiller160
  • 5,751
  • 9
  • 41
  • 75
16
votes
3 answers

spring4.2.1, hibernate5 integrate abstract method error

I declare spring-framework 4.2.1.BUILD-SNAPSHOT and hibernate 5.0.0.BETA2 in my project, but I get an AbstractMethodError. Here is the stack trace: java.lang.IllegalStateException: Failed to load ApplicationContext at…
martian
  • 519
  • 1
  • 6
  • 16
15
votes
1 answer

How to set Foreign key name in @OneToOne relation with @JoinColumn and @MapsId

In the following example (from Vlad Mihalcea's post on "The best way to map a @OneToOne relationship with JPA and Hibernate"): @Entity(name = "PostDetails") @Table(name = "post_details") public class PostDetails { @Id private Long id; …
nyxz
  • 6,918
  • 9
  • 54
  • 67
1
2 3
24 25