I am using spring-boot 1.4.2 for my simple project.When i insert LocalSessionFactoryBean to the database configuration class then it show "The type LocalSessionFactoryBean is deprecated".Is this spring-boot version problem.I'm tried to find that.But i couldn't find clear answer for this.Please help me.
The type LocalSessionFactoryBean is deprecated
2.6k views Asked by Matrix At
3
There are 3 answers
0
On
You have that warning because you imported org.springframework.orm.hibernate3.LocalSessionFactoryBean
into your class.
deprecated warning snapshot
To get rid of the deprecated warning import either
org.springframework.orm.hibernate4.LocalSessionFactoryBean
or org.springframework.orm.hibernate5.LocalSessionFactoryBean
into your class.
deprecated warning gone snapshot
spring-boot-1.4.2.RELEASE will fetch spring-orm-4.3.4.RELEASE.jar if you have
spring-boot-starter-data-jpa
in your pom.xml. If you check spring-orm jar file, it bundlesorg.springframework.orm.hibernate3
,org.springframework.orm.hibernate4
andorg.springframework.orm.hibernate5
packages for hiberante orm. From these packagesorg.springframework.orm.hibernate3.LocalSessionFactoryBean
is deprecated. You can check the details here. For LocalSessionFactoryBean for hibernate4 see here and for hibernate5 see here.