I am currently using Roaster to create interfaces, but my interface has common types associated with it.
Here is what I tried to generate for starters:
String entityName = "SimpleEntity"; JavaInterfaceSource repository = Roaster.create(JavaInterfaceSource.class) .setName(entityName + "Repository"); JavaInterfaceSource jpaInterface = repository.addInterface(JpaRepository.class); jpaInterface.addTypeVariable(entityName); jpaInterface.addTypeVariable("String");
But the above results generate code that looks (something) like this:
public interface SimpleEntityRepository<SimpleEntity> extends org.springframework.data.jpa.repository.JpaRepository { }
In fact, I want the generic attribute to bind to a JpaRepository . How to do it?
java roaster
Makoto
source share