I would like to extend my TestRepository interface with JpaRepository and utilize the features such as jpa method queries, paging and sorting without manually defining entity manager bean and without writing any sql. P.S. In micronaut project
Edit - July 2019
They have announced a spring data equivalent named Micronaut Data
Micronaut does not support Spring's AOP implementation right now. So you should not expect to use an object as Repository by simply implementing JpaRepository<T,ID>
However you can write a spring based app/library then add this jar as a micronaut project dependency... It should work in theory. Maybe some kind of bridge needed to share environment/profile info and retrieve this repositories to micronaut context
Or, as mentinoned in comments, you can write your own Repository stubs with Introduction Advice of micronaut. If you generally use @Query
annotation in spring repositories, it should be quite easy to implement an equivalent for micronaut app
The Predator proyect was renamed Micronaut Data. There are already maven packages for milestone 1.
The documentation is quite good. You can use the same JPA annotated model with MicronautData repositories. You can use it with or without Hibernate. It is as easy as:
@Repository
interface BookRepository extends CrudRepository<Book, Long> {
Book find(String title);
}
On the other hand. It seems that Spring repositories can be used with micronaut. Look at this official example
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With