I have defined an interface A
pubic interface A<T>{
Class<T> getType();
default void deleteAll(){
Query.from(getType()).deleteAll();
}
}
public AFactoryBean<T,A<T>> implements FactoryBean<A<T>>{
public AFactoryBean(Class<A<T>> mapperInterface) {
this.mapperInterface = mapperInterface;
}
public Class<?> getObjectType(){
return A.class;
}
public A<T> getObject(){
Class<T> type ;//How can I get the T class;
InvocationHandler handler =new AInvocationHandler(type,.....);
return (A) Proxy.newProxyInstance(
mapperInterface.getClassLoader(),
new Class[]{mapperInterface},
handler
);
}
}
How can I get the T class? I have no class implements A,I just want to use JDK proxy. Is there any other way to achieve it ?
Comment From: bclozel
Thanks for getting in touch, but it feels like this is a question that would be better suited to Stack Overflow. As mentioned in the guidelines for contributing, we prefer to use the issue tracker only for bugs and enhancements. Feel free to update this issue with a link to the re-posted question (so that other people can find it) or add some more details if you feel this is a genuine bug.