Questions tagged [hibernate3]

Hibernate ORM (Hibernate in short) is an open source object-relational mapping library for the Java language, providing a framework for mapping an object-oriented domain model to a traditional relational database.

135 questions
268
votes
14 answers

How do you do a limit query in JPQL or HQL?

In Hibernate 3, is there a way to do the equivalent of the following MySQL limit in HQL? select * from a_table order by a_table_column desc limit 0, 20; I don't want to use setMaxResults if possible. This definitely was possible in the older…
stevedbrown
  • 8,862
  • 8
  • 43
  • 58
16
votes
3 answers

high performance hibernate insert

I am working on a latency sensitive part of an application, basically i will receive a network event transform the data and then insert all the data into the DB. After profiling i see that basically all my time is spent trying to save the data. …
luke
  • 14,518
  • 4
  • 46
  • 57
13
votes
7 answers

JDBC Driver class not found: com.mysql.jdbc.Driver

I am developing a web application using maven spring and hibernate and I need to create schema using hibernate for which I had the following in my pom.xml to connect to MySQL 5.5 database.
skip
  • 12,193
  • 32
  • 113
  • 153
12
votes
4 answers

When to use transactions in Spring with Hibernate?

Upgrading my project I'm thinking here about transactions. Well, the thing is I'm not quite sure when should I use the transactions for my Hibernate queries in Spring. Not that I completely don't understand what transactions are, I guess I do,…
Rihards
  • 10,241
  • 14
  • 58
  • 78
12
votes
3 answers

Execute @PostLoad _after_ eagerly fetching?

Using JPA2/Hibernate, I've created an entity A that has a uni-directional mapping to an entity X (see below). Inside A, I also have a transient member "t" that I am trying to calculate using a @PostLoad method. The calculation requires access to the…
Alexandros
  • 2,097
  • 20
  • 27
12
votes
1 answer

NoCacheProvider class alternative in Hibernate 4

I've just realized that there is no org.hibernate.cache.internal.NoCacheProvider class in Hibernate 4 Core packages. Maybe it is deprecated. So is there any alternive for Hibernate 4? Thank you in advance!
sidlejinks
  • 709
  • 1
  • 9
  • 25
10
votes
5 answers

How to solve hibernate error: Repeated column in mapping for entity?

HI, I have the following model: @Entity class Flight{ private Airport airportFrom; private Airport airportTo; @OneToOne(fetch=FetchType.LAZY,optional=false) public Airport getAirportFrom(){ return this.airportFrom; } …
Neuquino
  • 11,580
  • 20
  • 62
  • 76
8
votes
2 answers

Where is the "Reverse Engineering" feature in Hibernate5?

I'm upgrading an old project from hibernate3 to hibernate5. The project has a dependency on hbm2java (the so-called reverse engineering tool). In the old project this was executed with mvn hibernate3:hbm2java. Unfortunately, hbm2java is nowhere to…
Alex R
  • 11,364
  • 15
  • 100
  • 180
7
votes
4 answers

Upgrade Glassfish v2 to JPA 2.0?

I'm trying to use Hibernate 3.5.5 with Spring HibernateJpaVendorAdapter on Glassfish V2 but I'm getting the following exception when the Spring context is initialised: java.lang.NoSuchMethodError:…
Jay Shark
  • 635
  • 1
  • 11
  • 21
5
votes
1 answer

Hibernate3 with Oracle 12c

We are upgrading oracle from 11g to 12c. My application is using hibernate3.jar which is 3.6.8-Final version. It works great with 11g using Oracle10gDialect but when I connect to 12c database I get below error. I also changed classes12.jar to…
5
votes
5 answers

hibernate3-maven-plugin dependencies for newer version of hibernate

I would like to use hibernate-3.5-1.Final along with this plugin, what should be my dependencies here. It seems to be picking up a older set of jars and failing right now. org.codehaus.mojo
Sam
  • 8,387
  • 19
  • 62
  • 97
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
4
votes
4 answers

Hibernate: org.hibernate.AssertionFailure: null id in com.xxx.Bean entry

I was faced to the following error: com.google.gwt.user.server.rpc.UnexpectedException: Service method 'public abstract void com.xxx.Service.save(com.xxx.Bean)' threw an unexpected exception: org.hibernate.AssertionFailure: null id in com.xxx.Bean…
Anthony
  • 12,407
  • 12
  • 64
  • 88
4
votes
1 answer

non-english character displaylike this?

In my project, I am storing the non-English character in database. I successfully stored the non-English character but when I try to retrive that value, I am getting the string like below: How to convert this? Into character? Below is my…
Selva
  • 1,620
  • 3
  • 33
  • 63
4
votes
1 answer

Migrating form Hibernate3 to Hibernate4 keep getting nested transactions not supported

A week before we migrated the application from hibernate3 to hibernate4 every thing worked fine in hibernate3 but after migrating to hibernate4. I keep getting nested transactions not supported. Below is my service layer which is calling the…
1
2 3
8 9