Questions tagged [hibernate-4.x]

Represents the 4.x release of the Hibernate Object/Relational Mapping project

302 questions
6
votes
1 answer

Migrate from Hibernate 4.3.6 to Hibernate 5

I have old project where I use Date from Java API, and I want change this to new Java 8 Date API to LocalDateTime. I read that Hibernate version before 5 does not support the new Java 8 Date API, and I decided to migrate from Hibernate 4.3.6 to 5.…
The Nightmare
  • 701
  • 5
  • 16
  • 36
6
votes
2 answers

Hibernate event listeners for JPA callbacks

How can I enable the Hibernate event listeners, that handle JPA callbacks? Currently I am using using Hibernate 4 with SessionFactory configuration, but JPA callbacks are not running properly, when I persist an object. Any suggestion are most…
dom
  • 1,086
  • 11
  • 24
6
votes
1 answer

Hibernate4 on JBoss EAP 5.1.2 logging error

I'm hoping that maybe someone has run into this problem before and can provide advice. I'm writing an application on Hibernate 4 and Spring 3. Here's my dependency tree: +- javax.servlet:servlet-api:jar:2.5:provided +-…
Jeffrey Poore
  • 195
  • 1
  • 14
6
votes
3 answers

How to configure second level cache in Hibernate 4.1.5 SP1?

I have read other threads on here about this subject but none of the solutions work for me. I tried putting this in my hibernate.cfg.xml: org.hibernate.cache.spi.EntityRegion I always…
MrStack
  • 455
  • 2
  • 7
  • 22
5
votes
1 answer

Hibernate4 & Lobhandler

According to this post i changed my session factory definition from
Hons
  • 3,804
  • 3
  • 32
  • 50
5
votes
3 answers

How do I disable SHOW WARNINGS from Hibernate?

Using Hibernate (4.3.8) with MySQL, I noticed a bunch of SHOW WARNINGS statements taking considerable bandwidth in the activity log: I searched around and it's a pretty common issue (for example) that can apparently be resolved by increasing the…
Jason C
  • 38,729
  • 14
  • 126
  • 182
5
votes
1 answer

Replacement for org.hibernate.Transactions.isActive() in Hibernate 5

I'm migrating from hibernate 4.2.17 to 5.0.7 which works fine so far, but it seems that the method isActive is deprecated. I just can't use it anymore. Here's my code: public void starteTransaktion() { try { getMySession(); …
Pascal Petruch
  • 344
  • 3
  • 16
5
votes
1 answer

Hibernate 4 Wildfly 8 logging not working

How do I get hibernate 4 to log via logback? I have a war deployed to wildfly 8 final, and I am using slf4j with logback. The logging setup is working 100% in the application with both the console appender and file appender working as intended. Here…
Sphynx
  • 492
  • 5
  • 13
5
votes
1 answer

Hibernate does not rollback natively generated ID after Hibernate Exception

I have a method in my Transactional Service which validates an object and saves it. During this save assume that due to garbage data in the "child" object - a DataException is thrown. This being a RuntimeException, Hibernate triggers a rollback.…
blaks
  • 113
  • 3
  • 14
5
votes
1 answer

One Transaction for Hibernate Validation and Spring controller

I am trying to implement the registration controller for a Rest API. I have read about where to place @Transactional quite a bit. (Not at DAO level but at the services maybe orchestrated). In my use case I want not only services but also a hibernate…
5
votes
1 answer

Proplem with @OrderColumn Hibernate 4.1

Hi I am trying to do the same thing as in the documentation http://docs.jboss.org/hibernate/orm/4.1/manual/en-US/html/ch07.html#d5e5275 Why is this happening? //In class Team @ManyToOne @JoinColumn(name = "Heat") public Heat getHeat() { return…
pethel
  • 5,397
  • 12
  • 55
  • 86
5
votes
2 answers

Errors in Stopping tomcat 7 server when Hibernate 4 is used

We have used Hibernate jars in spring application. Data persistence is done by Java Persistence API using EntityManagerFactory being injected via context xml. When we switched to Hibernate 4, the application is not getting stopped when it is…
vegeta
  • 297
  • 1
  • 14
5
votes
1 answer

JPA and Hibernate proxy behavior

i tried to observe JPA2 / Hibernate4 proxy behavior below, // Circular entity with lazy loading: @Entity public class Employee { @Id@Generated int id; String name; @OneToOne(fetch = FetchType.LAZY, cascade = CascadeType.ALL) Employee boss; …
sof
  • 9,113
  • 16
  • 57
  • 83
4
votes
1 answer

Is Hibernate 4 compatible with Java 11?

I have already read on documents saying that Hibernate version 5 is compatible with Java 11. but Is Hibernate ORM version 4 also compatible with Java 11? if not: What changes are required to upgrade?
4
votes
1 answer

NamingStrategy in Hibernate 5 compliant with Hibernate 4

We're currently trying to move our web app from Wildfly 9.0.2 to Wildfly 10.1.0, and so migrating from Hibernate 4.3.10 to 5.0.10. We never defined our own NamingStrategy, using whatever names Hibernate chooses for our Entities (our Postgresql…
Xavier Portebois
  • 3,354
  • 6
  • 33
  • 53
1 2
3
20 21