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
15
votes
3 answers

SpringBoot 1.3.0 support hibernate 5?

I'm a little confused about SpringBoot's (1.3.0) support of Hibernate5. The reference lists a dependency on hibernate 4.3.11.Final but it also lists a dependency on SpringFramework 4.2.3 which includes Hibernate5 support. Is it just a matter of…
John Cartwright
  • 599
  • 8
  • 23
15
votes
2 answers

How to configure Hibernate 5 with Spring 4

I wanted to upgrade to Hibernate 5 but I can't get it to work for some weird reason. My spring context configuration with Hibernate 4 looks like this: ....
Tranquilized
  • 721
  • 2
  • 6
  • 23
15
votes
8 answers

Hibernate gives a strange ClassCast exception (using Transformers)

This code: @Override public List getAllFactsWithoutParentsAsFactDto() { String completeQuery = FactCodeQueries.SELECT_DTO_FROM_FACT_WITH_NO_PARENTS; Query query = createHibernateQueryForUnmappedTypeFactDto(completeQuery); …
SanThee
  • 2,301
  • 3
  • 23
  • 35
14
votes
2 answers

How to stop LocalDate from changing when being saved to a mySQL database

When saving a LocalDate field (e.g. '2017-09-27') to a mySQL Date column using JPA CriteriaBuilder API, the result is different (e.g. '2017-09-26'). I have validated that my database's timezone is set to UTC using SELECT TIMEDIFF(NOW(),…
Phobos
  • 1,568
  • 10
  • 18
14
votes
2 answers

Spring Boot Hibernate 5 Ignoring @Table and @Column

This is driving me mad. I'm implementing Spring Social and it requires you to have a database table named UserConnection (instead of using the standard naming convention of using an underscore to separate the two words). So in my naive world view, I…
Trevor
  • 1,137
  • 1
  • 19
  • 33
14
votes
1 answer

hibernate 5 + ZonedDateTime + postgresql include time zone and the offset

I have a running app spring boot 1.3 + hibernate 5 + java 8 + ZonedDateTime + postgresql and in one of the tables I have the following fields. @Column(name = "DATE_ENABLED") @Type(type="java.time.ZonedDateTime") private ZonedDateTime…
Tito
  • 2,234
  • 6
  • 31
  • 65
14
votes
6 answers

Hibernate 5 :- org.hibernate.MappingException: Unknown entity

I am getting the error message org.hibernate.MappingException: Unknown entity when i am trying to integrate hibernate 5.0 with mysql This seems to be an issue with hibernate5.0.0 and 5.0.1 . This works fine with hibernate 4.3.9 Maven…
Mamta Garg
  • 141
  • 1
  • 1
  • 6
12
votes
1 answer

What is the most suitable hibernate.dialect for postgresql 10.5?

I am looking at hibernate documentation here: https://docs.jboss.org/hibernate/orm/5.0/javadocs/org/hibernate/dialect/package-summary.html to try to find which hibernate.dialect to use inside persistence.xml It does not mention a class for Postgres…
Leon
  • 408
  • 1
  • 6
  • 17
11
votes
3 answers

Replacing SchemaExport(Configuration) in Hibernate 5

While migrating from Hibernate 4 to 5 I came across the deprecation and eventual removal of the SchemaExport(Configuration) constructor. What is a good alternative in Hibernate 5? Use case During testing we create a SchemaExport instance with a…
Nicolai Parlog
  • 47,972
  • 24
  • 125
  • 255
11
votes
1 answer

Why is hibernate-java8 (hibernate 5.x) jar shown deprecated?

Hibernate 5 and above supports Java8 DateTime Api through jar "hibernate-java8".But the MavenRepository shows a message Deprecated - use hibernate-core instead) alongside the title of the hibernate-java8 jar.Why is the hibernate-java8 jar called…
Akash Raveendran
  • 559
  • 1
  • 9
  • 22
11
votes
1 answer

Weblogic 12.2.1 + Java 8 + Spring Data JPA + Hibernate 5.x Deployment conflict

I am trying to deploy an EAR file using WebLogic 12.2.1 with Hibernate 5.x and Spring-data-jpa 1.9.4. The same configuration deployed fine on Weblogic 12.1.3. JPA 2.1 is used on both of them. Weblogic is throwing a ClassNotFoundException and looking…
10
votes
1 answer

hibernate 5 sequencegenerator not giving the right value

After migrating to Hibernate 5.2.7, I seem to be getting incorrect values for the id field. My code: @Id @SearchableId @GeneratedValue(strategy=GenerationType.AUTO, generator="hms_seq_gen") @SequenceGenerator(name="hms_seq_gen",…
Thomas Abraham
  • 105
  • 1
  • 1
  • 7
10
votes
2 answers

Java 8 + Hibernate 5 MySQL TIMESTAMP/DATETIME to LocalDateTime Mapping

Decided to update to Hibernate 5 to remove the existing Date to LocalDateTime conversion. I installed hibernate-java8 artifact from Maven. Then I replaced my hibernate entity date time to @Column (name = "mis_a_jour_au", nullable = false) @Temporal…
Ryan Yuen
  • 111
  • 1
  • 7
10
votes
1 answer

Hibernate Criteria query lists tables in wrong order in generated SQL

I have a Criteria query using several joins, and the generated SQL lists the tables out of order so that an ON clause refers to a table that hasn't been declared yet. To reproduce the problem, I created a small data model with three tables: Bill,…
Sam
  • 1,260
  • 2
  • 11
  • 32
10
votes
2 answers

JPA with Hibernate 5: programmatically create EntityManagerFactory

This question is specifically about programmatically creating a JPA EntityManagerFactory backed by Hibernate 5, meaning without configuration xml files and without using Spring. Also, this question is specifically about creating an…
Mike Nakis
  • 56,297
  • 11
  • 110
  • 142
1
2
3
24 25