I have a class file test.class. In this file there are annotations like @Idand @Entity. But when I check the annotation using the method field.isAnnotationPresent(Id.class), it returns false. I get all the fields in a field variable.
Can anyone tell me what mistake I made.
update: I use the following code to get the class
File file=new File("D:/test/");
URL url=file.toURL();
URL[] urls=new URL[]{url};
ClassLoader loader=new URLClassLoader(urls);
Class cls=loader.loadClass("com.net.test.Test");
source
share