tags:

views:

21

answers:

0

I’m using iBatis with lazy-loading. I have a result map of a Person class and it has a result property, Friend, which selects another table.

The problem I’m having is that, somewhere in the code I’m checking for: if(user.getFriend() == null) { //do something}

But that condition is always false, even though a user which I got back has no friends. Even looking in the debug mode, user.getFriend() evaluates to a null value. That is because the Friend property is being proxied by CGLIB.

Is there a way to get around the proxy and actually tell if user.getFriend() is null?