xml file is actualy like the following format:
<!DOCTYPE hibernate-mapping
PUBLIC "-//hibernate/hibernate mapping dtd 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
in the hibernate configuration file hibernate.cfg.xml, when writing the mapping files the format should be: <mapping resource="home/stronger/hibernate/**.hbm.xml"/> see, the path is actually seperated by '/', it's not the format of class path
hbm2ddl tool: in org.hibernate.tool.hbm2ddl package, there is class: SchemaExport, this class get the hibernate configuration and use the method create to create sql script and create the table in database, according to the mapping resource set. Ex:
Configuration config = new Configuration().configure();
SchemaExport schema = new SchemaExport(config);
schema.create(true,true);
//schema.create(boolean sqlScript, boolean exportScript)
//sqlScript: create sql script and show it in the console
//export script: export the sql script to database and execute