Announcement Announcement Module
Collapse
No announcement yet.
HibernateDaoSupport for Hibernate4 Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • HibernateDaoSupport for Hibernate4

    We are converting to Spring 3.1.0.RC1 with Hibernate 4.0.0.CR5.

    We have been using "org.springframework.orm.hibernate3.support.Hibern ateDaoSupport" as a backing for our DAO's.

    Is there a hibernate4 (e.g. org.springframework.orm.hibernate4.support.Hiberna teDaoSupport) version of HibernateDaoSupport coming soon?

    Or is there a hibernate4 replacement for HibernateDaoSupport?

    Currently, the org.springframework.orm.hibernate3.support.Hiberna teDaoSupport version delegates to a org.springframework.orm.hibernate3.SessionFactoryU tils and when calling getHibernateTemplate().loadAll(...class) there is a NoSuchMethodException thrown.

    Here is the stack trace:

    Code:
    java.lang.NoSuchMethodError: org.hibernate.SessionFactory.openSession()Lorg/hibernate/classic/Session;
    	at org.springframework.orm.hibernate3.SessionFactoryUtils.doGetSession(SessionFactoryUtils.java:322)
    	at org.springframework.orm.hibernate3.SessionFactoryUtils.getSession(SessionFactoryUtils.java:233)
    	at org.springframework.orm.hibernate3.HibernateTemplate.getSession(HibernateTemplate.java:457)
    	at org.springframework.orm.hibernate3.HibernateTemplate.doExecute(HibernateTemplate.java:393)
    	at org.springframework.orm.hibernate3.HibernateTemplate.executeWithNativeSession(HibernateTemplate.java:374)
    	at org.springframework.orm.hibernate3.HibernateTemplate.loadAll(HibernateTemplate.java:584)
    	at com.gs.firstdb.base.AbstractFirstdbBaseHibernateDao.getAll(AbstractFirstdbBaseHibernateDao.java:20)
    	at com.gs.firstdb.enumerations.DoseRangeCalculationReqTypeTest.testMedicationStrengthStatusEnum(DoseRangeCalculationReqTypeTest.java:16)
    	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    	at java.lang.reflect.Method.invoke(Method.java:597)
    	at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44)
    	at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
    	at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41)
    	at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20)
    	at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:28)
    	at org.springframework.test.context.junit4.statements.RunBeforeTestMethodCallbacks.evaluate(RunBeforeTestMethodCallbacks.java:74)
    	at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:31)
    	at org.springframework.test.context.junit4.statements.RunAfterTestMethodCallbacks.evaluate(RunAfterTestMethodCallbacks.java:83)
    	at org.junit.rules.TestWatchman$1.evaluate(TestWatchman.java:48)
    	at org.springframework.test.context.junit4.statements.SpringRepeat.evaluate(SpringRepeat.java:72)
    	at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:231)
    	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:49)
    	at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193)
    	at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52)
    	at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191)
    	at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42)
    	at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184)
    	at org.springframework.test.context.junit4.statements.RunBeforeTestClassCallbacks.evaluate(RunBeforeTestClassCallbacks.java:61)
    	at org.springframework.test.context.junit4.statements.RunAfterTestClassCallbacks.evaluate(RunAfterTestClassCallbacks.java:71)
    	at org.junit.runners.ParentRunner.run(ParentRunner.java:236)
    	at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.run(SpringJUnit4ClassRunner.java:174)
    	at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:49)
    	at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
    	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
    	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
    	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
    	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)

  • #2
    Basically a duplicate of this thread. Please don't ask the same question twice and/or don't crosspost. For the answer see that thread.

    Comment


    • #3
      goodbye HibernateTemplate in spring 3.1.0.RC1?

      Release information here indicates they are doing away with

      Eliminate HibernateTemplate and friends (e.g. HibernateCallback in favor of Spring's more modern 'Native Hibernate DAO' approach which has been used to good effect for quite a while.

      Comment

      Working...
      X