hibernate save和update方法不起作用
<hibernate-mapping>
<class name="test1.Admin" table="admin" schema="dbo" catalog="Wonline">
<id name="adminId" type="string">
<column name="adminId" length="32" />
<generator class="uuid.hex" />
</id>
<property name="passWord" type="string">
<column name="passWord" length="32" not-null="true" />
</property>
<property name="headAdmin" type="string">
<column name="headAdmin" length="1" />
</property>
<property name="tcAdmin" type="string">
<column name="tcAdmin" length="1" />
</property>
<property name="subjectAdmin" type="string">
<column name="subjectAdmin" length="1" />
</property>
<property name="studentAdmin" type="string">
<column name="studentAdmin" length="1" />
</property>
</class>
</hibernate-mapping>
public static void main(String[] args) {
// TODO 自动生成方法存根
Admin admin= new Admin();
//admin.setAdminId("123");
admin.setPassWord("33");
...
HibernateSessionFactory.currentSession().save(aa);
HibernateSessionFactory.currentSession().close();
}
本人初学hibernate 做了个实验就失败了 admin类和映射文件都是myeclipse生成的
运行后不报错也不能保存 我还试过可以正常使用load方法 咋回事呢?