我在项目中使用javassist,我需要在运行时创建以下接口:
package com.example;
import org.springframework.data.repository.CrudRepository;
import com.example.Cat;
public interface CatRepository extends CrudRepository<Cat, Long> {}
Run Code Online (Sandbox Code Playgroud)
虽然我没有创建CatRepository扩展接口的问题CrudRepository,但我不明白(从文档和查看源代码),如何指定com.example.Cat和java.lang.Long作为超级接口的泛型类型.
请注意:
com.example.Cat:在运行时使用javassist创建(没有问题,我也测试过它的工作原理org.springframework.data.repository.CrudRepository:来自库的现有类.如果任何人可以帮助,那将是伟大的!
谢谢!卢卡