???????????????2?????????μ??????????????3???????????????????????????????????????????????????????????????????????ε?????????Щ????

????????????????????????в??????????????????????????д?ò?????????????????????????????????????ɡ????????Ц????3????????????????????????????????????????????Щ????

??????????????????????????MySQL??

????????????????仯?????

?????????????????????????????

?????????????????????ο?????????仹?????????????

???????????????

????……

??????Щ???????????????????????????????“??????????ī?????”?????????????????????????????????????????

????????????????????μ?????????????????Spring + Spring Data + Hibernate + MySQL?????????????????????????????????????????????Maven??????

????????????????????MySQL

???????????HSQLDB?????????к?????????ο???HSQLDB????????????????????????????????Spring???<jdbc??embedded-database>?????????????????????????applicationContext-test.xml?ж??????????????????

<jdbc:embedded-database id="dataSource" type="HSQL"/>

????HSQL????????????pom.xml??jar????????????????

<dependency>
<groupId>org.hsqldb</groupId>
<artifactId>hsqldb</artifactId>
<version>2.2.8</version>
<scope>test</scope>
</dependency>

???????????????????

???????????????????У??????flyway??????????仯?????Spring????<jdbc??initialize-database>???????SQL????????????????????????????flyway?????????????????????????????flyway?????????SQL??????????flyway?????ο???ruby??db migration???????????????????汾????????е???????????????????е?????????????????β???б?????flyway????????????SQL???????????????????????????????Hibernate??DDL??????????????????????

 <!-- Jpa Entity Manager ???? -->
 <bean id="entityManagerFactory"
  class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean">
  <property name="dataSource" ref="dataSource" />
  <property name="jpaVendorAdapter" ref="hibernateJpaVendorAdapter"></property>
  <property name="packagesToScan" value="com.noyaxe.myapp" />
  <property name="jpaProperties">
   <props>
    <!-- ???????? My_NAME->MyName -->
    <prop key="hibernate.ejb.naming_strategy">org.hibernate.cfg.ImprovedNamingStrategy</prop>
    <prop key="hibernate.show.sql">true</prop>
                                <prop key="hibernate.hbm2ddl.auto">update</prop>
   </props>
  </property>
 </bean>

???????????Hibernate??DDL?????????????????1. ?????????????????????????????????????δ????2. ??β?????????DDL??仯??

????????????