Exception in thread "main" org.hibernate.MappingException: Unknown entity: domain.UserBean
hibernate.cfg.xml中没有写<mapping resource ="包名.User.hbm.xml">
因为只会加载cfg.xml,不会自动去加载hbm.xml,所以要在cfg.xml中写出<mapping>
Exception in thread "main" org.hibernate.MappingException: Unknown entity: domain.UserBean
hibernate.cfg.xml中没有写<mapping resource ="包名.User.hbm.xml">
因为只会加载cfg.xml,不会自动去加载hbm.xml,所以要在cfg.xml中写出<mapping>