开发者

GAE/JDO: How to check whether a field in a detached object was loaded

My DAO detaches and then caches certain objects, and it may retrieve them with different fetch groups. Depending on which fetch grou开发者_如何学Gop 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 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?


http://www.datanucleus.org/products/accessplatform/jdo/attach_detach.html

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜