摘要: org.hibernate.id.IdentifierGenerationException:我的第一个hibernate异常 s 异常信息:org.hibernate.id.IdentifierGenerationException: ids for this class must be manually assigned before calling save(): 异常原因: <id>元素配置不正确, <id>元素缺少其子元素<generator></generator>的配置。 解决方法:<id>元素映射了相应数据库表的主键字 阅读全文
posted @ 2011-05-25 10:57 数据库天地 阅读(162) 评论(0) 推荐(0) 编辑
摘要: hibernate可以通过两种方式配置xml 和 annotation xml 为xx类配置一个xx.hbm.xml文件,放在xx.java相同目录下面 类Student package com.zc.hibernate.model; public class Student {private int id;private String name;private int age;public int getId() {return id;}public void setId(int id) {this.id = id;}public String getName() {return name. 阅读全文
posted @ 2011-05-25 10:38 数据库天地 阅读(415) 评论(0) 推荐(0) 编辑