I'm in the process of migrating a spring boot application to micronaut and stumbled upon a problem with micronaut data. When using native queries which worked in spring boot data I get a compilation error for a query in which I try to insert some data into associative table.
Unable to implement Repository method: MyEntityRepository.insertQueryExample(int id, String name). No possible implementations found.
Other native queries (selects, deletes) work no problem, same goes for generated methods. Here's how the repo with said method looks like:
public interface MyEntityRepository extends CrudRepository<MyEntity, Integer> {
@Query(value = "insert into my_entity_my_entity2 (id, id2)" +
" values (:id, (select me2.id from my_entity2 os where me2.name = :name))", nativeQuery = true)
void insertQueryExample(int id, String name);
}
There's no entity class for my_entity_my_entity2 but that worked in spring so I don't think that's a problem.
Thanks in advance for your help.