Hibernate3 相关操作

来源:互联网 发布:淘宝身份认证 编辑:程序博客网 时间:2024/05/30 04:29

1.获取映射中的表名及表中的字段名称

         Configuration conf = new Configuration().configure()  Iterator iter =  conf.getTableMappings();
         while(iter.hasNext()) {
            Table t = (Table)iter.next();
            System.out.println(t.getName());
            Iterator it = t.getColumnIterator();
            while(it.hasNext()) {
                Column c = (Column)it.next();
                System.out.println(c.getName());
            }
        }

2.

原创粉丝点击