运用annotation来进行配置也一定要有xml

使用annotation来进行配置也一定要有xml
hibernate.cfg.xml似乎是阴魂不散,无论如何都要搞一个,如果是全编程配置,也要有一个,可以是最省的:

<?xml version='1.0' encoding='utf-8'?>
<!DOCTYPE hibernate-configuration PUBLIC
    "-//Hibernate/Hibernate Configuration DTD//EN"
    "http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
<hibernate-configuration>
<session-factory>
</session-factory>
</hibernate-configuration>