English 中文(简体)
hibernate: session.load.
原标题:hibernate: session.load

I m 学习是温和的。 进行测试时,我引用了<代码>session.load,其中无效。 在我走过这条路后,我就没有发生任何事情——我预计会收到反对意见。 Than,我宣布Eval(alt+F8),结果:

bookFailedLoad = {rs.hibernateTest.model.Book$$EnhancerByCGLIB$$5dd17391@2088}Method threw  org.hibernate.ObjectNotFoundException  exception. Cannot evaluate rs.hibernateTest.model.Book$$EnhancerByCGLIB$$5dd17391.toString()
CGLIB$BOUND = true
CGLIB$CONSTRUCTED = true
CGLIB$CALLBACK_0 = {org.hibernate.proxy.pojo.cglib.CGLIBLazyInitializer@2094}
CGLIB$CALLBACK_1 = null
isbn = null
name = null
publisher = null
publishDate = null
price = 0
chapters = null

How did hb inform POJO that object is not valid. Please, could someone recommend me an article to help me understand what s happening under the hood before I stock in adventure of debugging hibernate source.

问题回答

You have to let the debugger run. load throws an exception if the entity is not found. If you look in the material you pasted, you see

Method threw  org.hibernate.ObjectNotFoundException  exception. Cannot evaluate rs.hibernateTest.model.Book$$EnhancerByCGLIB$$5dd17391.toString()

页: 1

As far as resources are concerned, the Hibernate in Action books is one of the best books I have ever bought. Well worth it if you are going to spend a lot of time with hibernate. Just make sure the version of the book you get is relevant to the version of hibernate you are using.





相关问题
Spring Properties File

Hi have this j2ee web application developed using spring framework. I have a problem with rendering mnessages in nihongo characters from the properties file. I tried converting the file to ascii using ...

Logging a global ID in multiple components

I have a system which contains multiple applications connected together using JMS and Spring Integration. Messages get sent along a chain of applications. [App A] -> [App B] -> [App C] We set a ...

Java Library Size

If I m given two Java Libraries in Jar format, 1 having no bells and whistles, and the other having lots of them that will mostly go unused.... my question is: How will the larger, mostly unused ...

How to get the Array Class for a given Class in Java?

I have a Class variable that holds a certain type and I need to get a variable that holds the corresponding array class. The best I could come up with is this: Class arrayOfFooClass = java.lang....

SQLite , Derby vs file system

I m working on a Java desktop application that reads and writes from/to different files. I think a better solution would be to replace the file system by a SQLite database. How hard is it to migrate ...

热门标签