An exception occurs after one-to-multiple bidirectional Association of @ onetovers using spring + hibernate Annotations:
Java. Lang. nosuchmethoderror: javax. Persistence. oneto133. orphanremoval () Z
This exception usually occurs because the Java ee. Jar version of myeclipse is relatively low, and conflicts with the built-in JPA such as hibernate.
Some processing methods on the Internet are to delete the Java ee. jar that comes with the web project when the project is created, but the consequence is that components such as httpservletrequest cannot be used.
Directly create a project with jdk1.6
<Prop key = "javax. Persistence. validation. mode"> none </prop>
<Bean id = "sessionfactory" class = "org. springframework. orm. hibernate4.localsessionfactorybean "> <property name =" datasource "ref =" datasource "/> <property name =" hibernateproperties "> <props> <prop key =" javax. persistence. validation. mode "> none </prop> <prop key =" hibernate. dialect ">$ {hibernate. dialect} </prop> <prop key = "hibernate. show_ SQL ">$ {hibernate. show_ SQL} </prop> <prop key = "hibernate. format ">$ {hibernate. for Mat} </prop> <! -- As long as an empty database DDL is created, the database table can be automatically generated based on the object class --> <prop key = "hibernate. hbm2ddl. auto ">$ {hibernate. hbm2ddl. auto} </prop> </props> </property> <property name = "packagestoscan"> <list> <value> COM. gaozhi. school. **. model </value> <! -- Scan annotation object class, that is, model --> </List> </property> </bean>