Skip to content

Instantly share code, notes, and snippets.

@odrotbohm
Created July 3, 2014 18:04
Show Gist options
  • Save odrotbohm/c5a931326d0408c3a0f2 to your computer and use it in GitHub Desktop.
Save odrotbohm/c5a931326d0408c3a0f2 to your computer and use it in GitHub Desktop.
package foo;
@NoRepositoryBean
interface InternalRepository<T> extends Repository<T, Long> {
<S extends T> save(S entity);
}
package foo;
public interface PersonRepository extends InternalRepository<Person> {
List<Person> findByLastname(String lastname);
}
package foo;
class Service {
@Autowired PersonRepository repo;
}
package foo.web;
@Controller
class PersonController {
@Autowired PersonRepository repo;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment