Quantcast
Channel: Apache Timeline
Viewing all articles
Browse latest Browse all 5648

"Unwrapping" enhanced entity

$
0
0
Hello,

I would like to pass an enhanced entity
(org.apache.openjpa.util.com$MyClass$0$proxy) to an 3rd party framework
that does some reflection stuff. In particular, that framework does
myEntity.getClass().getFields().

According to spec (read it someplace in oracle docs) - proxy shall
return a null array when getFields() is being invoked. This is also
happening in my case.

The 3rd party framework fails since it does not find any fields.

I am looking now for a good practice on how to "unwrap" the entity or
modify that 3rd party framework in a way that I get access to the
original field array of com.MyClass.

myEntity.getClass.getGenericSuperclass() returns the right type
(com.MyClass) but I am unsure on if and how to instrumentalize this.

I'd greatly appreciate any hints on this one.

kind regards
reinis

Viewing all articles
Browse latest Browse all 5648

Latest Images

Trending Articles



Latest Images