* returnsessionfactory
*
*/
publicstatic org.hibernate.SessionFactory getSessionFactory() {
returnsessionFactory;
}
/**
* returnsessionfactory
*
* sessionfactorywillberebuildedinthenextcall
*/
publicstaticvoid setConfigFile(String configFile) {
HibernateSessionFactory.configFile = configFile;
sessionFactory = null;
}
/**
* returnhibernateconfiguration
*
*/
publicstatic Configuration getConfiguration() {
returnconfiguration;
}
}
(2)User.hbm.xml
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<!--
Mapping file autogenerated by MyEclipse Persistence Tools
-->
<hibernate-mapping>