GAE/JDO: How to check whether a field in a detached object was loaded
- by tempy
My DAO detaches and then caches certain objects, and it may retrieve them with different fetch groups. Depending on which fetch group was used to retrieve the object, certain fields of that object may be available, or not. I would like to be able to test whether a given field on that object was loaded or not, but I can't simply check whether the field is null because that results in a "JDODetachedFieldAccessException" which demands that I either not access the field or add detach the field first.
I could always catch that exception, but that doesn't smell right. So, does anyone know whether its possible to check if the field was detached?