About org. hibernate. ObjectNotFoundException: No row with the giv

Source: Internet
Author: User

Recently, due to project upgrades and external interface changes, the database table data is updated. Of course, the table structure is not changed. When it is deployed later, the following error is reported: serious Java code: Servlet. service () for servlet default threw exception org. hibernate. objectNotFoundException: No row with the given identifier exists: [com. iss. fit. po. system. sysDepartment #361] at org. hibernate. impl. sessionFactoryImpl $1. handleEntityNotFound (SessionFactoryImpl. java: 377) at org. hibernate. event. def. defaultLoadEventListener. load (De FaultLoadEventListener. java: 145) at org. hibernate. event. def. defaultLoadEventListener. proxyOrLoad (DefaultLoadEventListener. java: 179) at org. hibernate. event. def. defaultLoadEventListener. onLoad (DefaultLoadEventListener. java: 103) at org. hibernate. impl. sessionImpl. fireLoad (SessionImpl. java: 878) at org. hibernate. impl. sessionImpl. internalLoad (SessionImpl. java: 846) at org. hibernate. type. entityType. resolve Identifier (EntityType. java: 557) at org. hibernate. type. entityType. resolve (EntityType. java: 379) this type of errors are generally divided into two types: Servlet. service () for servlet default threw exception, the first is the jsp page binding element error, of course, this error will be very clear, xx. which part of jsp (xx, xxx) is incorrect? The second is the ing object for the object class. # xx reports an error. Here, # xx, for example, #4, #5 and so on. It is not fixed. Here I am talking about SysDepartment #361, that is, my table A is associated with SysDepartment and there is A piece of data in table, the ID of the associated SysDepartment is 361, so the above error will be reported if the reference cannot be obtained during the query. Www.2cto.com, so the solution is also relatively simple. I have updated the SysDepartment table here, so it does not have data with the ID of 361, so in its associated table A,. sysDepartment_ID does not exist either. sysDepartment_ID = 361, so you set. set SysDepartment_ID to the ID of the newly updated data in the SysDepartment table, or you can manually add a 361 ID.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.