日期:2014-05-20  浏览次数:20650 次

为什么我在name字段映射里设置了unique="true",可是不起作用?
RT,没报任何错,而且数据库可以插入,就好像这属性不存在一样。。。。。

<hibernate-mapping>

<class name="com.accp.hibernate.UserTwo">
<id name="id">
<generator class="native"/>
</id>
<property name="name" unique="true"/>
<property name="password"/>
<property name="createTime"/>
<property name="expireTime"/>
</class>

</hibernate-mapping>

------解决方案--------------------
http://hi.baidu.com/dingyongli/blog/item/4ab321a4e0bd90f49152eeff.html