首页 > 学院 > 开发设计 > 正文

hibernate设置了not-null 为什么无效?

2019-11-15 00:32:48
字体:
来源:转载
供稿:网友
hibernate设置了not-null 为什么无效?

因为设错地方了!

错误--写在了PRoperty标签里

<property name="passWord" type="string" length="40" not-null="true">      <column name="password" ></column></property>

正确--写在column标签里

<property name="password" type="string" >      <column name="password" length="40" not-null="true"></column></property>

发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表