users@glassfish.java.net

How to obtain Class from JPA entity name?

From: Markus Karg <karg_at_quipsy.de>
Date: Wed, 11 May 2011 17:19:59 +0200

Is there any chance for a program running in GlassFish to find out the
java.lang.Class that is the one having @Entity(name = "X")?

 

In other words, a users types in the String "X" and what he shall get is
the java.lang.Class that has @Entity(name = "X") or is class X and just
has @Entity.

 

I have no idea to solve that, but all the info is found at runtime
somewhere, so there should be a way to do that...

 

Thanks for all ideas! :-)

 

Regards

Markus