<one-to-one name="iUser" constrained="true"></one-to-one> 的含义
2013-09-27 09:17
483 查看
<one-to-one name="iUser" constrained="true"></one-to-one>
就是 这个类的 主键参考了 IUser类,这里iuser实施外键。例如,icard 完全参考了 iuser,作为外键和主键。constrained是约束
就是 这个类的 主键参考了 IUser类,这里iuser实施外键。例如,icard 完全参考了 iuser,作为外键和主键。constrained是约束
<?xml version="1.0"?> <!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd"> <hibernate-mapping package="com.sm.hibernate.pojo"> <class name="ICard" table="icard"> <id name="id"> <generator class="foreign"> <param name="property">iUser</param> </generator> </id> <property name="name" not-null ="true"></property> <one-to-one name="iUser" constrained="true"></one-to-one> </class> </hibernate-mapping>
相关文章推荐
- Hibernate逍遥游记-第13章 映射实体关联关系-001用外键映射一对一(<many-to-one unique="true">、<one-to-one>)
- Hibernate逍遥游记-第13章 映射实体关联关系-002用主键映射一对一(<one-to-one constrained="true">、<generator class="foreign">)
- 添加 <identity impersonate="true" userName="username" password="password"/>,解决问题!
- <item name="android:windowNoTitle">true</item> 不起作用。标题栏未被隐藏
- 添加 <identity impersonate="true" userName="username" password="password"/>,解决问题!
- <meta name="viewport" content="initial-scale=1.0, user-scalable=no, width=device-width">
- Hibernate逍遥游记-第5章映射一对多-01单向<many-to-one>、cascade="save-update"、lazy、TransientObjectException
- 转载:老问题再次发生 “从客户端(userName="<hr />")中检测到有潜在危险的 Request.Form 值” 解决方案
- <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=0, minimum-scale=1.0, maximum-scale=1.0" />
- 表单按回车自动提交 1、当form表单中只有一个<input type="text" name='name' />时按回车键将会自动将表单提交。 <form id='form1' action='a
- Jquery对<s:radio list="#{1:'是',0:'否'}" name=""></s:radio>清空设置
- meta name的含义:<META http-equiv=Content-Type content="text/html; charset=gb2312">
- 日常问题记录--JSP页面中通过<s:property value="#parameters.userName[0]>获取URL参数中文时为乱码的解决办法
- HTML 中标签 <meta name="robots" content=""> 的含义
- hibernate中hbm.xml<many-to-one><one-to-many>中一些属性详解
- Visual Studio使用"go to definition"出现"A definition for the symbol '<symbolName>' could not be located
- 020 <one-to-one>、<many-to-one>单端关联上的lazy(懒加载)属性
- <property name="hbm2ddl.auto"></property> 里面值的含义
- struts.xml中为什么加上<constant name="struts.devMode" value="true" />就出错
- <constant name="struts.devMode" value="true"/> 启动tomcat报错。