????Hibernate ????????????ORM?????????????????
?????????????????????????и???????ddl??dml???????
??????????????????database-object ../??+ SchemaExport
????1??hibernate.cfg.xml
<?xml version="1.0" encoding="GBK"?>
<!-- ???Hibernate?????????DTD??? -->
<!DOCTYPE hibernate-configuration PUBLIC
"-//Hibernate/Hibernate Configuration DTD 3.0//EN"
"http://www.hibernate.org/dtd/hibernate-configuration-3.0.dtd">
<!-- hibernate- configuration??????????????????? -->
<hibernate-configuration>
<session-factory>
......
<!-- ?????????????????????????????????????create -->
<property name="hbm2ddl.auto">create</property>
<!-- ???Hibernate???????????????SQL -->
<property name="show_sql">true</property>
<!-- ??SQL??????и??????????? -->
<property name="hibernate.format_sql">true</property>
<!-- ???????е??????? -->
<mapping resource="....../lovejk.hbm.xml"/>
</session-factory>
lt;/hibernate-configuration>
????2??lovejk.hbm.xml
<?xml version="1.0" encoding="gb2312"?>
<!-- ???Hiberante3????????DTD??? -->
<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://www.hibernate.org/dtd/hibernate-mapping-3.0.dtd">
<!-- hibernate-mapping?????????????? -->
<hibernate-mapping>
<!-- ???data-object?????????????? -->
<database-object>
<!-- ???崴?????????????? -->
<create>create table testjk(name varchar(256));</create>
<!-- ??drop?????????????κζ??? -->
<drop></drop>
<!-- ???????MySQL???????Ч -->
<dialect-scope name="org.hibernate.dialect.MySQLDialect"/>
<dialect-scope name="org.hibernate.dialect.MySQLInnoDBDialect"/>
</database-object>
</hibernate-mapping>