Hibernate 3中如何获得库表所有字段的名称

15问:Hibernate 3中如何获得库表所有字段的名称

答:可以使用以下的程序获得。

Configuration conf = new Configuration();

                     conf.configure();

                     Iterator iter =  conf.getTableMappings();

                

                     while ( iter.hasNext() ) {

                                 Table table = ( Table ) iter.next();

                       

                                 System.out.println(table.getName());

                                 Iterator ics = table.getColumnIterator();

                                 while (ics.hasNext()){

                                            Column col = (Column) ics.next();

                                            System.out.println(col.getName());

                                 }

                    }

原文地址:https://www.cnblogs.com/duyinqiang/p/5203275.html