Hibernate 3中如何获得库表所有字段的名称
2016-02-20 14:49
337 查看
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());
}
}
答:可以使用以下的程序获得。
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());
}
}
相关文章推荐
- VisualRust + VisualGDB编辑调试Rust
- 猜数字游戏
- 十六进制的字符串与二进制字符串相互转换
- jquery 对象dom 对象互转
- example of Makefile to compile a c source file
- eclipse下的spring环境配置
- 经典SQL语句大全
- 【杭电oj】1875 - 畅通工程再续(克鲁斯塔尔)
- 收入成本预算_直营
- bsoj 2044 【SCOI2007】最大土地面积
- 【Lintcode】Median of two Sorted Arrays
- 选择本地图片上传到服务器进行头像设置以及文件下载
- 通用刷新数据源代码
- The 5th Zhejiang Provincial Collegiate Programming Contest------ProblemK:Kinds of Fuwas
- 如何在 Go 语言中使用 Redis 连接池-Radix.v2
- 【C语言】文件常用读写操作(含读取学生信息示例)
- [UVA1368]DNA Consensus String
- Educational Codeforces Round 8
- 10、Maven插件源码的下载方法
- ACM解题总结——HihoCoder1153