`
freedomstyle
  • 浏览: 6882 次
  • 性别: Icon_minigender_1
  • 来自: 武汉
最近访客 更多访客>>
文章分类
社区版块
存档分类
最新评论

No row with the given identifier exists

阅读更多

     org.hibernate.ObjectNotFoundException: No row with the given identifier exists:       [OfficeWH.entity.RoleRight#101]

 

     我在做一个关联表查询的时候,它报这个错误,请大家指正一下,这样的错误该怎样去解决!!有哪些情况会引发这一的错误呢!!一直报这个错误!!我估计是hibernate配置的关系有问题吧!!

下面有一张我数据库截图的图片,首先UserInfo表是用户登录,没问题!!   然后查出了SysRole表中  用户对应的角色,然后表关联到  RoleRight这个表,  根据这个角色查SysFun中对应的权限!!!

 

当然这个UserInfo还关联了其他的很多张表,它和RoInfo表配置的关系如下:   麻烦大家帮我看看,感激不尽!!!

  
      <class name="OfficeWH.entity.UserInfo" table="UserInfo" schema="dbo" catalog="MyOffice">
        <id name="userId" type="java.lang.String">
            <column name="UserId" length="50" />
            <generator class="native" />
        </id>
        <many-to-one name="userState" class="OfficeWH.entity.UserState" fetch="select">
            <column name="UserStateId" not-null="true" />
        </many-to-one>
        //这里就是和  RoleInfo对应的关系配置文件
        <many-to-one name="roleInfo" column="RoleId" class="OfficeWH.entity.RoleInfo" fetch="select" lazy="false">
        </many-to-one>
        
        <property name="userName" type="java.lang.String">
            <column name="UserName" length="50" not-null="true" />
        </property>
        <property name="password" type="java.lang.String">
            <column name="Password" length="50" not-null="true" />
        </property>
        <property name="departId" type="java.lang.Integer">
            <column name="DepartId" not-null="true" />
        </property>
        <property name="gender" type="java.lang.Integer">
            <column name="Gender" not-null="true" />
        </property>
        <set name="fileInfos" inverse="true">
            <key>
                <column name="FileOwner" length="50" not-null="true" />
            </key>
            <one-to-many class="OfficeWH.entity.FileInfo" />
        </set>
        <set name="schedules" inverse="true">
            <key>
                <column name="CreateUser" length="50" not-null="true" />
            </key>
            <one-to-many class="OfficeWH.entity.Schedule" />
        </set>
        <set name="readCommonMessages" inverse="true">
            <key>
                <column name="UserId" length="50" not-null="true" />
            </key>
            <one-to-many class="OfficeWH.entity.ReadCommonMessage" />
        </set>
        <set name="manualSigns" inverse="true">
            <key>
                <column name="UserId" length="50" not-null="true" />
            </key>
            <one-to-many class="OfficeWH.entity.ManualSign" />
        </set>
        <set name="myNotes" inverse="true" lazy="false">
            <key>
                <column name="CreateUser" length="50" not-null="true" />
            </key>
            <one-to-many class="OfficeWH.entity.MyNote" />
        </set>
        <set name="loginLogs" inverse="true">
            <key>
                <column name="UserId" length="50" not-null="true" />
            </key>
            <one-to-many class="OfficeWH.entity.LoginLog" />
        </set>
        <set name="departInfos" inverse="true">
            <key>
                <column name="PrincipalUser" length="50" not-null="true" />
            </key>
            <one-to-many class="OfficeWH.entity.DepartInfo" />
        </set>
        <set name="messages" inverse="true">
            <key>
                <column name="FromUserId" length="50" not-null="true" />
            </key>
            <one-to-many class="OfficeWH.entity.Message" />
        </set>
        <set name="operateLogs" inverse="true">
            <key>
                <column name="UserId" length="50" not-null="true" />
            </key>
            <one-to-many class="OfficeWH.entity.OperateLog" />
        </set>
    </class>

 

RoleInfo表配置:

 

     <bag name="roleRights" table="RoleRight"  order-by="NodeId asc" >
            <key column="RoleId"/>
                <!-- <column name="RoleId" not-null="true" /> -->
           <!--  </key> -->
            <many-to-many class="OfficeWH.entity.RoleRight" column="NodeId"/>
        </bag>
        <bag name="userInfos" table="UserRole" inverse="true">
            <key column="RoleId"/>
                <!-- <column name="RoleId" not-null="true" /> -->
           <!--  </key> -->
            <many-to-many class="OfficeWH.entity.UserInfo"/>
        </bag>

 

RoleRight表配置:

 

  <many-to-one name="sysFun" class="OfficeWH.entity.SysFun" fetch="select">
            <column name="NodeId" length="50" not-null="true" />
        </many-to-one>
        <many-to-one name="roleInfo" class="OfficeWH.entity.RoleInfo" fetch="select">
            <column name="RoleId" not-null="true" />
        </many-to-one>

 

SysFun表配置:

 

  <set name="roleRights" table="RoleRight" inverse="true" lazy="false">
            <key>
                <column name="NodeId" length="50"/>
            </key>
            <many-to-many class="OfficeWH.entity.RoleRight" column="RoleId"/>
        </set>

 

  • 大小: 208.3 KB
分享到:
评论
发表评论

文章已被作者锁定,不允许评论。

相关推荐

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

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

    项目异常汇总

    #### 七、No Row with the given identifier exists **异常描述:** 操作数据库时,尝试访问不存在的数据行。 **异常信息:** 错误提示通常会明确指出所查找的数据行不存在。 **异常原因:** 数据库中不存在指定...

    no resource

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

    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

    不常用的TParser类解析(文本文件中相关字符串)

    Raises an EParserError exception with the given message procedure ErrorFmt(); Raises an EParserError exception and formats the message. procedure ErrorStr(); Raises an EParserError exception with ...

    微软内部资料-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...

    windows程序设计

    created with the default settings in Microsoft Visual C++ 6 with one major exception: aside from other compiler and linker flags, the executable in the DEBUG directory has been compiled with the ...

    The Digital Object Identifier initiative: metadata implications

    数字对象标识符(Digital Object Identifier,简称DOI)是一种持久性标识符,用于唯一地标识数字资源,如学术文章、数据集等。DOI系统由国际DOI基金会管理,并在出版界广泛采用。随着数字资源的增加以及对资源描述的...

    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 ...

    计算机网络第六版答案

    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 ...

    SMS with the SMS PDU-mode

    - **PID协议标识(Protocol-Identifier)**:用于识别消息所遵循的协议。 - **DCS数据编码方案(Data Coding-Scheme)**:指定消息的编码方式。 - **VP信息有效期(Validity Period)**:定义了消息的有效期。 - **...

    hibernate错误汇总

    错误八:Exception in thread "main" org.hibernate.HibernateException: More than one row with the given identifier was found: 1, for class: org.model.User 错误原因:这个错误表示在尝试获取主键为1的实体...

    developing android application with adobe air.part3.rar

    Chapter 1 : AIR Installing the Adobe Development Tools Installing the AIR Runtime on an Android Device What Is in the AIR SDK New ActionScript Libraries AIR on the Desktop Versus AIR on Android Mobile...

    硬件精灵Unknown Device Identifier

    "硬件精灵Unknown Device Identifier"是一款专门用于识别和解决电脑中未知设备问题的工具软件。它在IT领域中扮演着重要角色,特别是在系统维护和硬件升级过程中。未知设备是指操作系统无法正确识别或驱动程序缺失的...

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

    RID A Row Identifier. Used to individually lock a single row within a table. Application A lock resource defined by an application. The lock manager knows nothing about the resource format. It simply...

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

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

    hibernate常见异常

    a different object with the same identifier value was already associated with the session 是一种常见的异常,通常是由于在 Hibernate 中同一个 session 里面有了两个相同标识但是是不同实体所致。解决方案有...

    C++编程中__if_exists与__if_not_exists语句的用法

    __if_exists ( identifier ) { statements }; 参数 参数 说明 identifier 要测试其存在性的标识符。 statements identifier 存在时要执行的一个或多个语句。 备注 若要实现最可靠的结果,请在以下约束...

    CPU-Identifier, 检查你的A9芯片制造商.zip

    CPU-Identifier, 检查你的A9芯片制造商 CPU标识符这个小应用程序可以检测你的iPhone的CPU芯片组。 对于 iPhone/6s,它还可以检测到A9芯片的制造商。编译的( 签名) 二进制文件将把芯片模型。设备模型和一个惟一 id ( ...

    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 ...

Global site tag (gtag.js) - Google Analytics