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

Getting a circular reference to entityManagerFactory when trying to use it in Spring Boot autoconfigured DataJpaTest

I'm migrating an application from Spring Boot 1.5.14.RELEASE to 2.0.4.RELEASE. I'm using Java 8 and Maven 3.5.4 if it matters. Please, see the complete project reproducing the issue…
Dmitry Senkovich
  • 5,521
  • 8
  • 37
  • 74
3
votes
1 answer

Hibernate 5, Oracle12c Identity column - sequence not found

I am facing the following error when trying to insert a Person record to the DB. Caused by: java.sql.SQLSyntaxErrorException: ORA-02201: sequence not allowed here I am wokring with Hibernate 5.2.12.Final, Oracle 12 c database and making use of…
Raghav Sharma
  • 68
  • 1
  • 9
3
votes
1 answer

What is the difference between javax.persistence.criteria and org.hibernate.criterion packages?

Recently my team upgraded from Hibernate 3 to Hibernate 5 so I am working on the migration stuff. Now when I try to use CriteriaQuery class, eclipse shows that it can be imported from both 'javax.persistence.criteria' as well as…
DockYard
  • 989
  • 2
  • 12
  • 29
3
votes
1 answer

Suitable way to interact with Hibernate sessions in multi-thread environment

Context of Multi-Thread environment like web app, whenever required to use sessions using Hibernate what would be the best way to get session either getcurrentsession() or opensession() ? As on here opensession vs getcurrentsession it has mentioned…
GrootC
  • 113
  • 2
  • 10
3
votes
1 answer

Is hibernate session closed by spring?

I have developed a simple app with spring boot and hibernate. I used to get sessions by sessionfactory.opensession(); does it need to close session manually after all the things done? Is it good idea to use opensession() rather than…
asanka12
  • 43
  • 1
  • 7
3
votes
1 answer

Hibernate persists Java 8 DateTimeLocal as VARBINARY in SQL Server

I'm trying to make use of the Java 8 date & time API in a new application which is backed by SQL Server database. All the resources on the Internet state that Hibernate 5.2+ support this API and Java 8 out of the box and suggest a simple approach…
Giovanni
  • 332
  • 3
  • 12
3
votes
1 answer

Hibernate5 - change all VARCHAR(255) to TEXT without mapping field by field?

Is it possible for Hibernate5 to map all Strings to TEXT; without annotating or mapping each field individually? UPDATE I've been doing some research on this and getting very close, but still no obvious path to a solution. Clue #1 from…
Alex R
  • 11,364
  • 15
  • 100
  • 180
3
votes
2 answers

Custom sequence generator for Hibernate 5

I want to create a custom sequence generator in Hibernate 5 to create a sequence per table in Postgresql. Using Hibernate 4 I did the following in my dialect: /** * Get the native identifier generator class. * * @return…
Iván López
  • 944
  • 4
  • 13
3
votes
1 answer

Hibernate 5 implicit-strategy and unique keys

I'm migrating from php/doctrine to java/hibernate. In this case I need that naming strategy in hibernate should be the same as in doctrine. So, I have implemented custom ImplicitNamingStrategy. I'm using fk_XXX, uniq_XXX, idx_XXX as templates for…
3
votes
1 answer

JPA and java 8 date API - choosing correct implementation (Instant, LocalDateTime, ZonedDateTime)

Which of the available java 8 time API classes is most suitable for JPA entity mapping in following case: contract created at type of information the dates are stored in UTC in the database business logic does all calculations in UTC dates are…
JanM
  • 1,385
  • 1
  • 15
  • 25
3
votes
1 answer

java.lang.NoClassDefFoundError: org.springframework.beans.FatalBeanException

I am building a JAX-WS web service in Java 8 and using Spring 4.2.6 and Hibernate 5.1 with it. But when I am deploying my project on tomcat, I am encountering following exception. I have googled the same and none of the stackoverflow post has been…
Steve
  • 889
  • 1
  • 12
  • 26
3
votes
1 answer

Class loading error with Spring Boot and Hibernate 5

I recently upgraded a Spring Boot based application from Hibernate 4 to Hibernate 5. Since then I observe a class loading problem. Obviously, the hibernate classes and my domain class get loaded by two different class loaders. This only happens if I…
3
votes
2 answers

How to configure Grails 3.1.1 to use Hibernate 5

How do I make Grails 3.1.1 user Hibernate 5? The following actions report Hibernate version 4.3.11.Final: In Grails 3.1.1 grails create-app hello311 edit BootStrap.groovy as shown below grails run-app Console shows: Hibernate version is:…
DAC
  • 707
  • 1
  • 6
  • 20
3
votes
1 answer

Hibernate 5 warnings, how to fix these?

The moment I boot up my Hibernate 5 application, I get these warnings like crazy. How would I get rid of them? Here's my configuration file:
codez
  • 1,440
  • 2
  • 19
  • 34
3
votes
3 answers

Hibernate 5: sessionFactory is null

Im getting a null value for sessionFactory variable at this line: sessionFactory = new MetadataSources( registry ).buildMetadata().buildSessionFactory(); This is the whole class: import javax.imageio.spi.ServiceRegistry; import…
tirenweb
  • 30,963
  • 73
  • 183
  • 303