Reputation: 21
We are going to upgrade hibernate from 3.1.3 to 4.0. I found most of them are deprecated. Have changed most of the classes/interfaces.But I'm not able to replace the below .Searched in hibernate 4 API,coudn't find.
import org.hibernate.jdbc.AbstractBatcher;
import org.hibernate.jdbc.ConnectionManager;
import org.hibernate.util.JDBCExceptionReporter;
Connection conn = session.connection();
Can someone help me what classes/interfaces to replace in the above stmt's place ?
thanks
Upvotes: 1
Views: 1674
Reputation: 9443
Most of these do not have direct replacements, so will depend on what you are trying to accomplish. Note too the ones moved to spi
and internal
packages; spi
indicates things your application code should not be using; they are meant for integration code or Hibernate use. internal
is stuff not at all supported for application use; it is meant for Hibernate-only internal use.
The concept of a "batcher" has been changed up to instead model a "batch". See org.hibernate.engine.jdbc.batch.spi.Batch
. Note spi
.
ConnectionManager has no real direct replacement.
JDBCExceptionReporter, again has no real direct replacement. Most likely you are looking for org.hibernate.exception.spi.SQLExceptionConverter
, but again depends on what you are trying to accomplish.
session.connection()
is replaced by session.doWork()
using the Connection you are passed.
Some of these are covered in the migration guides. Some are not because they are not really intended for you to use.
Upvotes: 3