@Retention(value=RUNTIME) @Target(value=TYPE) public @interface Finder
@Finder
public interface FooFinder {
List<FooDto> findFoosWithName(String name);
}
2) Then, create the implementation of this interface.
@Finder
public class JpaFooFinder implements FooFinder {
@Inject
EntityManager entityManager;
List<FooDto> findFoosWithName(String name) {
entityManager.createQuery( ... ) ;
return query.getResultList();
}
3) Finally, SEED will automatically provide the injection of the Interface
@Inject private FooFinder fooFinder; - - - - 8< - - - - @Inject public void provideFinder (FooFinder fooFinder) - - - - 8< - - - - fooFinder.findFoosWithName(nameToFind);
Copyright © 2013-2015–2015. All rights reserved.