Configuration conf= new Configuration().addClass(User.class)
//生成并输出sql到文件(当前目录)和数据库
SchemaExport dbExport=new SchemaExport(conf)
dbExport.create(true, true)
}
hibernate生成表时,有的表可以生成,有的却不可以。原因:不能生成的表中有字段“desc”或“descripe”等和hibernate关键字冲突的字段,因此不能生成,只要换个字段名就好了。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)