看看newxy技术有什么不样,http://www.newxy.net

解决方案 »

  1.   


    org.hibernate.cfg.Configuration 中获取.getClassMapping("org.hibernate.test.extendshbm.Employee").getTable().getName();下面是别人写的一个改表名的方法:
    public static void renameTable(Class cls,String tableName) throws HibernateException{
      Table table = cfg.getClassMapping(cls).getTable();
      
      if(!table.getName().equals(tableName)){
       table.setName(tableName);
       cfg.getClassMapping(cls).setTable(table);
       sessions = cfg.buildSessionFactory();
      }
     }