0

I have a method

public RepositoryRestConfiguration exposeIdsFor(Class<?>... domainTypes) {
    Collections.addAll(exposeIdsFor, domainTypes);
    return this;
}

I want to pass to exposeIdsFor all the classes annotated with @org.springframework.data.mybatis.annotations.Entity using their package location :

  • packageA: com.packageA.domain
  • packageB: com.packageB.domain

It should look like :

@Override
public void configureRepositoryRestConfiguration(RepositoryRestConfiguration config) {
    config.exposeIdsFor(...);
}

How is it possible?

Dimitri Kopriwa
  • 13,139
  • 27
  • 98
  • 204
  • Looks like a duplicate of https://stackoverflow.com/q/259140/1032167 https://github.com/ronmamo/reflections + `new Reflections("my.package").getTypesAnnotatedWith(MyAnnotation‌​.class)` – varren Nov 04 '17 at 18:18
  • @varren I have tried reflection and it does not work during test because of this: https://github.com/ronmamo/reflections/issues/80 do you have another solution? – Dimitri Kopriwa Nov 04 '17 at 19:25

0 Answers0