When using spring to integrate hibernate, the code is as follows:
< Propertyname= "DataSource"ref= "DataSource" /> <!--Configure properties for Hibernate - < Propertyname= "Hibernateproperties"> <Props> <propKey= "Hibernate.dialect">Org.hibernate.dialect.MySQLInnoDBDialect</prop> <!--Showsql - <propKey= "Hibernate.show_sql">True</prop> <!--Formatting SQL code - <propKey= "Hibernate.format_sql">True</prop> <!--Update table Structure - <propKey= "Hbm2ddl.auto">Update</prop> </Props> </ Property>
The "Hbm2ddl.auto" entry is not recognized in the spring configuration file, so the configuration does not work, using "Hibernate.hbm2ddl.auto".
<!--Configure properties for Hibernate - < Propertyname= "Hibernateproperties"> <Props> <propKey= "Hibernate.dialect">Org.hibernate.dialect.MySQLInnoDBDialect</prop> <!--Showsql - <propKey= "Hibernate.show_sql">True</prop> <!--Formatting SQL code - <propKey= "Hibernate.format_sql">True</prop> <!--Update table Structure - <propKey= "Hibernate.hbm2ddl.auto">Update</prop> </Props> </ Property>
Hibernate prefixes are optional, but it's best to add hibernate prefixes during integration! Reduce unnecessary time to waste on configuration files!
Cannot automatically build tables when spring and hibernate are integrated