I have the same problem. Just to make sure you understand me consider this example:
I have a persistent class A
Code:
class A {
private B b;
...
}
and b shall be lazy, because I don't need b very often.
In my application I want to retrieve a large list of objects of type A to print them. In this case I also want to print the id of b. Hibernate already knows about the id of b, but it's hidden in hibernate's wrapper class for B, called B_$$_javassist_3. Is there a way to get to this hidden id without accessing the database again? I mean calling a.getB().getId() would be possible but would entail unnecessary effort and would take very long in my case. I also know about the solution of using SQL or HQL queries not to retrieve the persistent A objects as objects but as list of properties. But IMO that's not very comfortable.
Any ideas how to get to the hidden id of an lazy property?
Thanks in advance.