Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

CGLIB question

 
Vinicius Carvalho
Ranch Hand
Posts: 61
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello there! From an enhanced persistent class, how can I find the name of the original object, not the proxied? I mean, I tried this:

Class clazz = target.getClass();
Object destination = clazz.newInstance();

Problem is, that target is something like this: com.acme.model.User$EnhancerByCGLIB$$1db5f89 I just like to get the User class, not the enhanced one. Is there a clean way to do this (I always can manipulate the string from target.getClass().getName() and use Class.forName()...)
??

Regards
 
Peer Reynders
Bartender
Posts: 2968
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No clue it this will work but you might as well give it a go:
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic