1 Answers1

0

In this case [1]: https://i.stack.imgur.com/dpt7e.png the first query cannot work because you are returning a different data type than the one indicated by the function

And in the second case [1]: https://i.stack.imgur.com/8DuZ6.png you are using a like operator for a Long data type, which is not possible.

Try something like this:

@Query(value="Select b from Bill where b.group.g_id =:gid")
List<Bill> findByGid(@Param("gid") Long gid);

I also don't understand why you try to make the union with g_id instead of with group.id

I really think the code you need is this:

@Query(value="Select b from Bill where b.group.id =:gid")
List<Bill> findByGid(@Param("gid") Long gid);