`

many-to-one避免出现No row with the given identifier exists的配置方法

阅读更多

如下:

表Space的Space.hbm.xml文件中关联了创建者的对象builder,这时在many-ton-one中设置fetch="join"和not-null="true",这时产生的sql语句就变成了内联查询inner join而不是左外联查询,这样就可以避免在查询中遇到关联的对象为null的情况了(比如关联的用户已经被删除,但是Space的数据没有删除掉)

 <many-to-one name="builder" column="userId"
            class="org.dengzh.vo.Users" lazy="false" insert="false"
            update="false" fetch="join" not-null="true">
 </many-to-one>

分享到:
评论

相关推荐

    no resource

    很抱歉,但根据提供的信息,标题"no resource"和描述"fe ge 2007 programe"没有明确指出任何具体的IT知识点。标签同样显示为"no resource",也没有提供额外的线索。压缩包子文件的文件名称列表包括:飞鸽传书升级...

    计算机网络第六版答案

    14. If the two ISPs do not peer with each other, then when they send traffic to each other they have to send the traffic through a provider ISP (intermediary), to which they have to pay for carrying ...

    微软内部资料-SQL性能优化5

    If there is no clustered index, there is a sysindexes row for the table with an indid value of 0, and that row will keep track of the address of the first IAM for the table. The IAM is a giant bitmap...

    servlet2.4doc

    Returns the value of the named attribute as an Object, or null if no attribute of the given name exists. getAttribute(String) - Method in interface javax.servlet.http.HttpSession Returns the object ...

    C++出错提示英汉对照表

    Call to function with no prototype ---------------调用函数时没有函数的说明 Cannot modify a const object ---------------不允许修改常量对象 Case outside of switch ----------------漏掉了case 语句 Case...

    Hibernate Reference Documentation3.1

    7.4.1. one to many / many to one 7.4.2. one to one 7.5. Bidirectional associations with join tables 7.5.1. one to many / many to one 7.5.2. one to one 7.5.3. many to many 7.6. More complex association...

    FlexGraphics_V_1.79_D4-XE10.2_Downloadly.ir

    - FIX: After deleting the selected points in the TFlexPanel.DeleteSelectedPoints the all figures with one point also deleted. - FIX: When the curve contain more then one figure and they were all ...

    Keil MDK 编译 ucOS-II 出现的警告和错误解决

    在编译过程中,可能会出现错误 L6238E:os_cpu_a.o(subr) contains invalid call from '~PRES8 (The user did not require code to preserve 8-byte aligment of 8-byte data objects)' function to 'REQ8 (Codewas ...

    微软内部资料-SQL性能优化3

    if one transaction (T1) holds an exclusive lock at the table level, and another transaction (T2) holds an exclusive lock at the row level, each of the transactions believe they have exclusive access ...

    apktool_AndResGuard:修复apktool打包出现No resource found...

    No resource found that matches the given name..... ....... 使用apktool-2.0.3也可以回编译,但是比如微信回编译后会增加到110M左右,很不友好。 而使用apktool-2.3.2和原包大小一样,65M左右。 基于apktool

    VclZip pro v3.10.1

    Modified the SFX code (the code used to create the SFX stub distributed with VCLZip) so that it handles filenames that have been run through an OEM Conversion. The SFX was losing accented characters. ...

    精心整理的ssh2 一些错误问题的记录(推荐)

    ### 错误七:No row with the given identifier exists 这意味着根据提供的标识符查询数据库时,没有找到任何行。检查SQL查询和标识符是否正确,以及数据库中是否存在预期的数据。 ### 错误八:No result defined ...

    [Go语言入门(含源码)] The Way to Go (with source code)

    The Way to Go,: A Thorough Introduction to the Go Programming Language 英文书籍,已Cross the wall,从Google获得书中源代码,分享一下。喜欢请购买正版。 目录如下: Contents Preface......................

    常见hibernate面试题

    - 一对多(one-to-many):通过配置`&lt;set&gt;`或`&lt;list&gt;`标签来实现。 - 多对一(many-to-one):使用`&lt;many-to-one&gt;`标签映射。 - 多对多(many-to-many):通过中间表进行映射,使用`&lt;many-to-many&gt;`标签。 7. **...

    PEiD0.95.zip

    2. Detection rates are amongst the best given by any other identifier. 3. Special scanning modes for *advanced* detections of modified and unknown files. 4. Shell integration, Command line support, ...

    PC-IDENTIFIER-09.03.03.00-01.04.00.03安装包-链接地址.txt

    标题和描述中提到的"PC-IDENTIFIER-**.**.**.**-**.**.**.**安装包-链接地址.txt"和"PC_IDENTIFIER_**.**.**.**_**.**.**.**安装包_链接地址"是文件的名称和描述,它们所指的知识点是关于一个特定版本的软件或插件的...

    NewSID(光学习一下代码就可以了,没看清楚介绍别运行)

    Introduction Many organizations use disk image cloning to perform mass rollouts of Windows. This technique involves copying the disks of a fully installed and configured Windows computer onto the disk...

    HAPEiD_jb51

    2. Detection rates are amongst the best given by any other identifier. 3. Special scanning modes for *advanced* detections of modified and unknown files. 4. Shell integration, Command line support, ...

    HA.PEiD.0.95

    2. Detection rates are amongst the best given by any other identifier. 3. Special scanning modes for *advanced* detections of modified and unknown files. 4. Shell integration, Command line support, ...

Global site tag (gtag.js) - Google Analytics